Skip to contentSkip to conversation

reverse NATing

DISCUSSION Vinay Reddy 2 participants 2 messages Mar 18, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,
I would like to know where exactly reverse mapping(packets coming from outside to the internal network) is done in the case of SNAT? From the netfilter documentation, it seems to be done in the POST_ROUTING hook. Is it true?
Logically I would expect the packet to be reverse mapped in the pre-routing state itself. Why would one want to reverse map it in post routing? I am sure I am missing something. Could anyone please enlighten me?

Any help would be appreciated.

Regards,
Vinay

#1 lore raw

I think you are talking about what seems to be the connection tracking, once a packet match a rule in the nat table it will use that rule until the connection is closed and in both sides.

Quoted 16 lines · Vinay Reddy

Hi,
I would like to know where exactly reverse mapping(packets coming from outside to the internal network) is done in the case of SNAT? From the netfilter documentation, it seems to be done in the POST_ROUTING hook. Is it true?
Logically I would expect the packet to be reverse mapped in the pre-routing state itself. Why would one want to reverse map it in post routing? I am sure I am missing something. Could anyone please enlighten me?

Any help would be appreciated.

Regards,
Vinay