Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So I have a private network and there is a host with ip =
and there is a firewall for this host which has ip = And of course i has external network , host ip =

So i would like my external host to ping the private host and private host reply. After that, the external host will examine the ping packet and should find the private host has a IP address =

And i used the command on the firewall: -iptables -F -iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to

but when i examine the echo from the external machine, the packet from the private network still has source address = ..which means my command doesn't work.

Please help :(...

share|improve this question is NOT an external IP. It's part of the IP range reserved for private use. See and – aseq Apr 17 '12 at 19:46
@aseq I don't think qwr is implying that it's public IP space, merely that is external relative to the other subnet in question: 10.20.111.n – Wesley Apr 17 '12 at 20:02
Possibly, it's hard to determine considering the way it was phrased. – aseq Apr 17 '12 at 20:39
Sorry, is the external network. is the private network. – qwr qwr Apr 17 '12 at 20:44

1 Answer 1

Try something like:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE --to
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.