Pcornel
Networking · IP Services

NAT (Network Address Translation)

Cheat sheet · https://pcornel.dk/topic.php?topic=657

Back to the Topic

Answer

Network Address Translation (NAT) rewrites IPv4 address identity as traffic crosses a translation boundary. Port Address Translation (PAT), also called NAT overload, additionally uses transport-layer ports or similar identifiers so many flows can share one or a small number of inside-global addresses.

Remember

  • Cisco classic terminology distinguishes inside local, inside global, outside local and outside global identities
  • ip nat inside and ip nat outside define the interface roles used by classic inside-source NAT
  • Static NAT provides a persistent one-to-one mapping
  • Dynamic NAT allocates addresses from a pool to matching inside hosts
  • PAT/overload multiplexes many flows by combining an inside-global address with Layer-4 ports or protocol identifiers
  • A translation entry proves local translation state for that tuple; it does not prove routing, firewall/ACL policy, return path or application success
  • NAT is not a security control by itself.

First checks

  • show ip nat translations — inside local/global and outside addresses (and ports for PAT).
  • show ip nat statistics — inside/outside interfaces, hits, misses and pool use.
  • show running-config | include ip nat — rules, pools and ACL references.
  • show access-lists <nat-acl> — which inside addresses match.
  • debug ip nat — translations as they happen (briefly, with an ACL).

Commands

ip nat inside
ip nat outside
show ip nat translations
show ip nat statistics
ip nat inside source static <local> <global>
ip nat inside source list <acl> pool <name>

Verify in this order

packet enters an ip nat inside interface → matches the NAT rule (ACL/static) → routed out an ip nat outside interface → source rewritten and entry created → reply matches the entry → translated back

Where it usually breaks

local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result

NAT terminology

TermMeaningFast question
Inside localInside host address as represented on the insideWhat address does the inside host actually use?
Inside globalAddress representing the inside host toward the outsideWhat source identity does the outside see?
Outside globalOutside host address as globally knownWhat is the real outside destination identity?
Outside localOutside host address as represented toward the insideIs the outside identity itself translated?
PAT / overloadMany flows share global address space using ports/identifiersWhich translated tuple belongs to this flow?

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=657

Confirmation

Confirm action

Continue?