The commands
| Command | Shows |
|---|---|
show ip nat translations | Every current translation (add verbose for timers) |
show ip nat statistics | Inside and outside interfaces, hits and misses, pool use |
clear ip nat translation * | Removes the dynamic entries (after a config change) |
show ip interface g0/0 | "Network address translation is enabled, interface in domain inside" |
Here PAT is running. Look at the statistics, then the table after some traffic:
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. Reply from 198.51.100.10: bytes=32 time<1ms TTL=62 Reply from 198.51.100.10: bytes=32 time<1ms TTL=62 Ping statistics for 198.51.100.10: Packets: Sent = 4, Received = 2, Lost = 2 (50% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms ▶ R1 R1>enable R1#show ip nat statistics | begin Outside Outside interfaces: GigabitEthernet0/1 Inside interfaces: GigabitEthernet0/0 Hits: 5 Misses: 1 CEF Translated packets: 5, CEF Punted packets: 0 Expired translations: 0 Dynamic mappings: -- Inside Source [Id: 1] access-list 1 interface GigabitEthernet0/1 refcount 1 Total doors: 0 Appl doors: 0 Normal doors: 0 Queued Packets: 0 R1#show ip nat translations verbose Pro Inside global Inside local Outside local Outside global icmp 203.0.113.2:10 192.168.1.10:10 198.51.100.10:10 198.51.100.10:10 create 00:00:11, use 00:00:03 timeout:60000, left 00:00:56 Flags: extended, use_count: 0, entry-id: 3, lc_entries: 0
Usual faults
- Inside and outside swapped, or one of them missing: nothing is translated.
- The ACL misses some hosts (a wrong wildcard such as 0.0.0.127): only part of the LAN works.
- No route out: NAT happens after routing, so the router needs a default route.
- Old entries after a change: clear them.
Remember: Translation needs three things: an inside interface, an outside interface, and a rule (static, or an ACL with a pool or interface). A packet is only translated when it is routed from an inside interface to an outside one.