ITNuvoAkademiya
Academy homePackagesPlaylistsToolsSubnet calculatorSearchGlossary
CiscoCCNA · CCNA: networking fundamentals1. Introduction2. Network Fundamentals3. Network Access4. IP Connectivity5. IP Services6. IPv67. Security Fundamentals8. AutomationCCNP: Enterprise networks · coming soon
LinuxLinux: system administrator üçün · Linux for system administrators1. Getting to know Linux2. Working with text3. Users and permissions4. Processes and packages5. Inside the system6. Monitoring and logs7. NetworkingRed Hat Enterprise Linux · Red Hat Enterprise Linux: from beginner to advanced1. Getting started2. Packages3. Users and permissions4. SELinux5. Services6. Storage7. Networking8. Building services9. Boot and recovery10. DevOps11. Security and monitoring
FortinetFortiGate Administrator · FortiGate Administrator: from first login to ZTNA1. Getting to know FortiGate2. Routing, policy and NAT3. Security profiles4. Users and logs5. Resilience, SD-WAN and automation6. VDOM7. VPN and ZTNA8. Proxy9. DMZ
MonitoringZabbix · Zabbix: from installation to alerts1. Introduction2. Installation and the database3. Basics: groups, templates, users4. Connecting devices5. Alerts, Grafana and the API
VirtualizationProxmox VE · coming soonVMware ESXi · coming soon
My account / Sign in
AZENRU
← itnuvo.com

NAT and PAT basics: static NAT, dynamic NAT and port address translation

Lesson 5.210 minIntermediateNovember 17, 2026
Open

This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.

Key points

  • Private addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are not routed on the Internet. NAT changes the source IP of an outgoing packet to a public address and translates the destination back in the reply.
  • Static NAT: one inside address is permanently mapped to one public address (1:1). Used when an inside server must be reachable from outside.
  • Dynamic NAT: an ACL defines which hosts are translated, and a pool defines which public addresses they are translated to. When the pool runs out, new hosts cannot get out.
  • PAT (NAT overload): many inside hosts share one public IP; the router tells the connections apart by port number.
  • NAT is not a security mechanism: security comes from ACLs, firewalls, IPS and policies. Some applications that carry IP addresses inside the packet (for example IPsec, FTP) can have trouble with NAT.

The problem: a private address cannot reach the Internet

Without NAT (Network Address Translation) and PAT (Port Address Translation), probably only one device at home could access the Internet.

LAN · insidePC10.50.0.11NATInternet198.51.100.20203.0.113.11SourceDestination10.50.0.11198.51.100.20Private source:the ISP drops it
Figure 1 · Without NAT the packet leaves with a private source IP (10.50.0.11); private addresses are not routed on the Internet

On the left, in the inside network (LAN), there is a computer with IP address 10.50.0.11 connected to a router. The ISP gave us one public address: 203.0.113.11. On the Internet there is a server with address 198.51.100.20.

When the computer sends a packet to the server, the source is the computer (10.50.0.11) and the destination is the server (198.51.100.20). When the server replies, it puts its own IP as the source and the computer's IP as the destination.

There is one problem with this example: the computer's address is a private address. Private addresses are meant for inside networks, public addresses for the Internet. The ISP will drop traffic with a private source.

Private address range (RFC 1918)Prefix
10.0.0.0 – 10.255.255.25510.0.0.0 /8
172.16.0.0 – 172.31.255.255172.16.0.0 /12
192.168.0.0 – 192.168.255.255192.168.0.0 /16

In these lessons we use the 203.0.113.0 /24 and 198.51.100.0 /24 ranges as public addresses. These ranges are reserved for documentation and examples and belong to nobody on the real Internet.

Static NAT step by step

Now the router is configured for NAT: address 10.50.0.11 must be translated to 203.0.113.11.

LAN · insidePC10.50.0.11NATInternet198.51.100.20203.0.113.11SourceDestination10.50.0.11198.51.100.20NATSourceDestination203.0.113.11198.51.100.20Source IPrewritten
Figure 2 · The NAT router rewrites the source IP from 10.50.0.11 to 203.0.113.11; the server only sees 203.0.113.11

1. The packet goes out. The computer again sends a packet to the server: source 10.50.0.11, destination 198.51.100.20. The NAT router changes the packet's source IP from 10.50.0.11 to 203.0.113.11 and remembers this translation in its NAT table.

2. The server replies. The server thinks it is talking to 203.0.113.11. So the destination in its reply is 203.0.113.11.

LAN · insidePC10.50.0.11NATInternet198.51.100.20203.0.113.11SourceDestination198.51.100.20203.0.113.11NATSourceDestination198.51.100.2010.50.0.11Using the NAT tabletranslated back
Figure 3 · The server replies to 203.0.113.11; the NAT router checks its NAT table and changes the destination back to 10.50.0.11

3. The packet is translated back. When the reply reaches the NAT router, the router checks its NAT table again, translates the destination 203.0.113.11 back to 10.50.0.11 and sends the packet to the computer.

This example is called static NAT: there is a permanent 1:1 relationship between the inside computer's address and the address from the ISP. Because the mapping is permanent, connections can also be started from outside to this address. That makes static NAT useful for inside servers that must be reachable from outside (a web server, for example).

Dynamic NAT

What if there are more computers inside? Then we can use dynamic NAT. Dynamic NAT differs from static NAT because:

  • A pool of public addresses is used for the translation.
  • An access-list selects which inside hosts are translated.

Suppose the ISP gave us a whole range instead of a single address, and we use part of it, 203.0.113.100 – 203.0.113.110, as a pool.

inside localpool: inside global10.50.0.11203.0.113.10010.50.0.12203.0.113.10110.50.0.13203.0.113.102203.0.113.103 ... 110NAT
Figure 4 · Dynamic NAT: each inside host gets the next free address from the pool (still 1:1, but not fixed in advance)
  1. 10.50.0.11 visits a server on the Internet. The NAT router translates it to the first address in the pool, 203.0.113.100.
  2. The next computer, 10.50.0.12, goes to the Internet. The router translates it to the second address in the pool, 203.0.113.101.
  3. The third computer, 10.50.0.13, gets 203.0.113.102.
  4. And so on.

This is dynamic NAT. The translation is still 1:1: each inside host gets its own public address. The difference is that which address it gets is not fixed in advance. When no free address is left in the pool, a new host cannot be translated and the router drops the packet.

PAT: one public IP, many hosts

You probably have several devices at home or in the office that access the Internet, but only one public IP from the ISP. How does that work?

This is where PAT (Port Address Translation) comes in. NAT only creates a 1:1 relationship between two IP addresses. With many computers inside and one IP from the ISP, we need to translate port numbers as well.

First let's see what happens without PAT. There are two computers inside: 10.50.0.11 and 10.50.0.12. The router is configured for plain NAT:

  1. 10.50.0.11 connects to the server.
  2. The NAT router translates 10.50.0.11 to 203.0.113.1.
  3. 10.50.0.12 also wants to connect to the server.
  4. The router has a problem: 203.0.113.1 is already given to 10.50.0.11, and the same address cannot be given 1:1 to two hosts.

With PAT, this is what happens:

inside10.50.0.11:4102210.50.0.12:57311PAT203.0.113.1:41022203.0.113.1:57311One public IP, different port numbers
Figure 5 · PAT: several inside hosts share one public IP; the router tells the connections apart by port number
  1. 10.50.0.11 connects to the server.
  2. The NAT router translates 10.50.0.11 to 203.0.113.1 and also keeps track of the source and destination ports.
  3. 10.50.0.12 also connects to the server.
  4. Because the router does PAT, it translates 10.50.0.12 to 203.0.113.1 as well, but tells the connection apart by a different port number.

According to Cisco's training materials, PAT first tries to keep the host's original source port. If that port is already in use, the router picks another free port number.

This way all inside computers can reach the Internet behind the one public IP from the ISP. Another name for PAT is NAT overload.

TypeRelationshipWhat you needWhen
Static NAT1 inside ↔ 1 public, permanentOne public IP per hostInside server reachable from outside
Dynamic NAT1 inside ↔ 1 public, from a poolPool of public IPs + ACLWhen you have several public IPs
PAT (overload)Many inside ↔ 1 public, by portOne public IP + ACLHomes and offices: the most common

Does NAT mean security?

The server thinks it is only talking to 203.0.113.1; it has no idea there are hosts 10.50.0.11 or 10.50.0.12 inside. Does that make NAT a security protocol?

No. Not seeing the real addresses of inside hosts does not mean you cannot connect to them: as long as the router is translating, those hosts are reachable. Security is built with access-lists, firewalls, IPS (intrusion prevention systems) and security policies.

Because NAT and PAT change the IP packet, some applications don't work well with this translation, especially those that carry the IP address inside the packet. IPsec is an example, and FTP can also cause trouble behind a NAT router.

Exam note: NAT is in the IP Services section of the CCNA 200-301 exam: you need to be able to configure and verify inside source NAT using static NAT and pools.

Check yourself

5 questions · answers are shown instantly · 3 correct answers complete the lesson

1What does a NAT router change in an outgoing packet?

NAT changes the inside host's private source IP to a public address; it translates the destination back when the reply arrives.

2Which address is in a private range?

Private ranges: 10.0.0.0/8, 172.16.0.0/12 (172.16–172.31) and 192.168.0.0/16.

3An inside web server must always be reachable from outside with the same public address. Which type of NAT fits?

Static NAT creates a permanent 1:1 mapping, so connections can also be started from outside.

4An office has 50 computers and the ISP gave one public IP. What is needed?

PAT lets many hosts out behind one public IP, telling them apart by port number.

5Is NAT a security mechanism?

NAT hides inside addresses, but hosts are reachable as long as the translation exists.
Was this lesson useful?

Comments

Sign in to comment.