What DHCP is all About
Introduction
Welcome to Part 16 of the Network Fundamentals study notes! If you haven’t already, we recommend watching the video first.
Office networks can have hundreds of devices, each needing a unique IP address. Manually configuring every phone, tablet, laptop, and workstation — and then reconfiguring them as they move around the building — is simply not practical. DHCP (Dynamic Host Configuration Protocol) automates the whole process.
The DORA Process
When a device needs an IP address, it goes through a four-step exchange with a DHCP server. A handy way to remember the steps is DORA: Discover, Offer, Request, Acknowledge.
1. Discover
A newly booted device has no IP address yet, so it doesn’t know where the DHCP server is. It broadcasts a DHCP Discover message to the entire local network. The message includes the device’s MAC address so the server knows who to respond to. Regular devices ignore it; DHCP servers pay close attention.
2. Offer
The DHCP server receives the Discover message, picks an available IP from its pool, temporarily reserves it, and sends a DHCP Offer back to the client. If there are multiple DHCP servers on the network, the client may receive more than one offer.
3. Request
The client selects one of the offers it received (typically the first one) and broadcasts a DHCP Request to formally ask for that IP. Broadcasting this — rather than unicasting to just the chosen server — also lets any other DHCP servers know their offer wasn’t selected, so they can release their reserved addresses.
4. Acknowledge
The chosen DHCP server sends a DHCP Acknowledge to officially allocate the IP address to the client. The client is now free to use it, along with any other information the server included (covered below).
Lease Times
An IP address assigned by DHCP is only valid for a set period called the lease time. Windows Server defaults to 8 days; Cisco DHCP servers default to 1 day. You can configure this to whatever suits your network.
At the halfway point of the lease, the client tries to renew it — contacting the same DHCP server to ask to keep the same IP. The server will usually accommodate this, but there’s no guarantee. If the lease expires without renewal, the server reclaims the address and puts it back in the pool.
A client can also voluntarily send a DHCP Release message to tell the server it’s finished with the IP. This isn’t required, but it’s good practice.
Static Allocations (Reservations)
Sometimes you want a specific device to always get the same IP — even through DHCP. This is called a reservation. The DHCP server is configured to link a particular MAC address to a particular IP. When the Discover message arrives, the server recognises the MAC and offers that reserved IP.
Reservations are useful for devices like network printers, cameras, or servers that need consistent addressing but where you still want DHCP handling the configuration.
APIPA
If a Windows device can’t find a DHCP server, it assigns itself an address from the 169.254.0.0/16 range — this is called an APIPA address (Automatic Private IP Addressing). If you see an address starting with 169.254, it almost always means DHCP failed.
To force a fresh attempt, use ipconfig /release followed by ipconfig /renew from the Windows command line. These two commands together are also useful whenever the DHCP server has been updated and you want the client to pick up the new settings.
DHCP Options
A DHCP server doesn’t just hand out IP addresses — it can also deliver additional configuration information called options. The most common ones are:
- Router – the IP address of the default gateway. This is how clients learn which router to use for traffic outside their local subnet.
- DNS Server – the IP address of one or more DNS servers (covered in the next video).
- Domain Name – the domain the client belongs to (e.g.
networkdirection.net). Important in Windows environments. - TFTP Server – the IP address of a TFTP server. Critical for IP phones: when a phone boots, it uses this address to download its configuration files automatically.
DHCP Relay
DHCP relies on broadcast messages — and routers don’t forward broadcasts. So a client on one subnet can’t reach a DHCP server on another subnet directly. There are a few solutions:
- Put a DHCP server on every subnet — workable but high maintenance.
- Give the DHCP server a network interface on each subnet — also possible, but doesn’t scale well.
- Use a DHCP relay — the most practical and common solution.
A DHCP relay is configured on a router interface. When a Discover broadcast arrives, the relay intercepts it and forwards it as a unicast directly to the DHCP server’s IP address. The server responds to the relay, and the relay forwards the response to the original client. This lets a single centralised DHCP server serve multiple subnets.
On a Cisco router, configure the relay on the interface that faces the client subnet: ip helper-address <dhcp-server-ip>.
Cisco DHCP Configuration
Cisco routers can act as DHCP servers. Key commands:
ip dhcp pool <name>– create a named pool (equivalent to a scope in Windows)network <address> <mask>– define the address rangedefault-router <ip>– set the default gateway optionlease <days>– set the lease timedomain-name <name>– set the domain name optiondns-server <ip>– set the DNS server optionnext-server <ip>– set the TFTP server address (for IP phones)ip dhcp excluded-address <ip>– prevent specific IPs from being handed out. Use this to protect any statically assigned addresses (router interfaces, servers, printers) from being double-allocated.
Verification Commands
show ip dhcp pool– pool statistics including total size and how many addresses are in use. Monitor this — running out of IPs causes silent failures.show ip dhcp binding– lists every allocated IP address, the MAC it was given to, and the lease expiry time.show ip dhcp server statistics– detailed message counts; useful for troubleshooting when DHCP isn’t working as expected.
Resources
Test your knowledge with the Introduction to Networking quizzes.
