Cisco CCNA Preparation · lesson 26 of 36 · 25 min
Cisco IOS as a DHCP Server
A Cisco router or Layer 3 switch can act as a DHCP server, assigning IP addresses, subnet masks, default gateways, DNS servers, and other options to clients automatically. This is common in small-to-medium networks where a dedicated DHCP server is not available.
DHCP Pool Configuration
Exclude first
Always configure ip dhcp excluded-address BEFORE creating the pool. If you exclude after, addresses may already have been assigned. Excluded addresses are never offered to clients.
DHCP Options
DHCP options provide additional configuration to clients beyond the basic IP/mask/gateway. Common options used in enterprise environments:
DHCP Relay Agent
DHCP uses broadcasts — routers do not forward broadcasts by default. When clients are on a different subnet from the DHCP server, a DHCP relay agent is needed. The ip helper-address command on the router interface facing the clients converts DHCP broadcasts to unicast and forwards them to the DHCP server.
ip helper-address forwards more than DHCP
By default, ip helper-address forwards 8 UDP broadcast types: TFTP (69), DNS (53), Time (37), NetBIOS (137, 138), TACACS (49), BOOTP/DHCP (67, 68). You can restrict this with no ip forward-protocol udp [port].
Verification and Troubleshooting
Knowledge Check — 10 Questions
DHCP Server Configuration on IOS
What command prevents specific IP addresses from being assigned by the DHCP server?
- ip dhcp pool exclude
- ip dhcp excluded-address
- no ip dhcp address
- ip dhcp reserve
Answer: ip dhcp excluded-address
ip dhcp excluded-address [start] [end] reserves a range of IPs that the DHCP server will never offer to clients. Configure this before creating the pool.
In a DHCP pool, what does the default-router command specify?
- The DHCP server IP
- The default gateway sent to DHCP clients
- The DNS server
- The TFTP server
Answer: The default gateway sent to DHCP clients
default-router [IP] in a DHCP pool is sent to clients as their default gateway (DHCP Option 3). Clients use this to reach networks outside their subnet.
What command shows all current DHCP lease assignments (IP to MAC mappings)?
- show ip dhcp pool
- show ip dhcp binding
- show ip dhcp conflict
- show ip dhcp statistics
Answer: show ip dhcp binding
show ip dhcp binding displays all active DHCP leases: client MAC address, assigned IP, lease expiry, and type (automatic/manual).
Why is ip helper-address needed for DHCP across subnets?
- DHCP uses TCP which routers block
- DHCP uses broadcasts which routers do not forward by default
- DHCP requires a dedicated VLAN
- Routers cannot process DHCP packets
Answer: DHCP uses broadcasts which routers do not forward by default
DHCP Discover and Request are broadcasts. Routers do not forward broadcasts. ip helper-address converts these broadcasts to unicast directed at the DHCP server.
What is DHCP Option 150 used for?
- Default gateway
- DNS server
- TFTP server IP for Cisco IP phones
- Domain name
Answer: TFTP server IP for Cisco IP phones
Option 150 provides the TFTP server IP to Cisco IP phones so they can download their firmware and configuration. Option 66 provides the TFTP server name.
What does show ip dhcp conflict display?
- All DHCP pools
- IPs that were offered but found to be already in use
- Excluded address ranges
- DHCP relay agent statistics
Answer: IPs that were offered but found to be already in use
DHCP conflicts occur when the server offers an IP that is already statically assigned to another device. The server pings before offering — if it gets a reply, it logs a conflict and skips that IP.
What is the default DHCP lease duration on Cisco IOS?
- 8 hours
- 12 hours
- 1 day
- 7 days
Answer: 1 day
The default DHCP lease on Cisco IOS is 1 day (24 hours). Configure with lease [days] [hours] [minutes] or lease infinite for permanent assignments.
On which interface is ip helper-address configured?
- The interface facing the DHCP server
- The interface facing the DHCP clients (on the router closest to the clients)
- The loopback interface
- Any interface on the router
Answer: The interface facing the DHCP clients (on the router closest to the clients)
ip helper-address is configured on the router interface that receives the DHCP broadcast from clients. It forwards the broadcast as unicast to the specified DHCP server IP.
The command ip dhcp pool _____ creates a named DHCP pool and enters DHCP configuration mode.
Answer: [pool-name]
ip dhcp pool [name] creates the pool. Inside the pool config mode, you set network, default-router, dns-server, lease, and other options.
What happens if you forget to configure ip dhcp excluded-address before creating the pool?
- The pool will not work
- The router may assign the excluded IPs to clients before you add the exclusion
- The excluded addresses are automatically detected
- Nothing — exclusions apply retroactively
Answer: The router may assign the excluded IPs to clients before you add the exclusion
Exclusions only prevent future assignments. If a client already received an IP that you later exclude, that binding remains until it expires or is cleared.
Previous lesson: PAT (NAT overload): configuration, verification, troubleshooting
Back to Cisco CCNA Preparation
Next lesson: Security concepts: threats, vulnerabilities, exploits, mitigation; password policies, MFA, certificates, biometrics