Networking Forums

Networking Forums > Computer Networking > Linux Networking > pemanent static routes?

Reply
Thread Tools Display Modes

pemanent static routes?

 
 
Davide Bianchi
Guest
Posts: n/a

 
      10-14-2004, 11:03 AM
On 2004-10-14, Olivier <(E-Mail Removed)> wrote:
> do not understand why when i modify the routes they do not stay after
> reboot.


Because if you don't write them down in some script that is executed
at reboot the machine won't do it on his own.

> 10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
> 10.10.10.0 * 255.255.255.0 U 0 0 0 eth1


Why twice?

> 10.10.10.0 * 255.255.255.0 U 0 0 0 eth0
> 10.10.10.0 * 255.255.255.0 U 0 0 0 eth1


This is an error. You can't have twice the same network on two
different interfaces, how can the poor bastard know where to send
the packet then?

Davide

--
Are you scared of speed? If so, then try Windows 95.
 
Reply With Quote
 
 
 
 
Olivier
Guest
Posts: n/a

 
      10-14-2004, 11:08 AM
Hi All,

I have a system mandrake 9.1 with two interfaces (eth0 and eth1), and I
do not understand why when i modify the routes they do not stay after
reboot.
_ I have at boot time:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo

_ I delete one of the eth1 and add eth0 to get:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.10.0 * 255.255.255.0 U 0 0 0 eth0
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo

But after reboot I get back to the first routing configuration, and I
don't know why.
Any idea?
Thanks,

Olivier
 
Reply With Quote
 
Olivier
Guest
Posts: n/a

 
      10-14-2004, 11:55 AM
Davide Bianchi wrote:
> Because if you don't write them down in some script that is executed
> at reboot the machine won't do it on his own.

Yes, in fact I agree that it will be the solution to set the route table
at starting time, but the question is more or less: from where comes the
first route config?
I guess that it exists somewhere a config (or script) file to set it up
and I will prefere to modify it with what I want, more than to add a new
script file. Currently, I didn't find this config file.

> This is an error. You can't have twice the same network on two
> different interfaces, how can the poor bastard know where to send
> the packet then?

You are right, this is appears as an error, but it is only for testing
purpose. In my case only one interface is connected at a time, and the
routing is always ok.

Olivier
 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a

 
      10-14-2004, 12:01 PM
On 2004-10-14, Olivier <(E-Mail Removed)> wrote:
> at starting time, but the question is more or less: from where comes the
> first route config?


Everytime you 'activate' a network card a route is automatically added
to link the network card with his subnet, so if you do an
ifconfig eth0 192.168.1.0 netmask 255.255.255.0 up, you'll get a
route like 192.168.1.0 * eth0 (meaning: network 192.168.1.0 is
connected to eth0).

Then, you should have a gateway, that is, the IP/machine where I send
everything I don't know where to send otherwise. The gateway is not
mandatory, but is required if you have some kind of internetworking or
more subnets connected togheter. The gateway is written in some
configuration scripts, if it's mandrake or redhat it should be in
/etc/sysconfig/network-scripts or the like.

> In my case only one interface is connected at a time, and the
> routing is always ok.


Is still not Ok. It doesn't matter if you don't have a link, the machine
still doesn't know where to send the packets.

Davide

--
SETI@home:
That would be on the "Let's look for intelligence out there, because there's
none here" principle? -- Paul Tomblin
 
Reply With Quote
 
Olivier
Guest
Posts: n/a

 
      10-14-2004, 02:48 PM
Davide Bianchi wrote:
> Everytime you 'activate' a network card a route is automatically added
> to link the network card with his subnet, so if you do an
> ifconfig eth0 192.168.1.0 netmask 255.255.255.0 up, you'll get a
> route like 192.168.1.0 * eth0 (meaning: network 192.168.1.0 is
> connected to eth0).

eth0 and eth1 are activated by /etc/rc.d/init.d/network using the
following scripts:
/etc/sysconfig/network-scripts/ifcfg-eth0 (and eth1)

But only eth1 appears (twice) when I check with the command route (or
netstat):
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1

I still don't know why. Is it a way to set traces to know which modules
or script call "route"?

 
Reply With Quote
 
Olivier
Guest
Posts: n/a

 
      10-14-2004, 04:39 PM
Davide Bianchi wrote:
> On 2004-10-14, Olivier <(E-Mail Removed)> wrote:
>
>>at starting time, but the question is more or less: from where comes the
>>first route config?


Thanks for your help Davide. I have found the origin of the problem.
When "network" script (/etc/rc.d/init.d/network) calls
/sbin/ifup eth0 boot
then
/sbin/ifup eth1 boot
ifup modifies the routing table and the first interface (eth0) is
replaced by eth1 whatever is the network destination.

Example:
1) /sbin/ifup eth0 boot
=> gives the route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.9.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
2) then
/sbin/ifup eth1 boot
=> gives the route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.9.0 * 255.255.255.0 U 0 0 0 eth1 <== ???
10.10.10.0 * 255.255.255.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo

It seems that's a bug of ifup. It should be checked with a new mandrake
distribution, that I haven't.
Of course I will use a routing script to set up the correct routing table.

Regards,

Olivier
 
Reply With Quote
 
Olivier
Guest
Posts: n/a

 
      10-14-2004, 07:30 PM
I found that ifup can't manage two interfaces adressing the same subnetwork.
It is possible to set that by hand, but not at startup time without
modifying ifup.
 
Reply With Quote
 
Michael Heiming
Guest
Posts: n/a

 
      10-14-2004, 09:17 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

In comp.os.linux.networking Olivier <(E-Mail Removed)>:
> I found that ifup can't manage two interfaces adressing the same subnetwork.
> It is possible to set that by hand, but not at startup time without
> modifying ifup.


Yup, as it's a pretty dump idea having more then one interface
on the same subnet, unless you are using the bonding driver.
/usr/src/linux/Documentation/networking/bonding.txt for more info.

--
Michael Heiming (GPG-Key ID: 0xEDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBbuzjAkPEju3Se5QRAqlUAJ9olyNS9MH/EHmP9JRFVxzpH7KBYACfTohJ
4s10gu4/g7ktcCbLpLJixYQ=
=HgWo
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static routes...? Geir Network Routers 0 01-09-2008 06:42 AM
RAS and Static Routes Daniel Moseley Windows Networking 3 11-21-2006 06:13 AM
128 static ip routes? Jeff Wells Windows Networking 1 09-26-2006 11:39 AM
Static routes? Armando Mendez Windows Networking 3 02-18-2004 05:05 PM
static routes paolo Linux Networking 3 08-25-2003 04:30 PM



1 2 3 4 5 6 7 8 9 10 11