Default Route question when there are two nic cards

John Austin ja at jaa.org.uk
Thu Oct 12 20:21:18 UTC 2006


On Thu, 2006-10-12 at 08:28 -0600, David G. Miller wrote:
> John Austin <ja at jaa.org.uk> wrote:
> 
> >>I point people in this direction because their next question is usually, 
> >>> "How do I get the "other system" onto the internet?"  Also, only one 
> >>> default gateway ends up defined in the routing table.  The system does 
> >>> the right thing and uses the the default gateway specified for eth0 even 
> >>> though the gateway specified by eth1 comes "later:"
> >>> 
> >>> Kernel IP routing table
> >>> Destination     Gateway         Genmask         Flags   MSS Window  irtt 
> >>> Iface
> >>> 72.19.169.0     0.0.0.0         255.255.255.0   U         0 0          0 
> >>> eth0
> >>> 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 
> >>> eth1
> >>> 192.168.0.0     0.0.0.0         255.255.0.0     U         0 0          0 
> >>> eth1
> >>> 0.0.0.0         72.19.169.1     0.0.0.0         UG        0 0          0 
> >>> eth0
> >
> >There is no gateway shown associated with eth1 !?
> >
> >So no notice has been taken of the GATEWAY=72.19.169.230
> >in /etc/sysconfig/network-scripts/ifcfg-eth1
> >
> >I cannot see that this entry achieves anything
> >
> >John
> >
> There is a difference between a "gateway" and a route.  192.168.0.0/16 
> through eth1 does not need a gateway since all addresses on that subnet 
> are directly accessible.  Likewise, the 72.19.169.0/24 subnet is 
> directly accessible through eth0.  The default route shows up as a 
> gateway since addresses other than some subnet of 72.19.169.0/24 are 
> indirectly accessible (traffic has to go through other routers).  I ran 
> across the following which puts all this a little more succinctly:
> 
> > Gateways are a type of router. /Routers/ connect two or more networks 
> > and provide the routing function. Some routers, for example, route at 
> > the network interface level or at the physical level. /Gateways/, 
> > however, route at the network level.
> 
> My approach may not work if I had multiple gateways or a more complex 
> network.  I don't and it works quite well.  I think I originally came up 
> with this approach after reading the O'Reilley book "Linux Network 
> Administration" probably when I was running RHL-5 or RHL-6.X.
> 
> Cheers,
> Dave
> 
> -- 
> Politics, n. Strife of interests masquerading as a contest of principles.
> -- Ambrose Bierce
> 

Hi Dave

I agree with everything you say !!!!!!!
I am just not convinced that a GATEWAY statement in
ifcfg-eth1
is necessary to achieve the required route table.

Cheers
John






More information about the fedora-list mailing list