Course contents

NAT

How a whole office of private addresses reaches the internet through one router. Learn static NAT, dynamic NAT and PAT, and how to check the translation table on a Cisco router.

Intermediate · 7 lessons

Technical definition

NAT (Network Address Translation) is a router function that rewrites the IP addresses in packet headers as packets pass between two networks, most often swapping private inside addresses for public ones. The router records each mapping in a translation table so that return traffic can be translated back.

Your home router has one public IP address, yet every phone, laptop and TV in the house can use the internet at the same time. The trick is NAT (Network Address Translation): the router rewrites private addresses into its public address on the way out, and back again on the way in. This course explains how that works and how to set it up on a Cisco router.

Every lesson uses the same small office below. The PCs and the web server Web1 use private addresses in 192.168.10.0/24. R1 is the edge router: Gi0/0 faces the office (inside), and Gi0/1 faces the ISP (outside) with the public address 203.0.113.2/30. The server on the internet is 198.51.100.10.

Diagram
The NAT course topology
The NAT course topology
Gi0/0 · insideGi0/1 · outsidePC1IP 192.168.10.11PC2IP 192.168.10.12Web1IP 192.168.10.50SW1NATR1 (NAT)edge routerISPIP 203.0.113.1InternetServerIP 198.51.100.10

Device key: PC1 (computer) · PC2 (laptop) · Web1 (server) · SW1 (switch) · R1 (NAT), ISP (router)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • PC1: IP 192.168.10.11
  • PC2: IP 192.168.10.12
  • Web1: IP 192.168.10.50
  • R1 (NAT): edge router
  • ISP: IP 203.0.113.1
  • Server: IP 198.51.100.10
  1. 1. PC1 sends a request. Its source address is private. The internet can't route it.
  2. 2. R1 translates it. The packet leaves with R1's public address, and R1 writes the swap in its translation table.
  3. 3. The reply comes back. R1 finds the entry, puts PC1's private address back, and forwards the reply inside.

Who is this for?

CCNA students and anyone who wants to know what their router does with addresses. You should know what an IP address and a subnet are (see IP Addressing), and roughly how a router forwards packets.

What's in this course

3 modules · 7 lessons · about 1 hour of reading

Start the first lesson →

FAQ

Why can't someone outside my network connect directly to my laptop?
With PAT, the router only creates a translation entry when your device sends traffic out first. A device on the internet can't start a new connection inward, because the router has no entry telling it where to send it. The exception is port forwarding (static NAT or static PAT), which you set up on purpose for a server.
Is NAT the same thing as a firewall?
No. NAT changes addresses; a firewall decides what is allowed. Because PAT drops unexpected inbound traffic, it can feel like a firewall, but it was never designed for security. Use a real firewall or access lists to protect a network.
Does IPv6 use NAT?
Normally not, and that is on purpose. IPv6 has so many addresses that every device can have its own public address. That removes the shortage NAT was built to work around in IPv4.