0
I need to achieve the following scenario using IPTables:
In this scenario we have a front end server with only one NIC with IP 1.2.3.4
, and there are three other servers with IPs set to 172.20.20.20
, 192.168.20.10
and 10.10.10.8
.
The goal is to configure IP tables so that clients only connect to the front end server (1.2.3.4
) and the request get forwarded based on the port, for example when the green client requests 1.2.3.4:8080
, the request is sent to 10.10.10.8:8080
, or if he sends a request to 1.2.3.4:443
, his request is forwarded to 172.20.20.20:443
while preserving the original client's IP.
I need this IP as a part of user identification - based on the client's IPm different contents will be served.
I have already read these questions but it didn't help:
set he linux box as default gateway on all three servers. – Ipor Sircer – 2016-10-26T13:09:02.380