LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   One NIC, One IP, Multiple Gateways (https://www.linuxquestions.org/questions/linux-networking-3/one-nic-one-ip-multiple-gateways-828666/)

Weirdo0815 08-26-2010 01:29 PM

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

192.168.1.1 - Local IP of Gateway 1
192.168.1.2 - Local IP of Gateway 2

3.3.3.3 - Internet IP of Gateway 1
4.4.4.4 - 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 07: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 08: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.

jlinkels


All times are GMT -5. The time now is 08:08 AM.