Mailing List Archive

I am working with SNAT and DNAT rules.

When I send a packet {[IP1]} out it goes through the SNAT rules and
source field in ip header gets changed.
Now if there is an ICMP response { [IP2][ICMP][IP1] } for this packet,
It goes through DNAT rules. IP2 gets DNATted but the ip header (IP1)
inside the ICMP packet also gets DNATted.

src {SNAT( =} ----------> dst {}
icmp comes from dst.
dst {} -------------------------> src {DNAT( =}
the IP packet inside icmp header should have
src = and dst = but it shows src =
and dst =

means for ICMP responses both ip headers (main ip header and the one
inside icmp packet) are going through DNAT.

Is it the connection tracking or there is special handling done in the kernel?

Pankaj Jain