Dual Homed

Rick Stevens rstevens at vitalstream.com
Mon Oct 10 18:05:49 UTC 2005


On Sat, 2005-10-08 at 15:48 -0600, karlp at ourldsfamily.com wrote:
> Is it possible to have 2 gateways operating at the same time on the same
> FC4 workstation?
> 
> eth0=172.20.20.100
> eth1=10.0.0.100
> 
> gateway0=172.20.20.1 (Cisco router)
> gateway1=10.0.0.1 (Dual-homed RH8.0 iptables: 10.0.0.1>172.20.20.1)
> 
> Just curious about different ideas.

You can only have one default route.  There are routes set up whenever
you configure a NIC (a route through the NIC is created for the network
that NIC is on):

[root at prophead rc5.d]# netstat -rn
Kernel IP routing table
Destination   Gateway      Genmask         Flags  MSS Window  irtt Iface
65.7.196.64   0.0.0.0      255.255.255.192 U        0 0          0 eth0
169.254.0.0   0.0.0.0      255.255.0.0     U        0 0          0 eth0
0.0.0.0       65.7.196.65  0.0.0.0         UG       0 0          0 eth0

As you can see, my NIC is on the 65.7.196.64/26 network, and any traffic
for that net will go through eth0.  It also happens that my default
route ALSO goes through there because there's only one NIC.  Now, on
another machine:

[root at stats-01-002 root]# netstat -rn
Kernel IP routing table
Destination    Gateway        Genmask       Flags  MSS Window irtt Iface
217.133.230.0  0.0.0.0        255.255.255.0  U       0 0         0 eth0
10.24.0.0      0.0.0.0        255.255.252.0  U       0 0         0 eth1
10.25.0.0      10.24.1.1      255.255.252.0  UG      0 0         0 eth1
127.0.0.0      0.0.0.0        255.0.0.0      U       0 0         0 lo
0.0.0.0        217.133.230.1  0.0.0.0        UG      0 0         0 eth0

As you can see, there's two NICs in this machine, one on the
10.24.0.0/22 network and one on the 217.133.230.0/24 network.  The 
first, second and fourth lines show the routes added automatically for
the NIC setups (yes, there's one for lo...127.0.0.0/8 or localhost).
The third line shows a manual route was added to 10.25.0.0/22 network
using the gateway on the 10.24.0.0/22 network (via eth1).  The final
line shows the default gateway (from /etc/sysconfig/network) and
also specifies a gateway (via the eth0 NIC).

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-           Give me ambiguity or give me something else!             -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list