LAB: NAT and PAT
Now you make NAT real. In this lab you build a small office network whose hosts live on private RFC 1918 addresses, attach a router with an inside/outside boundary, give the inside web server a static NAT mapping so the outside world can reach it, and turn the edge into a PAT (overload) router so every inside host shares the public address. You prove every part with show ip nat translations and end-to-end pings.
- Mark interfaces inside and outside on the NAT router.
- Configure a static NAT mapping for an inside web server.
- Configure dynamic PAT (overload) to share one public address.
- Verify with show ip nat translations and show ip nat statistics.
- Prove connectivity: inside host pings the outside server, then reaches the web via PAT.
- Troubleshoot a no-translation failure using the systematic checklist.
Overview and goal
The office LAN is 192.168.1.0/24 (inside). The ISP link is on network 200.100.10.0/24 (public test range from the RFC 5737 documentation blocks). One public address, 200.100.10.5, is dedicated to the internal web server via static NAT so that external users can always reach it; the remaining public space — here simply the interface address — carries every other session of every inside host through PAT.
This lab runs on Cisco IOS commands that work in Packet Tracer, GNS3, EVE-NG, and real hardware.
Router prompts are shown as R1# and R1(config-if)# as usual.
Topology
PC-A (.10) -\
>--- S1 --- R1 g0/0 (192.168.1.1, inside)
PC-B (.11) -/ |
WEB (.5) --------> R1 g0/1 (200.100.10.1, outside)
|
PUBLIC 200.100.10.0/24
|
OUTSIDE server 8.8.8.8
Addressing plan
| Device | Interface | IP address | Mask | NAT role |
|---|---|---|---|---|
| PC-A | NIC | 192.168.1.10 | 255.255.255.0 | Inside host (PAT) |
| PC-B | NIC | 192.168.1.11 | 255.255.255.0 | Inside host (PAT) |
| WEB | NIC | 192.168.1.5 | 255.255.255.0 | Inside server (static NAT to 200.100.10.5) |
| R1 | GigabitEthernet 0/0 | 192.168.1.1 | 255.255.255.0 | ip nat inside |
| R1 | GigabitEthernet 0/1 | 200.100.10.1 | 255.255.255.0 | ip nat outside |
| OUTSIDE | NIC | 8.8.8.8 | 255.255.255.0 | Outside host |
192.168.1.0/24) and the
outside side uses a public block. Using the same private range on both sides is a
real-world mistake that breaks return traffic and the exam will flag it. The outside link here is
addressed from the RFC 5737 documentation range so it is safe to type in any lab.Step 1 — Build the topology
In Packet Tracer (or your simulator):
- Add 2 PCs (PC-A, PC-B), 1 server (WEB), 1 switch (2960), 1 router (4321 or 2911), and 1 more PC or server to act as the OUTSIDE host (8.8.8.8).
- All inside devices connect star-shaped to S1 with copper straight-through.
- S1 → R1 g0/0: copper straight-through.
- R1 g0/1 → OUTSIDE host: copper straight-through (the OUTSIDE host is an end device). Internet cloud optional; a directly attached OUTSIDE host is simpler to verify.
clock rate; you avoid that here because the far side
of R1 is a host (OUTSIDE), not a second router.
Step 2 — Configure host PCs and the server
Static addressing on all three inside hosts via the Desktop → IP Configuration panel:
C:\> ipconfig /ip 192.168.1.10 255.255.255.0 192.168.1.1 ! PC-A C:\> ipconfig /ip 192.168.1.11 255.255.255.0 192.168.1.1 ! PC-B C:\> ipconfig /ip 192.168.1.5 255.255.255.0 192.168.1.1 ! WEB server
On the WEB server, enable its HTTP service (Services → HTTP → On in Packet Tracer). On the OUTSIDE host, set its address statically:
C:\> ipconfig /ip 8.8.8.8 255.255.255.0 200.100.10.1
OUTSIDE uses 200.100.10.1 as its default gateway because it shares the 200.100.10.0/24 public link with R1 g0/1.
Step 3 — Configure R1 (inside/outside + addresses)
Router> enable Router# configure terminal Router(config)# hostname R1 R1(config)# interface gigabitEthernet 0/0 ! inside: private LAN R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# ip nat inside R1(config-if)# no shutdown R1(config-if)# exit R1(config)# interface gigabitEthernet 0/1 ! outside: public link to the ISP / OUTSIDE host R1(config-if)# ip address 200.100.10.1 255.255.255.0 R1(config-if)# ip nat outside R1(config-if)# no shutdown R1(config-if)# end R1#
Verify the interfaces, and note that NAT is not active yet:
R1# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.1.1 YES manual up up GigabitEthernet0/1 200.100.10.1 YES manual up up
Step 4 — Baseline connectivity
The inside LAN lives behind NAT, so baseline tests behave in a specific order. First, inside hosts ping their own subnet (no NAT, MAC forwarding only):
C:\> ping 192.168.1.5 Reply from 192.168.1.5: bytes=32 time=1ms TTL=128 Reply from 192.168.1.5: bytes=32 time=1ms TTL=128 ! PC-A to WEB works (same LAN)
Now try an inside host reaching the OUTSIDE host before NAT is configured. It will fail to get an answer even though the path exists, because R1 will not translate and there is no route back to a private address:
C:\> ping 8.8.8.8 Request timed out. ! expected before NAT is enabled
ip nat inside/outside marked, but at this point no translation statement exists.
Even if it forwarded the packet, the reply would be addressed to a private source that no public
network knows how to route back to. Losing this exact ping — and watching it start winning after
Step 6 — is the simplest possible proof that PAT is doing its job.
Step 5 — Static NAT for the web server
Give the inside web server a permanent public identity so outside users can reach it without a prior outbound session:
R1(config)# ip nat inside source static 192.168.1.5 200.100.10.5 R1(config)# end R1# show ip nat translations Pro Inside global Inside local Outside local Outside global --- 200.100.10.5 192.168.1.5 --- ---
The mapping appears immediately, before any traffic. From the OUTSIDE host, the public web server is now reachable at 200.100.10.5:
C:\> ping 200.100.10.5 Reply from 200.100.10.5: bytes=32 time=2ms TTL=125 ! static NAT: inbound works
--- and the outside columns are empty: address-only 1:1
mapping. Ask the exam question “which command creates this row?” and the answer is exactly
the ip nat inside source static 192.168.1.5 200.100.10.5 you just typed.
Step 6 — PAT overload for the LAN
Now every other inside host shares the router’s own outside address. Select the LAN with a standard ACL, then overload against the interface:
R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255 R1(config)# ip nat inside source list 1 interface gigabitEthernet 0/1 overload R1(config)# end
interface gigabitEthernet 0/1 address (200.100.10.1) with overload, so
every inside session is multiplexed by source port onto that single address. If your ISP later hands
you a small public block instead, the equivalent would be
ip nat pool PUBLIC 200.100.10.10 200.100.10.20 netmask 255.255.255.0 plus
ip nat inside source list 1 pool PUBLIC overload.
Step 7 — Verify translations
Give NAT something to do: from PC-A, ping the OUTSIDE host and browse to it (Packet Tracer’s web browser at 8.8.8.8 or simply ping to create sessions). Then look at the table:
R1# show ip nat translations Pro Inside global Inside local Outside local Outside global --- 200.100.10.5 192.168.1.5 --- --- icmp 200.100.10.1:2048 192.168.1.10:2048 8.8.8.8:0 8.8.8.8:0 icmp 200.100.10.1:2049 192.168.1.11:2049 8.8.8.8:0 8.8.8.8:0 tcp 200.100.10.1:1025 192.168.1.10:1025 8.8.8.8:80 8.8.8.8:80
Three rows, all doing different work: the static row (address-only, public-facing web server), two PAT ICMP rows (PC-A and PC-B each pinging), and a PAT TCP row (PC-A browsing to the web port). PC-A and PC-B both appear as 200.100.10.1 on the public side — told apart only by the source port allocated to each session.
R1# show ip nat statistics Total active translations: 4 (1 static, 3 dynamic; 3 extended) Outside interfaces: GigabitEthernet0/1 Inside interfaces: GigabitEthernet0/0 Hits: 18 Misses: 4 Expired translations: 6 Dynamic mappings: -- Inside Source [Id: 1] access-list 1 interface GigabitEthernet0/1 refcount 3 interface GigabitEthernet0/1 type dynamic, total addresses 1, allocated 1 (100%), misses 0
overload,
“addresses allocated” topping out at 100% is normal (one interface address, many ports) —
it becomes a problem only in a pool-based design, where 100% means sessions are stalling.
Step 8 — Test end to end
The final proof is bidirectional. First, inside out — PC-A reaches the outside web server:
C:\> ping 8.8.8.8 Reply from 8.8.8.8: bytes=32 time=1ms TTL=125 Reply from 8.8.8.8: bytes=32 time=1ms TTL=125 ! worked now: PAT did it
Re-running show ip nat translations after that ping confirms the same flow twice:
PC-A yet again shares 200.100.10.1 with a fresh port. Now outside in — the OUTSIDE host reaches
the public web server:
C:\> ping 200.100.10.5 Reply from 200.100.10.5: bytes=32 time=2ms TTL=125 ! static NAT still works inbound
- PC-A (192.168.1.10) sends to 8.8.8.8. R1 matches ACL 1, finds/no translation, PAT-rewrites the source to 200.100.10.1 with a port, and forwards on g0/1.
- The OUTSIDE host replies to 200.100.10.1:thatport. R1 looks up the (global IP, port) pair, finds PC-A’s row, and rewrites the destination back to 192.168.1.10:thatport.
- For the WEB server, OUTSIDE sends to 200.100.10.5; R1’s static row rewrites the destination to 192.168.1.5 and the server’s reply gets the source back to 200.100.10.5.
Trace it with debug ip nat if you want the per-packet drama — the exchange shows
the before/after of each rewritten line. Remove it with undebug all when done; debugging
on a live router is expensive.
Step 9 — Troubleshooting guide
| Symptom | Probable cause | Fix / verify |
|---|---|---|
| No translations and inside ping to 8.8.8.8 fails | Interfaces not marked, or the NAT statement missing. | show ip nat statistics must list both interfaces; re-apply ip nat inside/ip nat outside and the ip nat inside source list ... overload line. |
| Some hosts translate, the rest don’t | The ACL permits the wrong range/mask. | Check access-list 1; 0.0.0.255 matches 192.168.1.0/24; a typo like 0.0.255.255 would miss part of it. |
| Static server reachable, but inside hosts still can’t get out | Forgot overload, so PAT is running as pool-less or 1:1 dynamic NAT with no pool. | Ensure the source list line ends in overload and references the interface or a pool; clear stale entries with clear ip nat translation *. |
show ip nat statistics shows pool allocated 100% and sessions stall | Pool exhausted in a pool-based design. | Add addresses to the pool, or migrate to interface…overload so all sessions share one address. |
| Replies come back to the wrong host | Port collision resolved by reassignment, or a stale translation. | show ip nat translations; clear the dynamic entries and retest, confirming each host has its own port. |
| Outside host cannot reach 200.100.10.5 | Static NAT missing, wrong mapping, or destination server unreachable. | Confirm the static row exists; verify WEB’s own IP/gateway; ping 192.168.1.5 from inside first. |
show ip nat translations list
anything? → does show ip nat statistics show hits? Translations exist but no
connectivity still → the problem is no longer NAT: check the return route, ACL filtering the
public link, or the OUTSIDE host’s default gateway (it must be 200.100.10.1).
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.