NAT (Network Address Translation)
Cheat sheet · https://pcornel.dk/topic.php?topic=657
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 insideandip nat outsidedefine 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 insideip nat outsideshow ip nat translationsshow ip nat statisticsip 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
| Term | Meaning | Fast question |
|---|---|---|
| Inside local | Inside host address as represented on the inside | What address does the inside host actually use? |
| Inside global | Address representing the inside host toward the outside | What source identity does the outside see? |
| Outside global | Outside host address as globally known | What is the real outside destination identity? |
| Outside local | Outside host address as represented toward the inside | Is the outside identity itself translated? |
| PAT / overload | Many flows share global address space using ports/identifiers | Which 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