Why does SNAT happen in POSTROUTING chain and DNAT in PREROUTING chain?
12
votes
5
answers
18566
views
Why does
SNAT
(modifies source IP and/or ports) happen in nat
table POSTROUTING
chain, i.e after routing? And why does DNAT
(modifies destination IP ant/or ports) happen in PREROUTING
chain? I guess latter is because there might be multiple NICs in PC with different private networks and PC does not know how to route packet if destination IP address is still publickly routable address? However, for SNAT
I can not see a reason why this couldn't take place in PREROUTING
.
Asked by Martin
(8156 rep)
Apr 29, 2016, 10:34 PM
Last activity: Jun 3, 2025, 06:40 AM
Last activity: Jun 3, 2025, 06:40 AM