Route return traffic to correct gateway depending on service
- by Marnix van Valen
On my office network I have two internet connections and one CentOS server running a website (HTTPS on port 443).
The website should be publicly accessible through the public IP of the first internet connection (ISP-1).
The other internet connection, ISP-2, id the default gateway on the network. Both internet connections have routers (the household-kind) with NAT, SPI firewalls etc. The router on ISP-2 is a Netgear WNDR3700 (aka N600) with original firmware.
The problem is that the website is unreachable. Looks like incoming traffic on ISP-1 will reach the server but the returning traffic is routed through ISP-2, effectively making the site unreachable. As far as I can tell I can't do port based routing on the WNDR3700.
What are my options to make this work? I've been looking at implementing an iptables / routing based solution on the server itself but haven't been able to make that work.
Update: Note that the server has one network interface connecting it to both routers.