Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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 csie.ntu.edu.tw/~b93070/CNL/v4.0/CNLv4.0.files/image2070.gif –  Lorinescu Oct 30 '09 at 16:50

Your Answer

 
discard

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.