NAT, PAT and DHCP: Configuration Examples with Explanations

Four complete Cisco IOS configurations — static NAT, dynamic NAT with a pool, PAT overload, and a DHCP server — each explained line by line, plus DHCP relay, verification commands, exam traps and five practice questions. Everything below is fair game for the CCNA 200-301.

Inside vs outside: the foundation of every NAT config

Before any NAT rule can work, the router must know which side of it is which. ip nat inside marks the interface facing your private network; ip nat outside marks the interface facing the internet or ISP. NAT then translates the source address of traffic flowing inside → outside, and the destination address of the returning traffic flowing outside → inside.

This matters because the most common NAT fault on the exam is also the simplest: the inside/outside designation is missing or swapped, so NAT never engages. If a scenario says "hosts can reach each other but can't reach the internet", your first check is always whether ip nat inside and ip nat outside are on the correct interfaces.

1. Static NAT: one-to-one, permanent mapping

Static NAT creates a permanent, one-to-one mapping between a private (inside local) address and a public (inside global) address. The classic use case is a server that must be reachable from the internet — a web server sitting on 192.168.1.10 inside is published as 203.0.113.5 outside.

! Designate the interfaces first — without these, nothing below works
R1(config)# interface gigabitEthernet0/0
R1(config-if)#  description LAN interface
R1(config-if)#  ip nat inside
R1(config-if)#  ip address 192.168.1.1 255.255.255.0
R1(config-if)#  no shutdown
R1(config-if)#  exit
R1(config)# interface gigabitEthernet0/1
R1(config-if)#  description WAN / ISP interface
R1(config-if)#  ip nat outside
R1(config-if)#  ip address 203.0.113.1 255.255.255.252
R1(config-if)#  no shutdown
R1(config-if)#  exit
! Create the permanent one-to-one mapping (inside address FIRST, then outside)
R1(config)# ip nat inside source static 192.168.1.10 203.0.113.5

Exam angle

The exam will ask you to spot a reversed static NAT command (ip nat inside source static 203.0.113.5 192.168.1.10) or to choose the command that makes an internal server reachable from outside. Mnemonic: static goes source-side first — inside, then outside, in the same order as the command name reads.

2. Dynamic NAT: a pool of public addresses, first-come-first-served

Dynamic NAT translates inside addresses to any available address from a configured pool. Unlike static NAT, nothing is permanent — a mapping is created when a host first sends traffic and expires after being idle. Each host still consumes one whole public address while its mapping lives, so a pool of 5 addresses supports at most 5 concurrent internal hosts.

! Interface designations are identical to static NAT
R1(config)# interface gigabitEthernet0/0
R1(config-if)#  ip nat inside
R1(config-if)#  ip address 192.168.1.1 255.255.255.0
R1(config-if)#  no shutdown
R1(config-if)#  exit
R1(config)# interface gigabitEthernet0/1
R1(config-if)#  ip nat outside
R1(config-if)#  ip address 203.0.113.1 255.255.255.252
R1(config-if)#  no shutdown
R1(config-if)#  exit
! Step 1: define which inside addresses are allowed to be translated
R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255
! Step 2: define the pool of public addresses to hand out
R1(config)# ip nat pool PUBLIC-POOL 203.0.113.5 203.0.113.9 netmask 255.255.255.0
! Step 3: tie them together — NO overload keyword here
R1(config)# ip nat inside source list 1 pool PUBLIC-POOL

3. PAT (NAT overload): many hosts, one public address

PAT — Port Address Translation, also called NAT overload — is the most common NAT in the real world and the most heavily tested on the CCNA. It works like dynamic NAT but also translates the source port number, so hundreds of inside hosts can share a single public address. The router keeps a translation table keyed on (private IP, private port) ↔ (public IP, public port) so return traffic reaches the correct host.

! Interface designations — same as before
R1(config)# interface gigabitEthernet0/0
R1(config-if)#  ip nat inside
R1(config-if)#  ip address 192.168.1.1 255.255.255.0
R1(config-if)#  no shutdown
R1(config-if)#  exit
R1(config)# interface gigabitEthernet0/1
R1(config-if)#  ip nat outside
R1(config-if)#  ip address 203.0.113.1 255.255.255.252
R1(config-if)#  no shutdown
R1(config-if)#  exit
! Which inside hosts may be translated
R1(config)# access-list 1 permit 192.168.1.0 0.0.0.255
! The overload keyword is the ENTIRE difference from dynamic NAT:
! it enables port translation so all hosts can share one address
R1(config)# ip nat inside source list 1 interface gigabitEthernet0/1 overload

Verify any NAT config with these three commands:

R1# show ip nat translations
! Shows each active mapping; PAT entries include the port numbers
R1# show ip nat statistics
! Shows hits, misses, pool usage and the inside/outside interfaces
R1# clear ip nat translation *
! Clears all dynamic mappings (never affects static entries)

4. DHCP server configuration on a Cisco router

A Cisco router can act as a DHCP server with four ingredients: a pool, a network statement, a default gateway, and excluded addresses. The DORA process is what this config serves — Discover, Offer, Request, Acknowledge:

  1. Discover — the client broadcasts a DHCPDISCOVER because it has no server address yet (broadcasts reach a DHCP server on the same subnet).
  2. Offer — the server replies with a DHCPOFFER proposing an IP address, mask, gateway and DNS.
  3. Request — the client broadcasts a DHCPREQUEST accepting the offer.
  4. Acknowledge — the server sends a DHCPACK and the lease is final.
! Step 1: EXCLUDE addresses that must never be handed out (router, servers, printers).
! Do this BEFORE creating the pool, in global config mode — not inside the pool.
R1(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.20
R1(config)# ip dhcp excluded-address 192.168.1.200
! Step 2: create the pool
R1(config)# ip dhcp pool LAN-POOL
R1(dhcp-config)#  network 192.168.1.0 255.255.255.0
R1(dhcp-config)#  default-router 192.168.1.1
R1(dhcp-config)#  dns-server 8.8.8.8 1.1.1.1
R1(dhcp-config)#  lease 7
R1(dhcp-config)#  exit

Verify with:

R1# show ip dhcp binding
! Every active lease: IP, client MAC, lease expiry
R1# show ip dhcp pool
! Pool utilisation — how many addresses are leased vs available
R1# show ip dhcp server statistics
! Counters for Discover/Offer/Request/Ack — confirms the server is actually serving

5. DHCP relay: one server, many subnets

DHCP Discover messages are broadcasts, and broadcasts don't cross routers. If your DHCP server lives on a different subnet from the clients, the client's local router interface needs ip helper-address — it converts the broadcast into a unicast forwarded to the server, and relays the reply back. This is how one DHCP server serves dozens of VLANs.

R2(config)# interface gigabitEthernet0/0
R2(config-if)#  description interface facing the DHCP clients
R2(config-if)#  ip address 192.168.2.1 255.255.255.0
! The DHCP server sits at 192.168.1.10 on another subnet — relay to it
R2(config-if)#  ip helper-address 192.168.1.10

Exam traps: the ones that catch people

Trap 1 — Inside/outside swapped or missing

If NAT "is configured but doesn't work", check show ip nat statistics for the inside/outside interface list first. No translation happens on an interface pair that was never designated.

Trap 2 — The missing overload keyword

ip nat inside source list 1 interface g0/1 without overload is dynamic NAT to a single address — the second host's translation fails. The exam presents this as "users can browse one at a time".

Trap 3 — Excluded addresses placed inside the pool

ip dhcp excluded-address is a global command. Shown inside (dhcp-config)# mode, it's wrong — and the exam shows it there deliberately.

Trap 4 — Wildcard vs subnet mask

NAT ACLs use wildcard masks (0.0.0.255); DHCP network statements use subnet masks (255.255.255.0); NAT pool commands use a netmask. Three commands, three mask types — match them.

Trap 5 — Static NAT argument order

ip nat inside source static takes the inside address first. Reversed arguments produce a mapping that looks configured but translates nothing useful.

Quick-fire practice questions

Five exam-style questions covering NAT, PAT and DHCP. Answer from memory, then click to reveal.

Q1. A router has ip nat inside source list 1 interface gigabitEthernet0/1 configured (no overload keyword). Fifty hosts are permitted by ACL 1. What happens when the second host tries to browse the internet?

It fails. Without overload, this is dynamic NAT using the single address on g0/1 — one public address supports one host at a time. The fix is to add overload to enable PAT so all fifty hosts share the address via port translation.

Q2. Which command makes the internal web server at 10.0.0.25 reachable from the internet as 203.0.113.10?

ip nat inside source static 10.0.0.25 203.0.113.10 — static NAT, inside address first. Remember the interfaces still need ip nat inside and ip nat outside for the mapping to engage.

Q3. A DHCP pool is configured for 192.168.5.0/24, but clients keep receiving an address that conflicts with the file server at 192.168.5.15. What is missing?

ip dhcp excluded-address 192.168.5.15 (in global config mode). Statically assigned addresses must be excluded before the server starts leasing, or it will hand out duplicates.

Q4. Clients on VLAN 20 cannot get DHCP addresses. The DHCP server is at 10.1.1.5 on VLAN 10. Which command, on which interface, fixes this?

ip helper-address 10.1.1.5 on the router interface facing VLAN 20 — the client-facing interface. The helper converts the client's broadcast Discover into a unicast to the server.

Q5. In the DHCP DORA process, which message does the server send to propose an IP address to the client?

DHCPOFFER. The order is Discover (client broadcasts) → Offer (server proposes) → Request (client accepts) → Acknowledge (server confirms). The exam also asks which message is broadcast vs unicast: Discover and Request are broadcasts; Offer and Ack are typically unicast.

NAT, PAT and DHCP for the CCNA 200-301 exam

NAT sits in IP Services and DHCP spans both IP Services and basic IP connectivity — between them, expect several questions on every exam attempt. The pattern is consistent: the exam shows a config and asks what will happen, so practise reading configs the way you just did above — interface designations first, then the translation or pool statements, then the keywords (overload, static, excluded-address).

For the theory behind these configs, read our CCNA NAT and PAT guide and CCNA DHCP and DNS guide. To drill the commands until they're reflex, work through the CCNA 200-301 practice questions and lock in the key terms with the flashcards.

Ready to test yourself?

NAT and DHCP are two topics of many on the CCNA 200-301. Take the free 25-question mock test — no sign-up — and find out where you stand. One subscription (£5/month or £39/year) unlocks all 370 exam-style questions, 20 in-browser labs and 300 flashcards across all 10 certifications.

Start the free mock test →