Why NAT?

Private addresses

There aren't enough IPv4 addresses for every device, so companies and homes use private addresses (RFC 1918) inside, and share a few public ones:

RangePrefixSize
10.0.0.0 to 10.255.255.25510.0.0.0/816 million addresses
172.16.0.0 to 172.31.255.255172.16.0.0/121 million
192.168.0.0 to 192.168.255.255192.168.0.0/1665,536

Internet routers don't route private addresses. Here the ISP has no route back to 192.168.1.0/24, so PC1's ping reaches the web server, but the reply has nowhere to go:

In NetLab

▶ PC1
NetLab Windows-style command prompt. Type help to see the commands.
C:\Users\student>ping 198.51.100.10

Pinging 198.51.100.10 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 198.51.100.10:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
▶ ISP
ISP>enable
ISP#show ip route | begin Gateway
Gateway of last resort is not set

      198.51.100.0/24 is variably subnetted, 2 subnets, 2 masks
C        198.51.100.0/24 is directly connected, GigabitEthernet0/1
L        198.51.100.1/32 is directly connected, GigabitEthernet0/1
      203.0.113.0/24 is variably subnetted, 2 subnets, 2 masks
C        203.0.113.0/29 is directly connected, GigabitEthernet0/0
L        203.0.113.1/32 is directly connected, GigabitEthernet0/0

What NAT does

Network Address Translation on the edge router swaps the private source address of outgoing packets for a public one, and swaps it back in the replies. The internet only ever sees the public address.

Four names for addresses

NameMeansHere
Inside localAn inside host's real (private) address192.168.1.10 (PC1)
Inside globalThe public address that stands for it outside203.0.113.2 (R1's outside address)
Outside localThe outside host's address as seen from inside198.51.100.10
Outside globalThe outside host's real address198.51.100.10 (the same, unless you translate outside hosts too)

Remember: Inside/outside = which side the host is on. Local/global = which side of the router you look from. The CCNA only translates inside addresses, so outside local and outside global are always the same.

HOME LABS COMMUNITY DASHBOARD