Watch on Instagram

Network Bytes · Episode 50 · CCNA 4.1

NAT and PAT

Your home devices use private addresses that can't go out on the internet. NAT swaps them for the router's one public address, and PAT adds a port number per conversation so replies find the right device.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

Private addresses stay at home

The addresses your phone, laptop and TV get at home, like 192.168.1.10, come from the private ranges set aside in RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Millions of homes reuse the same ones, so internet routers don't carry them. Your router gets just one public address from your provider, for example 203.0.113.7 (an address block reserved for documentation, used here as an example).

NAT: the router is a mailroom

Think of a company mailroom. Staff drop letters off with their desk number on them, and the mailroom sends them out with the company's street address instead. NAT (Network Address Translation) does the same: as each packet leaves, the router replaces the private source address with its public one. In Cisco terms, the private address is the inside local address and the public one is the inside global address.

PAT: one port per conversation

If every device shares one public address, how does a reply find its way to the right device? The router also tracks the port number. Each outgoing conversation gets its own port on the public side, and the router writes the pair into its translation table:

| Inside (private) | Outside (public) | |---|---| | 192.168.1.10:51000 | 203.0.113.7:40001 | | 192.168.1.11:52000 | 203.0.113.7:40002 |

When a reply arrives for 203.0.113.7:40001, the router finds that row, rewrites the destination back to 192.168.1.10:51000, and delivers it to the laptop. This is PAT (Port Address Translation), which Cisco also calls NAT overload and RFC 3022 calls NAPT. It is what lets a whole house share one address.

Try it yourself

On your computer, look up your own address (Windows: ipconfig; Mac: System Settings > Network; Linux: ip addr). It will almost always start with 192.168., 10. or 172.16-172.31. Then open a "what is my IP" page in a browser: it shows a completely different public address. That gap is NAT at work. If you have Cisco Packet Tracer, mark the LAN and WAN interfaces with ip nat inside and ip nat outside, add an access list for the LAN, configure PAT with ip nat inside source list 1 interface g0/1 overload, ping out from two PCs, and run show ip nat translations to see the table fill in.

Good to know

  • NAT for IPv4 is described in RFC 3022 (traditional NAT, including NAPT, which Cisco calls PAT or overload). Private ranges are in RFC 1918.
  • Cisco terms: inside local is the private address, inside global is the public address.
  • PAT tracks each session by address and port, and may keep the original source port if it is free. The port numbers in the video are illustrative.
  • Simplified: one translation entry per connection. Real tables can also show static entries, and UDP and ICMP traffic gets entries too.
  • Many providers now use carrier-grade NAT, so the "public" address on a home router may itself be translated again.
  • 203.0.113.7 comes from a documentation-only block, not a real host.

For CCNA learners

This lines up with CCNA 200-301 exam topic 4.1, configure and verify inside source NAT using static and pools: know inside local vs inside global, and how PAT (overload) lets many inside hosts share one global address by using unique ports.

Answer to the comment question

6 entries. PAT makes one translation entry per connection, so three laptops with two connections each need 3 × 2 = 6 rows, all sharing the same public address but each with its own port.

Test your knowledge

Quick quiz: NAT and PAT

4 multiple-choice questions. Pick one answer for each, then check how you did.

1Why can't a laptop's 192.168.1.10 address be used directly on the internet?
2What does NAT change as a packet leaves your home network?
3How does PAT know which device a reply belongs to?
4What is another name for PAT on Cisco routers?

Sources

Video transcript

How does every device in your house share one public IP address?

Private addresses aren't allowed out on the internet. Your router gets just one public address from your provider.

So it acts like a mailroom. As each packet leaves, the router swaps the private source address for its public one. That's NAT, Network Address Translation.

But with one shared address, how do replies find the right device? The router also gives each conversation its own port number, and writes it in a table.

Replies come back to that port, and the router delivers each one to the right device. That's PAT, also called NAT overload.

Three laptops each open two connections through PAT. How many entries go in the translation table? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons