I am doing NAT traffic forwarding using iptables (126.96.36.199 => 188.8.131.52) with the following commands:
iptables -t nat -A PREROUTING -d 184.108.40.206 -j DNAT --to-destination 220.127.116.11 iptables -t nat -A POSTROUTING -d 18.104.22.168 -j SNAT --to 22.214.171.124
It works fine except for one thing: If I check apache logs, doing firewall rules etc. on server 126.96.36.199, it looks like all traffic is comming from 188.8.131.52.
Of course it makes a bit sense, since it is 184.108.40.206 that is forwarding the traffic to 220.127.116.11, but I assumed NAT would pass the original IP "requestor" in the package?
Is there a way to make the traffic to 18.104.22.168 have the "real" orignal IP?
Currently, it makes it very difficult to setup good firewall rules and other security stuff as ALL traffic seems to be comming from 22.214.171.124 regardless what the original traffic is actually comming from.