Routing from a box behind two NAT''ing routers

Henrik Størner
2002-05-14T20:55:22Z

Greetings,

I hope someone else has come up with a way to do this - so far
I''ve tried out some of the tricks described in the Advanced
Routing Howto, but haven''t gotten it to behave as I would like.

I have a Linux-based (2.4.18 kernel) web server located on a
private network. This network is connected to the Internet via
two ADSL connections using Cisco SOHO77 routers. These routers
do NAT of both outgoing and incoming connections.

The problem is that I would like to have the web server available to
clients on the Internet using both of the connections. Not only
would it make the connection more reliable, it would also allow
me to utilize the bandwidth of both the connections via a simple
round-robin DNS setup of the Web server address. However, so far
I haven''t been able to come up with a routing setup that allows
me to do this.

The routers have been configured to NAT an incoming request on TCP
port 80 to the internal IP of the web server. This works fine for
connections that come in on one of the routers, if I setup the web
server with a default route to that particular router. But then
connections arriving on the other router do not work - the router
forwards the initial SYN packet OK to the web server, but since
it tries to route the response out through it''s default route,
it goes nowhere - the router that is asked to forward the response
packet never saw the initial SYN-packet, so the response does not
match anything in it''s NAT table, and it drops the packet.

I tried giving the web server a second internal IP, and having one
router NAT incoming connections to the first IP, and the other
router NAT the connections to the second IP. Then using one of the
examples in the HOWTO, I tried setting up the routing so that the
response would go out via the proper router. I could not get that
to work.

Any ideas or suggestions would be appreciated.
--
Henrik Storner <henrik@hswn.dk>