Hi all,
Sorry this is a pretty long post, here goes...
I have a need to connect two adsl lines to a RedHat 9 box, via two ethernet cards (eth0 and eth1).
The thing that is confusing me is getting the routes setup properly - namely the issue of gateways. The two adsl connections are on different subnets and have different gateways.
I need to be able to access both connections, and have the linux box accessable from the web via both connections, but the routing table - as configured by the network scripts at boot time - looks like this:
IP1: 1.1.1.102
gateway: 1.1.1.101
subnet mask: 255.255.255.252
dev: eth0
IP2 - 2.2.2.102
gateway: 2.2.2.101
subnet mask: 255.255.255.252
dev: eth1
eth2 is LAN...
(both IP's made up)
Code:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
1.1.1.102 0.0.0.0 255.255.255.252 U 0 0 0 eth0
2.2.2.102 0.0.0.0 255.255.255.252 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 1.1.1.101 0.0.0.0 UG 0 0 0 eth0
You may have noticed that the adsl connections are both bridged (RFC1483) and thus the subnets allow for only two nodes - the IPs I've got and the default gateways.
So, that's how the network scripts configure things for me at boot time, and I can access the internet and can access the box from the internet via either
1.1.1.102 or
2.2.2.102.
But what the routing table info here is telling me is: route all traffic to/from
2.2.2.102 to anywhere
THROUGH 1.1.1.102 - ie. through the default gateway.
And everything breaks if I disconnect
eth0 (1.1.1.102) - I can't get to the internet or access the box from the internet on
1.1.1.102 OR 2.2.2.102.
This is no good. I think what I need to do is have the ADSL IP addresses added with their unique gateways instead of 0.0.0.0 (ie. the default gateway). Is that right?
Does anyone know how I can multi-home this box and get around the problem of one default gateway?
Thanks in advance for reading such a long post