Reply To: Different public source IPs from NAT’ed internal servers?

Home Page Forums Network Management Networking Different public source IPs from NAT’ed internal servers? Reply To: Different public source IPs from NAT’ed internal servers?

#47369

imported_fulvio
Participant

The problem is the sequence that is not correct. If you use the iptables command with -A switch, the rule is appended to the POSTROUTING chain. You should use the -I switch instead with which you can specify the position where to insert the rule. In other words try to replace

iptables -t nat -A POSTROUTING –source 192.168.0.2 -j SNAT –to-source x.x.x.2

with

iptables -t nat -I POSTROUTING 2 –source 192.168.0.2 -j SNAT –to-source x.x.x.2

Regards
Fulvio