NAT – Network Address Translation Overview
1. What Is NAT and Why Is It Needed?
Network Address Translation (NAT) is a process performed by a router (or firewall) that modifies the IP address information in packet headers as traffic passes through it. NAT was introduced primarily to conserve IPv4 address space — but it also provides a degree of security by hiding internal network addressing from external networks.
The IPv4 address space (approximately 4.3 billion addresses) was exhausted at the regional registry level years ago. NAT allows an entire organisation to share one or a small pool of public IP addresses while using private IP addresses internally. Without NAT, every device that needs to reach the internet would require its own unique public IPv4 address — an impossibility at today's scale.
| Problem NAT Solves | How NAT Addresses It |
|---|---|
| IPv4 address exhaustion | Many private addresses map to one (or few) public addresses, multiplying effective address capacity enormously |
| Internal address exposure | Private RFC 1918 addresses are never routed on the internet; external hosts only see the public NAT address |
| Renumbering when changing ISPs | Only the public NAT address needs to change; internal private addressing remains untouched |
| Overlapping address spaces | NAT can translate between networks that use the same private address range (common in mergers and VPNs) |
Related pages: Static NAT Lab | Dynamic NAT Lab | PAT (Port Address Translation) Lab | IPv6 & Private IP Overview | Static NAT Configuration Lab | Dynamic NAT & PAT Lab
2. NAT Terminology — Inside/Outside Local/Global
NAT uses four address terms that often cause confusion in CCNA study. It is essential to understand what each term means before studying the NAT types. The key is that "local" means the address as seen from inside the network, and "global" means the address as seen from the internet (outside). "Inside" refers to the private/internal side; "outside" refers to the internet/external side.
| Term | Definition | Typical Address | Where It Appears |
|---|---|---|---|
| Inside Local | The IP address assigned to an inside host — the private address configured on the host's NIC | RFC 1918 private (e.g., 192.168.1.10) | Source address of packets before NAT translation (on the inside network) |
| Inside Global | The public IP address that represents an inside host to the outside world — what the internet sees as the source | Public IP (e.g., 203.0.113.5) | Source address of packets after NAT translation (on the outside network) |
| Outside Local | The IP address of an external host as seen from inside the network. In most standard NAT deployments this equals the Outside Global (no translation on the outside address) | Usually the same as Outside Global | Destination address of packets before NAT (on the inside) |
| Outside Global | The actual IP address assigned to the external host (the real internet address of the destination server) | Public IP (e.g., 8.8.8.8) | Destination address of packets on the outside network |
Address flow — inside host (192.168.1.10) reaching Google DNS (8.8.8.8):
Inside network Router (NAT) Outside (Internet)
───────────── ──────────── ──────────────────
Src: 192.168.1.10 ──────────► Src: 192.168.1.10 Src: 203.0.113.5
Dst: 8.8.8.8 Dst: 8.8.8.8 ───────► Dst: 8.8.8.8
(NAT translates source)
Address labels:
192.168.1.10 = Inside Local (private address of inside host)
203.0.113.5 = Inside Global (public address NAT substitutes)
8.8.8.8 = Outside Global (real address of external server)
8.8.8.8 = Outside Local (same — no translation on outside address)
Memory tip:
"Inside" = describes the host that lives inside your network
"Local" = address as seen locally (inside the organisation)
"Global" = address as seen globally (on the internet)
3. NAT Inside and Outside Interfaces
NAT must know which router interfaces face the inside (private) network and which face the outside (internet/public) network. This is configured with two interface-level commands:
Router(config)# interface GigabitEthernet0/0 Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# ip nat inside ← faces the private LAN Router(config)# interface GigabitEthernet0/1 Router(config-if)# ip address 203.0.113.1 255.255.255.252 Router(config-if)# ip nat outside ← faces the ISP / internet
ip nat inside or
ip nat outside, NAT will not function even if the NAT rule
is correctly defined. Both interface designations are mandatory.
Typical NAT topology:
[PC 192.168.1.10] ──┐
[PC 192.168.1.11] ──┼── [Gi0/0 — ip nat inside]
[PC 192.168.1.12] ──┘ │
[Router]
│
[Gi0/1 — ip nat outside]
│
[ISP — Internet]
Public IP: 203.0.113.1
4. Static NAT
Static NAT creates a permanent, one-to-one mapping between a specific Inside Local (private) address and a specific Inside Global (public) address. The mapping is manually configured and never changes. Traffic can be initiated from either side — making Static NAT suitable for servers that must be reachable from the internet.
How Static NAT Works
Static NAT mapping: 192.168.1.10 ←→ 203.0.113.10 (permanent) Outbound (inside → outside): PC sends: Src 192.168.1.10 → Dst 8.8.8.8 Router NAT: Src 203.0.113.10 → Dst 8.8.8.8 (Inside Local → Inside Global) Inbound (outside → inside): Internet sends: Src 8.8.8.8 → Dst 203.0.113.10 Router NAT: Src 8.8.8.8 → Dst 192.168.1.10 (Inside Global → Inside Local) The mapping is always active — no session needs to be initiated first.
Static NAT Configuration
! Define the static one-to-one mapping: Router(config)# ip nat inside source static 192.168.1.10 203.0.113.10 ! Apply NAT direction to interfaces: Router(config-if)# ip nat inside (on LAN-facing interface) Router(config-if)# ip nat outside (on WAN-facing interface) ! Verify: Router# show ip nat translations Pro Inside global Inside local Outside local Outside global --- 203.0.113.10 192.168.1.10 --- --- Router# show ip nat statistics
When to Use Static NAT
- Web servers, mail servers, or any server that must accept inbound connections from the internet
- When a device needs a predictable, fixed public IP
- VPN endpoints that require a known peer address
- Requires one public IP address per mapped internal host
See full detail: Static NAT Configuration Lab | Static NAT Configuration Lab
5. Dynamic NAT
Dynamic NAT maps inside private addresses to a pool of public IP addresses on a first-come, first-served basis. Mappings are created automatically when an inside host initiates traffic outbound, and released back to the pool when the session ends (or the NAT translation timeout expires).
Unlike Static NAT, Dynamic NAT mappings are temporary and traffic can only be initiated from the inside — an external host cannot initiate a session to a dynamically-NATted inside host because there is no guaranteed stable mapping.
How Dynamic NAT Works
NAT pool: 203.0.113.10 – 203.0.113.14 (5 public addresses)
ACL permits: 192.168.1.0/24
PC-1 (192.168.1.10) initiates traffic → assigned 203.0.113.10
PC-2 (192.168.1.11) initiates traffic → assigned 203.0.113.11
PC-3 (192.168.1.12) initiates traffic → assigned 203.0.113.12
If a 6th host tries to connect while all 5 pool addresses are in use:
→ Translation FAILS — the 6th host cannot reach the internet until
a pool address is released. This is a key limitation of Dynamic NAT.
Dynamic NAT Configuration
! Step 1 — Define the pool of public addresses:
Router(config)# ip nat pool PUBLIC_POOL 203.0.113.10 203.0.113.14
netmask 255.255.255.248
! Step 2 — Define which inside hosts are eligible (ACL):
Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
! Step 3 — Link the ACL to the NAT pool:
Router(config)# ip nat inside source list 1 pool PUBLIC_POOL
! Step 4 — Apply NAT direction to interfaces:
Router(config-if)# ip nat inside (LAN interface)
Router(config-if)# ip nat outside (WAN interface)
! Verify:
Router# show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 203.0.113.10 192.168.1.10 --- ---
--- 203.0.113.11 192.168.1.11 --- ---
! Clear dynamic translations manually:
Router# clear ip nat translation *
When to Use Dynamic NAT
- You have a pool of public IPs and want to share them among a larger group of inside hosts
- Inside hosts only need outbound internet access (no inbound connections required)
- The number of simultaneous active sessions is predictable and fits within the pool size
See full detail: Dynamic NAT & PAT Lab | Dynamic NAT & PAT Lab
6. PAT — Port Address Translation (NAT Overload)
PAT (Port Address Translation), also called NAT Overload, is the most widely deployed form of NAT. It maps many inside private addresses to a single public IP address by tracking connections using source port numbers in addition to IP addresses. This is how home routers and most enterprise edge routers work — hundreds or thousands of devices share a single public IP.
How PAT Works — Port Multiplexing
Single public IP: 203.0.113.1 Inside hosts initiate outbound connections simultaneously: PC-1 (192.168.1.10:1025) → Google (8.8.8.8:443) PC-2 (192.168.1.11:1026) → YouTube (142.250.80.46:443) PC-3 (192.168.1.12:1027) → Google (8.8.8.8:443) PAT translation table: ┌──────────────────────┬──────────────────────┬──────────────────────┐ │ Inside Local │ Inside Global │ Outside Global │ ├──────────────────────┼──────────────────────┼──────────────────────┤ │ 192.168.1.10:1025 │ 203.0.113.1:1025 │ 8.8.8.8:443 │ │ 192.168.1.11:1026 │ 203.0.113.1:1026 │ 142.250.80.46:443 │ │ 192.168.1.12:1027 │ 203.0.113.1:1027 │ 8.8.8.8:443 │ └──────────────────────┴──────────────────────┴──────────────────────┘ All three hosts appear as 203.0.113.1 to the internet. The router distinguishes return traffic by unique source port numbers. PC-1 and PC-3 both reach 8.8.8.8:443 but with different source ports — the router uses those ports to demultiplex return traffic correctly.
PAT Configuration — Using the Outside Interface Address
! Most common PAT configuration — overload the outside interface IP: ! Step 1 — ACL to define inside hosts: Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255 ! Step 2 — Link ACL to NAT with 'overload' keyword (enables PAT): Router(config)# ip nat inside source list 1 interface GigabitEthernet0/1 overload ! Step 3 — Interface designations: Router(config-if)# ip nat inside (LAN interface Gi0/0) Router(config-if)# ip nat outside (WAN interface Gi0/1) ! The 'overload' keyword is what distinguishes PAT from Dynamic NAT. ! Without 'overload': one host uses one pool address. ! With 'overload': many hosts share one address via port tracking.
PAT Configuration — Using a Pool
! PAT with a pool of public addresses (still uses port multiplexing):
Router(config)# ip nat pool PAT_POOL 203.0.113.10 203.0.113.14
netmask 255.255.255.248
Router(config)# ip nat inside source list 1 pool PAT_POOL overload
When to Use PAT
- Home networks — single ISP-assigned public IP shared by all household devices (the default for every home router)
- Small and medium businesses — entire office on one or a few public IPs
- Any scenario where you need maximum address conservation
- Inside hosts need outbound internet access only (PAT does not support inbound-initiated connections without additional port forwarding configuration)
overload at the end of the
ip nat inside source command. Without overload,
you get Dynamic NAT (one-to-one from a pool). With overload,
you get PAT (many-to-one with port tracking). This distinction is
frequently tested.
See full detail: PAT Lab | Dynamic NAT & PAT Lab
7. Comparing the Three NAT Types
| Feature | Static NAT | Dynamic NAT | PAT (Overload) |
|---|---|---|---|
| Mapping type | One-to-one (permanent) | One-to-one (temporary, from pool) | Many-to-one (using port numbers) |
| Public IPs required | One per inside host | One per simultaneously active host | One (or few) for all hosts |
| Mapping persistence | Always active — never expires | Timeout-based — released when idle | Timeout-based — released when session ends |
| Inbound connections | Supported — mapping is always known | Not supported — no guaranteed mapping | Not directly — requires port forwarding |
| Address conservation | None — 1:1 ratio | Moderate — pool must cover peak usage | Maximum — entire network behind one IP |
| Typical use case | Servers (web, mail, DNS) needing fixed public IP | Networks with a pool of public IPs to share | Home networks, SMB, enterprise outbound access |
| Cisco IOS keyword | ip nat inside source static |
ip nat inside source list … pool |
ip nat inside source list … overload |
| Port translation used? | No | No | Yes — source port number is translated |
8. NAT Translation Table — How the Router Tracks Sessions
The router maintains a NAT translation table in memory that records all active address mappings. For PAT, the table also tracks port numbers. This table is the mechanism that allows the router to correctly reverse-translate return traffic from the internet back to the right inside host.
Router# show ip nat translations For Static NAT (no sessions active): Pro Inside global Inside local Outside local Outside global --- 203.0.113.10 192.168.1.10 --- --- For Dynamic NAT and PAT (with active sessions): Pro Inside global Inside local Outside local Outside global tcp 203.0.113.1:1025 192.168.1.10:1025 8.8.8.8:443 8.8.8.8:443 tcp 203.0.113.1:1026 192.168.1.11:1026 142.250.80.46:443 142.250.80.46:443 udp 203.0.113.1:52341 192.168.1.12:52341 8.8.8.8:53 8.8.8.8:53 Columns explained: Inside global = public IP (and port for PAT) that the internet sees Inside local = private IP (and port) of the actual inside host Outside local = destination address as seen from inside Outside global = actual address of the external server
Useful NAT Verification and Troubleshooting Commands
! Show all current NAT translations: Router# show ip nat translations ! Show verbose translation details (includes timers): Router# show ip nat translations verbose ! Show NAT statistics (hits, misses, expired translations): Router# show ip nat statistics ! Clear all dynamic NAT translations (does not affect static): Router# clear ip nat translation * ! Clear a specific translation: Router# clear ip nat translation inside 192.168.1.10 203.0.113.10 ! Debug NAT in real time (use with caution in production): Router# debug ip nat Router# debug ip nat detailed
UDP translations: 300 seconds (5 minutes)
TCP translations: 86400 seconds (24 hours)
TCP SYN-only (half-open): 60 seconds
ICMP translations: 60 seconds
These can be adjusted with
ip nat translation timeout commands.
9. NAT Advantages, Disadvantages, and Limitations
Advantages
| Advantage | Details |
|---|---|
| IPv4 address conservation | PAT allows thousands of hosts to share a single public IP address |
| Security through obscurity | Inside hosts are not directly addressable from the internet; external scans cannot reach private addresses directly |
| Flexibility when renumbering | Internal addressing can remain unchanged when switching ISPs or public IP allocations |
Disadvantages and Limitations
| Limitation | Details |
|---|---|
| End-to-end connectivity broken | NAT violates the end-to-end principle of the internet. External hosts cannot initiate connections to inside hosts without additional configuration (port forwarding, DMZ) |
| Complexity for some protocols | Protocols that embed IP addresses in the payload (FTP active mode, SIP/VoIP, IPsec, H.323) require NAT Application Layer Gateways (ALG) to function correctly |
| Router CPU overhead | Every packet must be inspected and potentially rewritten, increasing processing load on the NAT device |
| Troubleshooting difficulty | Address translation makes packet captures harder to trace end-to-end; logs show the public IP rather than the private IP of the originating host |
| PAT port exhaustion | TCP/UDP port numbers are 16-bit (65,535 ports). Under extreme load a single PAT address can exhaust available ports — though this is rare in practice |
10. Choosing the Right NAT Type
Decision guide — which NAT type should I use?
Does the inside device need to accept INBOUND connections from the internet?
(e.g., web server, mail server, game server)
│
├─ YES ──► Use STATIC NAT
│ One permanent public IP per server.
│ Mapping is always active; internet hosts can initiate sessions.
│
└─ NO ──► Inside hosts only need OUTBOUND internet access.
│
├─ Do you have a POOL of public IPs to share?
│ │
│ ├─ YES, pool is large enough for peak simultaneous users
│ │ ──► Use DYNAMIC NAT (pool without overload)
│ │
│ └─ NO, or pool is small / you have just one public IP
│ ──► Use PAT (overload)
│ Maximum address conservation.
│ Entire network behind one or a few IPs.
│ Default for home routers and most enterprise NAT.
│
└─ In practice: PAT is almost always the right answer for
outbound-only access. Dynamic NAT without overload is rarely
used today because PAT is more efficient.
See also: Static NAT Lab | Dynamic NAT Lab | PAT (Port Address Translation) Lab | ACL Overview | Static NAT Lab | Dynamic NAT & PAT Lab | Troubleshooting NAT & PAT Lab