Port 80 on the public internet → port 8080 on a container. Your home router does this. Docker does this. Now you'll know HOW: DNAT, SNAT, and the nat table.
In this lesson, you'll learn:
✓ Why NAT exists (IPv4 scarcity + port forwarding)
✓ DNAT in PREROUTING (rewriting destination)
✓ SNAT/MASQUERADE in POSTROUTING (rewriting source)
✓ The full packet trace through all 5 chains
📚 Part 7 of 13 in the iptables Mastery course.
Includes a complete port-forwarding recipe (public :80 → internal :8080) you can copy. Plus the ip_forward sysctl no one mentions until things break.
🎓 iptables Mastery is part of the Dargslan IT Mastery series.
🌐 dargslan.com
#Linux #iptables #NAT #PortForwarding #LinuxNetworking