I know you've solved this another way but you might be interested in 
knowing why it worked out that way.
I've answered this by inserting lines with [G]

On Mon, 24 Sep 2001, Tom Massey wrote:

> Hi all.
> 
> I'm having some difficulty with routing under Red Hat 7. Basic situation:
> Me and few friends have a machine running RH7 that we're playing with
> networking stuff on, different configurations just for the hell of it
> basically. At the moment the machine contains 4 NICs - eth0 to a cable
> modem, eth1 to a LAN (masquerading etc), then eth2 and eth3 which each go
> to separate machines, isolated from the rest. This was all set up and
> working fine, but then the machine was rebooted.
> 
> Now whenever eth1, eth2, or eth3 are brought up, something adds a
> route to the routing table such that each interface is associated with
> the destination 192.168.1.0, as well as any other routing info we stick
> in /etc/sysconfig/static-routes. This happens whether the interface is
> brought up with ifup or ifconfig. At the moment the routing table looks
> like:
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 192.168.1.13    192.168.1.10    255.255.255.255 UGH   0      0        0 eth3
> 192.168.1.13    *               255.255.255.255 UH    0      0        0 eth3
> 192.168.1.12    192.168.1.9     255.255.255.255 UGH   0      0        0 eth2
> 192.168.1.12    *               255.255.255.255 UH    0      0        0 eth2
> 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 eth2
> 192.168.1.0     *               255.255.255.0   U     0      0        0 eth3
> xx.xx.xx.xx     *               255.255.255.0   U     0      0        0 eth0
> 127.0.0.0       *               255.0.0.0       U     0      0        0 lo
> default         xx.xx.xx.xx     0.0.0.0         UG    0      0        0 eth0
> 
> (The x's are just to avoid my friend beating me up for disclosing his IP
> number ;-) 
> 
> This is obviously a really messy routing table, but 192.168.1.10 == eth3,
> 192.168.1.9 == eth2, and the destinations are correct. Problem seems to
> be the routes to 192.168.1.0. I haven't been able to work out where they're
> coming from. route del 192.168.1.0 gives SIOCDELRT: No such process. Can't
> seem to get rid of these routes no matter what I try. And I can't seem to
> work out where they're coming from in the first place.
> 
> /etc/sysconfig/network-scripts/ifcfg-eth1 looks like:
> 
> DEVICE=eth1
> USERCTL=no
> ONBOOT=yes
> BOOTPROTO=none
> IPADDR=192.168.1.1
> 
> As do ifcfg-eth2, and ifcfg-eth3, with different IPADDR.
> 
> /etc/sysconfig/static-routes looks like:
> eth2 host 192.168.1.12
> eth3 host 192.168.1.13

[G] The problem is you haven't specified the NETMASK and BROADCAST 
parameters. Now ifconfig (as opposed to older versions) makes an 
assumption that you're using a class C address which seems to suit most 
people. It's a good default. Problem is you're not doing that. Try adding
NETMASK=255.255.255.255
BROADCAST=192.168.1.12 (for eth2)
Now the only other gotcha is these routes should come before the route for 
eth0 or it's probably not going to work.

> (we've also had gateway info in there at some stage, this seems to make
> no difference)
> 
> This was all set up before the reboot and was working - i.e. the kernel
> (2.2.19) was recompiled to support the NICs we were going to stick in the
> machine, the machine was powered down, the NICs inserted, the machine
> booted, the necessary entries were added to /etc/modules.conf, the NIC
> modules loaded OK, all necessary changes were made so that the NICs could
> talk to the machines conected to them. Then after a reboot, this new routing
> info was loaded, that seems to have broken things so that whenever the
> interfaces are brought up, routes to 192.168.1.0 are added, though we don't
> seem to have changed anything that would lead to this.

[G] This is a little strange but highly likely to do with the order in 
which you brought up the interfaces & loaded the modules. As an excercise 
you can 'swap' eth2 and eth3 by changing the order the modules are loaded. 
If using the same type of card it's more difficult but can possibly be 
done by specifying the IRQ & Memory locations of the specific cards.

> I've googled and so on, but can't seem to find any relevant info. Can
> anyone tell me where these routes to 192.168.1.0 are coming from? I have
> a feeling it's something really simple I've missed, but I just can't see
> what. I just can't figure out what's happened so that a set up that was
> working fine before a reboot is completely broken after the reboot.

It's not really a 'googleable' topic :-(
You need to at least read a book on TCP/IP networking and get a good 
understanding of routing and subnetting.

-- 
---<GRiP>--- 
Web: www.arcadia.au.com/gripz 
Phone/fax: 02 4950 1194   
Mobile: 0408 686 201


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to