What is the difference between SNAT, DNAT and PAT?
AdvancedConceptNAT, Firewalls & VPN
Answer
SNAT rewrites the source address (outbound internet access). DNAT rewrites the destination address (port forwarding, publishing an internal service). PAT, or NAT overload, maps many private IP:port pairs to one public IP using different source ports.
iptables -t nat -A POSTROUTING -s 10.0.0.0/16 -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 8443 -j DNAT --to-destination 10.0.1.10:443
More on NAT, Firewalls & VPN
What is NAT and why is it used?BeginnerHow does an AWS NAT gateway work, and what are its limits?AdvancedWhy is NAT gateway cost a common surprise and how do you reduce it?IntermediateWhat is conntrack and what happens when its table fills up?AdvancedWhat is the difference between a stateful and a stateless firewall?BeginnerWhat is a security group and how does it differ from a network ACL?Beginner