Dev.to
7/24/2026

The original title is "DNAT Explained: Publishing an Internal Service Through One Public Address and Port"
Original: DNAT Explained: Publishing an Internal Service Through One Public Address and Port
Short summary
This hands-on Protocol Lab tutorial walks through destination NAT (DNAT/port forwarding) using containerlab and iptables. It explains how DNAT maps a public address:port to an internal service, why it happens in PREROUTING, and how conntrack handles reply un-NATing. The lab includes full topology, configs, and scripts in a public GitHub repo.
- •DNAT maps public IP:port to internal service, complementing SNAT from Lab 20
- •Explains PREROUTING vs POSTROUTING chain placement and conntrack reply handling
- •Full containerlab lab with scripts, RFC references, and step-by-step commands
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



