DHCP lab practice
Run a DHCP server on a router, relay requests across subnets with ip helper-address, and protect the LAN with DHCP snooping.
7 labs · 6 lessons · 5 commands · 4 projects
DHCP hands hosts their address, mask, default gateway and DNS servers through a four-message exchange (Discover, Offer, Request, Acknowledge). A Cisco router can be the server, and can relay requests to a server on another subnet with ip helper-address.
Because any host can answer a Discover, switches add DHCP snooping: only trusted ports may send server replies, and the leases snooping records feed Dynamic ARP Inspection.
Hands-on labs
- Router as DHCP Server (Pro)
- A Complete DHCP Pool (Pro)
- Matching the Pool Gateway to the Interface (Pro)
- Two DHCP Pools on One Router (Pro)
- DHCP Relay Helper Setup (Pro)
- DHCP Relay on Two Interfaces (Pro)
- Restoring a Missing DHCP Helper (Pro)
To practise for free, build the topology in the free Sandbox.
Lessons, in order
- DHCP Fundamentals & DORA (4. IP Services, 11 min)
- DHCP Server & Relay Agent (ip helper) (4. IP Services, 11 min)
- DHCP Snooping Security (5. Security Fundamentals, 10 min)
- Enable DHCP snooping and place trust correctly (5. Security Fundamentals, 14 min)
- Serve or relay DHCP from the switch (Prerequisite review: CCNA topics from the CCNP courses, 9 min)
- A client has an address: trace the services it still needs (4. IP Services, 18 min)
Commands
- show ip dhcp binding — Lists the addresses the router’s DHCP server has leased, to which client, and when each lease expires.
- show ip dhcp pool — Shows each DHCP pool’s size, how many addresses are leased and the address range it hands out.
- show ip dhcp snooping — Shows whether DHCP snooping is on, for which VLANs, and which interfaces are trusted.
- show ip dhcp snooping binding — Lists the MAC-to-IP bindings DHCP snooping recorded from leases seen on untrusted ports.
- show ip interface — Shows an interface’s Layer 3 settings, including which access list is applied inbound and outbound.
Related projects
- Small Office DHCP with a Reserved Range for Printers and Servers — A 30-person legal practice keeps getting "duplicate address" errors: visiting laptops are being leased the same addresses the printer and file server use. The router (OFFICE-RTR) is unconfigured and the internet line is not yet connected. Set up the LAN gateway, reserve the low range for fixed devices, run a DHCP pool that hands out the right gateway and DNS server, and bring the internet line up with PAT.
- Centralised DHCP with Relay — Greyfriars School runs one DHCP server in the server room and several classroom subnets behind the router. Students in every room must get addresses from that one server, so the router has to relay their requests.
- Enterprise DHCP Relay (IP Helper-Address) Across Multi-VLAN Campus — An enterprise is centralizing its Windows Server DHCP infrastructure in the datacenter. Because broadcast DHCP Discover packets cannot cross routed boundaries, clients in Building A (VLAN 10) and Building B (VLAN 20) fail to get IP addresses. Configure IP Helper-Address on the gateway SVIs to forward broadcasts as unicast UDP.
- Veterinary Group DHCP Relay Across Three Practice VLANs — A veterinary group runs a central DHCP server and three practice VLANs. Configure relay on each VLAN interface so every practice leases from the one server.