DNAT-Port forward to internal servers with parallel firewalls
First, the scenario:
I have two internet connections. One is a cheap adsl, and the other is
a an expensive good quality link.
My proxy server runs squid to serve local requests, and also acts as a
firewall for all traffic passing the adsl. This server is setup as the
default gateway for my local machines.
It also deals with forwading packages to WAN networks.
I have another firewall in the other link, which is in a different location.
No DMZ or alike structures are currently used.
I need to redirect (DNAT) a few ports to local servers using the
expensive internet link to local servers. TCP ports, by the way.
As the route to the internet, for my local boxes, is to pass by my
"cheap link" firewall instead of the "expensive link" firewall , the
DNAT won't work, since when those local servers try to reply to the
requests, they try to go through the cheap path. That won't work even
also because "cheap link firewall" only allow restrictive NAT access
to the internet. I believe it couldn't route those packets back -
besides, I don't know if that would work at all, sending a packat to a
different route from the one it came.
"Reply packets do NOT automatically follow the reverse path of the one
taken by the original request. All packets are routed according to the
routing table of the host at each step of the way. This issue commonly
comes up when people install a Shorewall firewall parallel to an
existing gateway and try to use DNAT through Shorewall without
changing the default gateway of the system receiving the forwarded
requests. Requests come in through the Shorewall firewall where the
destination IP address gets rewritten but replies go out unmodified
through the old gateway."
A possible solution I thought was to "proxy" those TCP requests to the
local server, just like mod_proxy, pound and other software can do for
HTTP connections. I believe the magic there is changing the source
address in the package, and somehow let the firewall "intermediate"
Sorry if I was not clear enough. I'm a bit confused here.
Do you have any ideas? I can't think of a good solution, besides
re-thinking the whole infrastructure again - I'm planning for the near
future to put the local servers that runs public services in a DMZ.
That's what I'd have done if I had designed the network myself.