Gateway problem

Rick Stevens rstevens at vitalstream.com
Wed Feb 22 02:00:08 UTC 2006


On Tue, 2006-02-21 at 19:06 -0600, inode0 wrote:
> On 2/21/06, Rick Stevens <rstevens at vitalstream.com> wrote:
> > On Mon, 2006-02-20 at 02:06 -0600, inode0 wrote:
> > > I guess. There can be multiple default gateways although only one
> > > active at a time. My preference is that each interface have an
> > > appropriate gateway set for it and which is used as the default
> > > network gateway is controlled by setting GATEWAYDEV in
> > > /etc/sysconfig/network rather than by setting the default gateway
> > > directly there.
> >
> > No, there is only ONE default gateway.  The rest are network- or device-
> > specific gateways.  GATEWAYDEV simply forces the default gateway to use
> > a specific device, but the source address of the packets so routed will
> > still have the original address.
> 
> Serious question:
> 
> How do the following two arrangements differ in practice?
> 
> (1) Set GATEWAY=10.10.1.254 in /etc/sysconfig/network
> 
> (2) Set GATEWAY=10.10.1.254 in the eth0 profile and set
> GATEWAYDEV=eth0 in /etc/sysconfig/network
> 
> I wasn't really thinking about the gateway being defined by DHCP but
> if it is isn't it put in the interface profile anyway?
> 
> I'm sitting at a box with three NICs, each connecting to a different
> network. The gateway I use as the default seems tied to the interface
> anyway. So it seems that controlling the default via GATEWAYDEV makes
> good sense (until you help me understand why it doesn't at least).
> 
> Less seriously:
> 
> # route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 10.10.0.0       *                     255.255.255.0    U       0      
> 0        0   eth0
> 10.10.1.0       *                      255.255.255.0   U        0     
>  0        0  eth1
> 0.0.0.0          10.10.1.254       0.0.0.0             UG     0      
> 0        0   eth0
> 0.0.0.0          10.10.0.254       0.0.0.0             UG     0      
> 0        0   eth1
> 
> What would you call those last two things? *** picture John ducking
> *** When I said you could have multiple default gateways this is what
> I had in mind when I said it.

Well, that's a weird kernel routing table for sure.  The default one
will be the last one listed, I'll wager.  While they both show up as
gateways, the last one in the table is usually treated as the default.
Having a setup as you have there will often confuse the hell out of ARP
tables and such down the line and may break some non-robust spanning
tree algorithms.

Really, you only need one default route and it should be aimed at a real
gateway IP, not at a device.  The device mechanism is there to allow you
to "bridge" a network where you don't have a true gateway and, while it
works, it is very confusing to a lot of upline hardware.  When you
specify a gateway IP, it will bind to the interface on the network
where the gateway is.

Your stuff will work.  The default is the last one listed in your table
(I'd have to look into that to be sure...it may be the first one), but
you still only have one default and configs such as yours can cause
problems down the road.  Just be aware of it.
> 
> John
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-          "How does that damned three seashell thing work?"         -
-                           - Sylvester Stallone, "Demolition Man"   -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list