NAT (Network Address Translation) rewrites IP addresses at the edge of your network.
You already built every variant in the NAT module of the CCNA path.
Let's put everything back in place in one lesson.Private Addresses Stop at the Edge
Your internal hosts use private addresses defined by RFC 1918: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
These ranges are not routable on the public Internet.Watch what happens when 192.168.1.5 sends a packet to 8.8.8.8 without translation.
Figure 1 – Without NAT, the packet from 192.168.1.5 is blocked
Not a single reply comes back.
PC1> ping 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: ..... Success rate is 0 percent (0/5)The packet is dropped at the edge.
No provider forwards traffic sourced from a private address.
Your host needs a public address before it can leave.Answer the question below
What happens to a packet sourced from a private address at the edge?
Translation at the Edge
Your router provides that public address.
The translation mechanism is defined in RFC 3022.
Figure 2 – R1 replaces the private source IP with its public IP
R1 swaps the source 192.168.1.5 for its public address 37.5.55.103.
It records the mapping in its NAT table.
When the reply comes back, the table tells R1 which internal host gets the packet.
Static, Dynamic and PAT are all variations of this mechanism.Answer the question below
Where does the router record each active translation?
A translation can be fixed, borrowed from a pool, or shared through port numbers.
You know all three from CCNA.Static NAT: One-to-One
Static NAT binds one private address to one public address, permanently.
Figure 3 – Static NAT maps 192.168.1.5 to 37.5.55.103 one-to-one
Look at the NAT table on R1 while the server is talking to 8.8.8.8.
R1# show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 37.5.55.103:1025 192.168.1.5:1025 8.8.8.8:80 8.8.8.8:80 --- 37.5.55.103 192.168.1.5 --- ---The tcp line is the live session. The --- line is the static rule itself: permanent, no protocol, no ports, and still there when the server sends nothing.
The mapping never expires and works in both directions.
That makes it the right choice for a server that must stay reachable from the outside.
The cost: one public address reserved per host, even when it sends nothing.Dynamic NAT: A Borrowed Pool
Dynamic NAT keeps the one-to-one logic but makes it temporary.
Figure 4 – Dynamic NAT lends a public IP from a shared pool
When a host sends traffic, your router lends it a free address from a public pool.
When the session ends, the address returns to the pool.But the pool is finite.
Figure 5 – Pool exhausted: the fourth host is denied
Three addresses in the pool, four hosts sending traffic: the fourth connection is denied.
Each active host still consumes one full public address.
Dynamic NAT moved the problem without solving it.Answer the question below
What happens to a new connection when the dynamic pool is empty?
PAT: Ports Make the Difference
PAT (Port Address Translation), also called NAT Overload, breaks the one-to-one constraint.
Figure 6 – PAT translates the source IP and the source port
PC1 keeps its own port 20001 inside, but reaches 8.8.8.8 as 37.5.55.103:40001.
PC2 and PC3 get 40002 and 40003 on that same public address.Your router translates the source address and the source port.
Together, the source IP and the source port identify each session, so thousands of hosts share a single public address.
This is what runs on your home router and on almost every enterprise edge.Method
Mapping
Public IPs needed
Typical use
Static
Fixed 1-to-1
One per host
Server reachable from outside
Dynamic
Temporary 1-to-1
One per active host
Rare, legacy designs
PAT
Many-to-1 via ports
One
Everything else
Table 1 – The three translation methods
Answer the question below
Which value does PAT translate in addition to the source IP?
Every NAT output on Cisco IOS uses the same four terms.
Misread them and you misread the whole table.Inside or Outside, Local or Global
Each term combines two words, and each word answers one question.
Inside or outside tells you where the device sits.
Local or global tells you from which side of the router you are looking.
Figure 7 – The four NAT address types around one translation
Inside Local: the private address of your internal host, here 192.168.1.5
Inside Global: the public address representing that host on the Internet, here 37.5.55.103
Outside Global: the real address of the remote resource, here 8.8.8.8
Outside Local: the remote resource seen from inside, almost always identical to Outside Global
Reading a Translation Line
Take one line from
show ip nat translationsand apply the vocabulary:R1# show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 37.5.55.103:1025 192.168.1.5:1025 8.8.8.8:80 8.8.8.8:80 --- 37.5.55.103 192.168.1.5 --- ---Your host 192.168.1.5 appears on the Internet as 37.5.55.103 and talks to 8.8.8.8 on port 80.
The port is the same on both sides here: static NAT rewrites the address only.Answer the question below
Which term designates the private address of your internal host?
You manage R1, the edge router of a branch office.
The LAN 192.168.1.0/24 sits behind g0/0, and g0/1 faces the Internet with the public address 37.5.55.103.
Your objective: this time the server 192.168.1.5 gets a second public address, 37.5.55.104, while every other host shares the interface address 37.5.55.103 through PAT.Figure 8 – Branch topology: one LAN, one router, one public interface
Marking the NAT Boundary
NAT only translates traffic crossing from an inside interface to an outside interface.
So the first step is always the same: mark the boundary.R1# configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# interface g0/0 R1(config-if)# ip address 192.168.1.254 255.255.255.0 R1(config-if)# ip nat inside R1(config-if)# exit R1(config)# interface g0/1 R1(config-if)# ip address 37.5.55.103 255.255.255.0 R1(config-if)# ip nat outside R1(config-if)# exitA missing
ip nat insideis the most common reason a correct rule translates nothing.Answer the question below
Which command marks g0/0 as the LAN side of the translation?
Static for the Server, PAT for the Rest
Start with the server.
One command creates the permanent one-to-one mapping.R1(config)# ip nat inside source static 192.168.1.5 37.5.55.10437.5.55.104 is a second public address that your ISP routes toward R1.
NAT only rewrites headers, so the route must already exist.Now the rest of the LAN.
An access list selects the hosts to translate.
The overload keyword maps them all to the interface address.R1(config)# ip access-list standard LOCAL_HOSTS R1(config-std-nacl)# permit 192.168.1.0 0.0.0.255 R1(config-std-nacl)# exit R1(config)# ip nat inside source list LOCAL_HOSTS interface g0/1 overload R1(config)# endThe server 192.168.1.5 matches the access list too.
No conflict here: the static rule always wins for that host, and PAT handles everyone else.Answer the question below
Which rule translates the server 192.168.1.5?
Reading the Translations
Translations only appear when traffic flows.
Send a ping from PC2 (192.168.1.6) to 8.8.8.8.PC2> ping 8.8.8.8 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 1/2/6 msNow read the result on R1.
R1# show ip nat translations Pro Inside global Inside local Outside local Outside global --- 37.5.55.104 192.168.1.5 --- --- icmp 37.5.55.103:7 192.168.1.6:7 8.8.8.8:7 8.8.8.8:7Two lines, two rule types:
The --- line is your static rule: permanent, no protocol, no ports
The icmp line is PAT in action: PC2 uses the interface address with its own port number
Finish with the counters.
R1# show ip nat statistics Total active translations: 2 (1 static, 1 dynamic; 1 extended) Outside interfaces: GigabitEthernet0/1 Inside interfaces: GigabitEthernet0/0 Hits: 9 Misses: 0 CEF Translated packets: 9, CEF Punted packets: 0 Expired translations: 0 Dynamic mappings: -- Inside Source [Id: 1] access-list LOCAL_HOSTS interface GigabitEthernet0/1 refcount 1Nine hits, zero misses: that is the signature of healthy NAT.
One static rule for the server, one overload rule for everyone else.
That pattern covers most NAT deployments you will meet.Answer the question below
Which keyword lets many hosts share one public address?
Answer the question below
Server 192.168.1.5 opens TCP 1025 to 8.8.8.8:80: what Inside global does that line show?