Lab: DHCP server, pools and relay on Cisco routers
In short: Dynamic Host Configuration Protocol (DHCP) hands out IP settings automatically. In this lab one router serves two subnets: its own LAN directly, and a remote LAN through a relay agent, and you check the leases from both sides.
Aim and what you need
The aim is to configure central DHCP for two subnets and understand why a relay is needed when the server is on a different network. DHCP discover messages are broadcasts, and routers do not forward broadcasts, so a router near the clients must pass them on.
- Packet Tracer or your own lab: two routers (R1 and R2), two switches, and at least one PC per LAN.
- Addressing: R1 LAN 192.168.10.0/24 (R1 .1), R1 to R2 link 10.0.12.0/30, R2 LAN 192.168.20.0/24 (R2 .1).
- Routing between the two routers, either static routes or OSPF from the earlier labs.
Design
When R2 relays a request, it writes the address of its client-facing interface (192.168.20.1) into the packet. R1 uses that address to choose the pool for 192.168.20.0/24. That is why the server needs a route back to the relay's LAN.
Steps
- On R1, exclude the addresses you reserve for routers, servers and printers before creating pools.
- Create one pool per subnet with the network, default gateway, DNS server and domain name.
- On R2, add the helper address on the interface that faces the clients.
- Set the PCs to DHCP and renew.
! R1: DHCP server
ip dhcp excluded-address 192.168.10.1 192.168.10.20
ip dhcp excluded-address 192.168.20.1 192.168.20.20
ip dhcp pool LAN10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 192.168.10.5
domain-name lab.example.com
lease 1
ip dhcp pool LAN20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server 192.168.10.5
domain-name lab.example.com
! R2: relay on the client-facing interface
interface g0/0
ip helper-address 10.0.12.1
Tip: Packet Tracer accepts most of these options but may ignore lease. On real IOS the lease is in days, so lease 1 means one day.
On a PC, use IP Configuration and select DHCP, or use the command prompt. On a Linux client in a real lab, use NetworkManager or dhclient.
ipconfig /release
ipconfig /renew
ipconfig /all
Verify
Success means each PC receives an address from the correct pool, starting at .21, with the right gateway and DNS server. On R1, the bindings table lists each client's MAC address and lease, and pool statistics show leased addresses for both pools.
show ip dhcp binding
show ip dhcp pool
show ip dhcp server statistics
show ip dhcp conflict
show running-config interface g0/0
Troubleshooting and clean-up
- Client gets 169.254.x.x: this is an automatic private (APIPA) address, meaning no DHCP server answered. Check the helper address and routing.
- Helper on the wrong interface: it must be on the interface where client broadcasts arrive, not on the link towards the server.
- Remote clients get nothing but local clients work: R1 has no route to 192.168.20.0/24, so its replies to the relay are lost.
- Address conflicts: a static device inside the pool range. Exclude it and clear the conflict with
clear ip dhcp conflict *.
To clean up, remove the pools with no ip dhcp pool LAN10 and no ip dhcp pool LAN20, and clear old leases with clear ip dhcp binding *. In production, also enable DHCP snooping on access switches so that a rogue DHCP server on a user port cannot hand out a fake gateway.
Practice
Why must ip dhcp excluded-address be planned before clients connect?
How does the server know which pool to use for a relayed request?
A PC shows 169.254.10.20. What happened?
Key takeaways
- DHCP uses a four-message exchange: discover, offer, request, acknowledge.
- Exclude reserved addresses before creating pools.
- Routers block broadcasts, so remote subnets need ip helper-address on the client-facing interface.
- The server needs a route back to the relay subnet.
- Verify with show ip dhcp binding and pool statistics.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.