I want to forward an internal IP address to an external one.
So here's what I do:
echo 1 > /proc/sys/net/ipv4/ip_forward
Then I use iptables:
iptables -t nat -A PREROUTING -s 192.168.1.x -j DNAT --to-destination 95.211.y.z
iptables -t nat -A POSTROUTING -j MASQUERADE
After this point, I'd expect to reach the server at 95.211.y.z when I ping 192.168.1.x . In other words, I'd expect all traffic that is directed towards the internal IP to be translated into that external IP but that doesn't happen.
Where am I wrong?