-   Linux - Networking (
-   -   One NIC, One IP, Multiple Gateways (

Weirdo0815 08-26-2010 02:29 PM

One NIC, One IP, Multiple Gateways
An example of my setup: - Local IP of Fedora System, hosting SSH and Apache - Local IP of Gateway 1 - Local IP of Gateway 2 - Internet IP of Gateway 1 - Internet IP of Gateway 2

I'm trying to forward ports 22 (ssh) and 80 (http) to the Fedora Server through BOTH gateways, both pointing to the same local IP of the server.

The problem is the server is only accepting incoming connections from which ever gateway is set to be the default gateway.

Any idea on how I could accomplish this while using only one IP for the Fedora server? I know I could set up multiple IPs and multiple gateways for those IPs to resolve this.

jefro 08-26-2010 08:45 PM

You seem to be trying to defy the rules of tcp/ip. You can only have one path to and fro.

I may not fully understand what you are trying to do also.

jlinkels 08-26-2010 09:54 PM

It is not accepting connections on just the IP that is set as default gateway. But it can only send back packages over the default gw. And if the package did not come in over that interface it will still be sent back thru the default gw and that doesn't work.

I remember there is a solution for that in the LARTC (Linux Advanced Routing and Traffic Control). I think it had something to do with that a packet coming in over the other interface got a mark, and when it was to send back, another routing table was used to route it correctly. Look for load balancing or source routing. It is in that section of the LARTC.


All times are GMT -5. The time now is 05:58 PM.