routing tables on two NICs for network monitoring

Shawn Iverson shawn at nccsc.k12.in.us
Thu Jan 22 13:28:37 UTC 2004


> From: Shawn Iverson [mailto:shawn at nccsc.k12.in.us]
> Sent: Thursday, January 22, 2004 7:52 AM
> > From: Rick Stevens [mailto:rstevens at vitalstream.com]
> > Sent: Wednesday, January 21, 2004 9:03 PM
> > > 
> > > route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.32.0.254 dev eth0
> > > route add -net 192.168.0.0 netmask 255.255.0.0 gw 
> > 10.32.0.254 dev eth0
> 
> Aren't these lines above ok?  If I don't specify 10.32.0.254 
> as the gateway,
> nothing will go beyond the 10.10.0.0/16 subnet.  I have many 
> subnets with
> 10.x.0.0/16 addresses spanning several buildings and one 
> 192.168.1.0/24
> subnet.
> 
> > > 
> > > /etc/sysconfig/network-scripts/route-eth0 is my guess to 
> > add the above to
> > > make the changes permanent
> > > 
> > > GATEWAY0=10.32.0.254
> > > NETMASK0=255.0.0.0
> > > ADDRESS0=10.0.0.0
> > > GATEWAY1=10.32.0.254
> > > NETMASK1=255.255.0.0
> > > ADDRESS1=192.168.0.0
> > 
> > GOD NO!  Bad dog!  Bad!  NEVER assign a host an IP address 
> that's the
> > same as the network (your "ADDRESS0=10.0.0.0" and
> > "ADDRESS1=192.168.0.0" lines).  Also NEVER assign a host the 
> > IP address
> > that is the broadcast address for the net (where the host bit is all
> 
> I thought that I was specifying a network above, not a host.  
> Does that mean
> that the route-eth0 file only does routes to hosts?  I want 
> to make the
> network routes persistent (ifdown/ifup/reboot all do not 
> cause the routes to
> vanish).

Ooops!  All this time I have been typing 10.32.0.254, I meant 10.10.0.254!

Ok, I found this information in
/usr/share/doc/initscripts-7.42/sysconfig.txt

/etc/sysconfig/network-scripts/route-<interface-name>

  Contains lines that are arguments to "/sbin/ip route add"
  For example:

  192.168.2.0/24 dev ppp0

  adds a network route to the 192.168.2.0 network through ppp0.


So, I would have the following in route-eth0:

10.0.0.0/8 via 10.10.0.254 dev eth0		(I have many 10.x.0.0
subnets)
192.168.0.0/16 via 10.10.0.254 dev eth0	(I have more than one 192.168.x.0
subnet)

Ok, maybe my routes above are too simple because I don't want 10.10.0.0/16
traffic to try to exit via the 10.10.0.254 gateway.  Would I necessarily
need to make a route for every subnet on my network (20 subnets), or could I
just add the following before the above two, assuming that the routing table
is read from the top downward?  (Thank goodness I didn't set up the routers
for this network...I would have everything messed up!)

10.10.0.0/16 dev eth0















More information about the fedora-list mailing list