Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I do SNAT under postrouting chain in nat table should I perform prerouting in nat table for the packet returned as reply or it is automatically taken care off by the connection tracking mechanism??

share|improve this question

Automatically taken care of. Kernel maintains a table of NAT-ed sessions and automagically sends the return packets to the correct private IP.

You can see this table: cat /proc/net/ip_conntrack

share|improve this answer
It has so much of information even though if I dont set any rules in nat table for POSTROUTING – codingfreak Oct 27 '09 at 6:11
Yes, well SNAT/DNAT are just leveraging connection tracking capabilities to do address translation. – Lorinescu Oct 27 '09 at 7:36
Can I know when does the iptables mechanism changes the source ip-address of the reply packet to its original ip-address in the packet flow .. – codingfreak Oct 30 '09 at 4:52
For SNAT in POSTROUTING - after the routing decision is done and packet is sent to some eth. Look at this diagram – Lorinescu Oct 30 '09 at 16:50

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.