[Gllug] Dual-homed hosts

David Damerell damerell at chiark.greenend.org.uk
Fri Dec 7 09:42:09 UTC 2001


On Thursday, 6 Dec 2001, Dylan Brewis wrote:
>When configuring a host on two networks, how should I go about ensuring a 
>connection goes via the correct nic? For example, eth0 (192.168.1.1) 
>connecting to 192.168.1.0/8 and a gateway to the web; eth1 (192.168.2.1) 
>connected to 192.168.2.0/8 - all packets destined from host to 192.168.2.x go 
>to eth1, all others to eth0.

I'm sure you mean /24; it would be better not to specify subnet masks
than to make them up at random. Don't use 192.168.1 and .2, pick
random subnets of 192.168.0.0/16.

All packets to 192.168.1.0/24 and 192.168.2.0/24 will go via the
appropriate interface; remaining packets will go via the default
route, which you should ensure is in one of the two local networks.

> How do I make sure that the host does not route 
>from one interface to the other?

That's another question;
/proc/sys/net/ipv4/ip_forward 
normally governs it (and likewise for ipv6, if it's in use), if the
kernel supports IP forwarding at all. Set it to zero to disable
forwarding between interfaces.

-- 
David Damerell <damerell at chiark.greenend.org.uk> flcl?

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list