I have added an extra ethernet card to one of our Linux servers so that it
can route packets between our two public Internet networks. It has been
performing the job just fine for a few weeks but I have just noticed that
one of the interfaces does not respond from outside our networks.
To illustrate I'll use some fictitious IPs:
eth0: 10.0.0.2 (network is 10.0.0.0/24)
eth1: 220.127.116.11 (network is 18.104.22.168/26)
Here is the routing table:
10.0.0.2 * 255.255.255.0 U 0 0 0 eth0
22.214.171.124 * 255.255.255.192 U 0 0 0 eth1
default 126.96.36.199 0.0.0.0 UG 0 0 0 eth1
All hosts within either of our networks can talk with all hosts on their
own network (through this gateway), all hosts on our other network (through
this gateway), they can also reach the Internet through their default route
(either 10.0.0.1 or 188.8.131.52). The gateway itself can also reach both
networks and the Internet correctly regardless of it's default route.
The problem is that one of the interfaces is always unreachable from "the
Internet" depending on how I set the default route. In the case above the
interface 10.0.0.2 is unreachable. If I change the default route to
10.0.0.1 then the interace 10.0.0.2 becomes reachable but the 184.108.40.206
interface becomes unreachable.
I'm pretty sure the kernel is dropping the packets when it tries sending
them to the Internet because the source address does not match the network
How can I tell the server to send packets for a 10.0.0.2 connection through
10.0.0.1 (on the eth0 LAN) and send packets for 220.127.116.11 connections
through 18.104.22.168 (on the eth1 LAN)? I need this because I want to run
various services on both the networks from this machine.
I have tried several methods of adding multiple gateways but haven't come
up with anything that corrects the problem yet.
Thanks for any ideas!