4.1 Configure and verify NAT for inside hosts using static mappings and address pools

CCNA 200-301 v1.1 · 4.0 IP Services

NAT rewrites addresses as packets cross a router, so hosts with private addresses (RFC 1918) can reach the internet and public services can be published from inside. For the CCNA you configure static NAT for a server, dynamic NAT with a pool, and PAT (overload), mark the inside and outside interfaces, and read the translation table.

What you must know

The four NAT addresses

TermMeaningIn the drawing
Inside localThe inside host's real address.PC1 192.168.1.11
Inside globalThe inside host as the internet sees it.203.0.113.2 (R1's outside address)
Outside localThe outside host as the inside sees it.Usually the same as outside global
Outside globalThe outside host's real address.A web server on the internet

Local is what the inside sees, global what the outside sees. Inside and outside say where the host lives.

Static NAT

Static NAT maps one inside address to one global address, permanently and in both directions. Use it to publish a server: connections to 203.0.113.10 from the internet reach SRV1 (2).

interface GigabitEthernet0/1
 ip nat inside
interface GigabitEthernet0/0
 ip nat outside
!
ip nat inside source static 192.168.1.10 203.0.113.10

Dynamic NAT with a pool

Dynamic NAT gives each inside host that matches an ACL a free address from a pool, one to one, for as long as it is in use. When the pool is empty, the next host fails.

access-list 1 permit 192.168.1.0 0.0.0.255
ip nat pool PUBLIC 203.0.113.20 203.0.113.30 netmask 255.255.255.224
ip nat inside source list 1 pool PUBLIC

PAT (overload)

PAT lets many hosts share one global address by also translating the source port. It is what home routers and most branches do: PC1 leaves as 203.0.113.2 with a new port (1), and the reply finds its way back through the port.

access-list 1 permit 192.168.1.0 0.0.0.255
ip nat inside source list 1 interface GigabitEthernet0/0 overload
! or overload a pool:
ip nat inside source list 1 pool PUBLIC overload
R1# show ip nat translations
Pro Inside global        Inside local         Outside local        Outside global
tcp 203.0.113.2:1024     192.168.1.11:51512   198.51.100.80:443    198.51.100.80:443
--- 203.0.113.10         192.168.1.10         ---                  ---

Commands

show ip nat translationsActive translations: inside global, inside local, outside local, outside global (with ports for PAT).
show ip nat statisticsHits and misses, the inside and outside interfaces, and pool usage.
clear ip nat translation *Removes dynamic translations, for example after changing the configuration.
debug ip natEach translation as it happens. Use with care on a busy router.

Exam traps

Check yourself

PC1 is 192.168.1.11 and leaves as 203.0.113.2. Which is the inside local and which the inside global?
Inside local 192.168.1.11 (the real address), inside global 203.0.113.2 (as seen outside).
Hosts cannot reach the internet and show ip nat statistics shows no hits. What do you check first?
That the interfaces are marked ip nat inside and ip nat outside, and that the ACL matches the hosts' addresses with a wildcard mask.
What one word turns dynamic NAT into PAT?
overload.
Which kind of NAT lets someone on the internet open a connection to an inside server?
Static NAT (or a static port mapping), because its entry exists before any traffic flows.

Labs

Try it live: PAT, DHCP server and NTP

More topics in 4.0 IP Services