[PLUG] Red Hat routing follies

Derek Loree drl at drloree.com
Sun Oct 26 22:12:02 UTC 2003


On Sun, 2003-10-26 at 19:21, Carla Schroder wrote:
> I have two NICs installed in one of my test boxes. Currently I'm messing 
> around with Red Hat 9. The NICs are common DLink and Linksys, all duly 
> recognized & drivers installed at installation. I'm using only one of them, 
> the box connects to a gateway/firewall/switch unit. The IP of the gateway is 
> 192.168.1.1
> 
> The weird part is I can't figure out how Red Hat determines which one to use. 
> They are configured the same:
> 
> eth0
> DEVICE=eth0
> ONBOOT=yes
> BROADCAST=192.168.1.255
> IPADDR=192.168.1.6
> NETMASK=255.255.255.0
> GATEWAY=192.168.1.1
> 
> eth1
> DEVICE=eth1
> ONBOOT=yes
> BROADCAST=192.168.1.255
> IPADDR=192.168.1.8
> NETMASK=255.255.255.0
> GATEWAY=192.168.1.1
> 
>  The first time I booted it up, I had eth1 connected. But I couldn't get a 
> network connection until I moved the cable to eth0. Now RH has decided it 
> will use eth1.  How?

Well, it just ain't natural to run two interfaces on the same network. 
My guess is that it is a race condition for the default route.  Which
ever one wins the race gets to keep the route, sorta thing.  You should
be able to fix it with a "route add" command. Something like

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0

should force things to go the way you want them to.
> 
> This looks weird too:
> 
> % /sbin/route
> 
> Destination	Gateway	Genmask		Flags	Metric	Ref	Use	Iface
> 192.168.1.0		*	255.255.255.0	U		0		0	0	eth1
> 192.168.1.0		*	255.255.255.0	U		0		0	0	eth1
> 169.254.0.0		*	255.255.0.0	U		0		0	0	eth1
> 127.0.0.0			*	255.0.0.0		U		0		0	0	lo
> default				192.168.1.1	UG		0		0	0	eth1
> 
> Wut the heck is going on here? How did eth1 get all the goodies? where did 
> 169.254.0.0 come from?

I think this is the address space that Winblows boxes use if they can't
find a DHCP server.  RedHat must be making it easier to find them.
> 
> signed, dazed and confused

If you set one of your cards to have no gateway, the other will always
do the routing for you.

HTH,

Derek Loree





More information about the PLUG mailing list