Switching & routing

NAT and PAT to one public address

A gateway translates many private hosts to a single public address, using unique source ports to keep the sessions apart.

Inside — 192.168.10.0/24Outside — public internetInsideInsideInsideInsideInsideInsideOutsideOutsideSessionSessionSessionPrivate host 1192.168.10.11Private host 1 — 192.168.10.11Private host 2192.168.10.12Private host 2 — 192.168.10.12Private host 3192.168.10.13Private host 3 — 192.168.10.13NAT/PAT gateway203.0.113.5NAT/PAT gateway — 203.0.113.5Public web server203.0.113.80Public web server — 203.0.113.80
Legend

Current step

Outbound translation

Three private hosts open sessions at once; the gateway rewrites each source address to the one public address.

Inside local
192.168.10.11:51001
Inside global
203.0.113.5:40001
PAT, also called NAT overload, multiplexes thousands of sessions onto one public address by rewriting the source port as well. The translation table is what lets replies find their way back to the right private host.

Documentation example: addresses use the RFC 5737 ranges and ASNs use the reserved private range. Nothing here connects to a real network.

Tags

  • nat
  • pat
  • translation
  • gateway
  • address-overload

Lessons using this diagram