DNAT and SNAT
Rewriting packet addresses: DNAT changes the destination, as in port forwarding, while SNAT and masquerade change the source so private hosts can share one public address.
In more detail
Port address translation lets many hosts share one address by giving each connection its own port. A Linux router also needs net.ipv4.ip_forward set to 1.
Related terms
- NAT — Network address translation: rewriting a packet’s source address so private machines can reach outside networks through a shared public address.
- nftables — The current Linux packet filtering framework, which replaces iptables with tables, chains and rules managed by the nft command.
Taught in
- One Rule, Four Firewalls: firewalld, ufw, nftables And iptables — CompTIA Linux+ (XK0-006) Exam Prep
- Port Forwarding, Redirection And NAT With nftables — Linux Foundation Certified System Administrator (LFCS) Exam Prep