Originally published at https://blog.pathvector.dev/protocol-lab-dnat-40/ — part of the free Protocol Lab series.

This post is part of Protocol Lab, a free, hands-on series for learning networking protocols by building and breaking them in a container lab. All the lab material — topologies, configs, and scripts — lives in the repo: github.com/pathvector-studio/protocol-lab.

In Lab #20, source NAT (masquerade) let many inside hosts reach out through one public address. This lab is the inbound complement: destination NAT — better known as port forwarding — which lets the outside reach a chosen inside service through a public address:port.

Reading guide: rfc-notes/dnat-port-forwarding.md

Prerequisite: Lab 20: NAT — Source Address Translation