The four names of an address
| Term | What it is | In this lab |
|---|---|---|
| Inside local | The inside device's private address | 192.168.10.12 |
| Inside global | How that device looks from outside | 203.0.113.1 |
| Outside local | How the outside device looks from inside | 198.51.100.80 |
| Outside global | The outside device's real address | 198.51.100.80 |
Outside local and outside global only differ if the destination is translated too, which is unusual.
Types of NAT
| Type | How it works | Command |
|---|---|---|
| Static | One fixed private address ↔ one fixed public address | ip nat inside source static 192.168.20.10 203.0.113.5 |
| Static port | One public port ↔ one port on a server | ip nat inside source static tcp 192.168.20.10 443 interface Gi0/0/0 443 |
| Dynamic | Private addresses ↔ a pool of public ones, one to one | ip nat pool and ip nat inside source list … pool … |
| PAT (overload) | Many private ↔ one public, told apart by port | ip nat inside source list NAT-LAN interface Gi0/0/0 overload |
How it works: from the private address to the public one and back
Five steps: going out with PAT, the way back, static NAT, an untranslated network and the fix.
PAT: Ana's connection leaves with R1's IP
Ana opens https://198.51.100.80. Inside, her SYN leaves from 192.168.10.12:51544 (inside local). R1 sees the address is in the NAT-LAN list, looks for a free port on its public IP and creates a translation: 203.0.113.1:51544 (inside global). Since port 51544 was free, it keeps it; if another device were already using it, R1 would pick a different one. Outside, the web server only sees 203.0.113.1. R1 recomputes the IP and TCP checksums, because both cover the addresses.
The reply comes back to the public IP
The server's SYN-ACK arrives at 203.0.113.1:51544. R1 looks it up in the translation table, finds 192.168.10.12:51544 and changes the destination address and port before sending it out Gi0/0/1. For Ana it is transparent: she sees the web server's reply as if she were talking to it directly. Without that table entry, a packet arriving from outside has nowhere to go: that is why PAT alone does not let new connections in from the Internet.
Static NAT: the intranet server, visible from outside
For a client on the Internet to get in, a fixed translation is needed. ip nat inside source static tcp 192.168.20.10 443 interface GigabitEthernet0/0/0 443 publishes port 443 of the public IP toward the intranet server. A client (198.51.100.77) sends its SYN to 203.0.113.1:443; R1 changes the destination to 192.168.20.10:443 and creates an extended entry with the client's details. This is static port NAT (port forwarding). A full static NAT (ip nat inside source static 192.168.20.10 203.0.113.5) would translate every port, but it needs one public IP per server.
The server goes out untranslated
The intranet server pings 198.51.100.80. Its packet enters through Gi0/0/2, which is ip nat inside, but the NAT-LAN list only permits 192.168.10.0/24, and the static translation only covers its TCP port 443. With no match, R1 routes it as is: it goes out to the Internet with 192.168.20.10 as the source. The provider drops private addresses (and even if it did not, the reply would never find its way back). It is the most common NAT mistake: the inside network is not in the access list.
The network is added to the list and the ping works
permit 192.168.20.0 0.0.0.255 is added to the NAT-LAN list. The next ping leaves with 203.0.113.1 and comes back. ICMP has no ports: PAT uses the Echo identifier (0x0b01 = 2817) as if it were one, which is why the table shows 203.0.113.1:2817. Dynamic translations expire on their own (by default, 24 h for TCP, 5 min for UDP and 1 min for ICMP); clear ip nat translation * removes them by hand.
Configuring PAT on IOS XE
| Step | Command |
|---|---|
| 1. Inside interface | ip nat inside |
| 2. Outside interface | ip nat outside |
| 3. What is translated | ip access-list standard NAT-LAN and permit 192.168.10.0 0.0.0.255 |
| 4. The rule | ip nat inside source list NAT-LAN interface GigabitEthernet0/0/0 overload |
To verify: show ip nat translations, show ip nat statistics and debug ip nat. To start over: clear ip nat translation *.
Common failures
| Symptom | Likely cause |
|---|---|
| A network goes out untranslated | It is not in the NAT access list |
| Nothing is translated | ip nat inside or ip nat outside is missing on an interface |
| It is translated but does not come back | The default route is missing, or the provider filters |
| Nobody can get in from outside | The static translation is missing (PAT only creates entries from inside) |
Frequently asked questions
Is NAT a security measure?
It is not a firewall, although PAT has a similar effect: without a table entry, a new connection from outside has nowhere to go. Real filtering is done with ACLs or a firewall.
How many devices fit behind one IP with PAT?
In theory, about 64,000 ports per IP and per protocol; in practice, thousands of devices. If more are needed, a pool with several public IPs and overload is used.
Why does the TCP checksum change?
Because the TCP checksum includes a pseudo-header with the IP addresses. When the address (and the port) changes, R1 recomputes the IP checksum and the TCP or UDP one.
What happens if the public IP changes?
With overload on the interface (interface GigabitEthernet0/0/0), NAT always uses the interface's current IP: if the provider changes it through DHCP, the configuration does not need to be touched.
And in IPv6?
IPv6 does not need NAT to save addresses: every device has a global address. NPTv6 (prefix translation) exists, but it is not in the CCNA.
What you take away
- NAT translates private addresses (RFC 1918) to public ones on the router: ip nat inside and ip nat outside.
- PAT (overload) shares one public IP among many devices and tells them apart by port.
- Inside local is the private address; inside global, how that device looks from outside.
- Getting in from the Internet requires static NAT: PAT only creates translations from inside.
- If a network is not in the NAT access list, it goes out untranslated and is lost.
- To verify: show ip nat translations and show ip nat statistics.
NEXT STEP
From this lesson to the CCNA 2.0 Course
NAT, ACLs and the other network services (domain 4.0) are part of The House of Routing's CCNA 2.0 Course, with the Canadá Logística lab. We will let you know when it opens.
Upcoming protocol lessons
Sources
- Cisco · IOS XE 17 configuration guides (IP Addressing Services: Configuring NAT for IP Address Conservation)
- IETF · RFC 3022 · Traditional IP Network Address Translator (Traditional NAT)
- IETF · RFC 1918 · Address Allocation for Private Internets
- Cisco · 200-301 CCNA v2.0 Exam Topics (4.3)
Lesson prepared with AI assistance and checked against the sources cited. The bytes of every packet are generated according to the standard and verified with an independent tool.