[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Routing



David Z Maze wrote:

"Mark Maas" <mark@menem.mine.nu> writes:

[snip]

when only eth0 is up I can reach my local lan, 192.168.8.0-255, the
lan of another firm, 192.168.3.0-255 and yet another firm,
10.1.0.0-255.

But when I bring up eth1, I can only reach my local lan, and not the
other two anymore.

My guess is that everything other then 192.168.8.0-255 is thought to
be Internet so it tries the eth1 nic. Which will not answer.

Now how do I tell Debian to route all traffic for 192.168.3.0-255
and 10.1.0.0-255 over the eth0 interface?

You probably need to use /sbin/route to tell the machine that there
are routes to 192.168.3.0/24 and 10.1.0.0/24 (/16?) via the gateway
machine on 192.168.8.0/24.  This will look something like:

 route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.8.1
 route add -net 10.1.0.0 netmask 255.255.255.0 gw 192.168.8.1

(Just using 'dev eth0' tells route to spew packets for those networks
on to the local network, which isn't what you want.)

Once you see that is working for you, add those lines to /etc/network/interfaces in the eth0 block, eg:

iface eth0 <current options like inet and dhcp or static>
   [other options you may have set]
   up route add -net 192.168.3.0 netmask 255.255.255.0 gw 192.168.8.1
   up route add -net 10.1.0.0 netmask 255.255.255.0 gw 192.168.8.1

That way when your other interface comes up later and becomes the default route, these static routes are already there and you didn't have to remember to type the route add commands.

see "man 5 interfaces" for more details.

--
Jacob



Reply to: