What happens if I try to do a DNAT in the POSTROUTING chain of the NAT table in iptables?
Suppose I change the destination IP of the packet in the POSTROUTING chain to an address that should get routed via a different interface. What would happen to the packet?
-
Would the host be able to route the packet to the correct interface even after all the routing decisions have been made.
-
Or would the packet still be sent via the interface which was decided in the routing decisions before.
Best Answer
Both options are incorrect. The right answer is :
Because DNAT can only be used in PREROUTING or OUTPUT chains.