CompTIA Network+ Preparation · lesson 5 of 30 · 25 min
DHCP Fundamentals
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP configuration to network devices. Without DHCP, every device would need manual IP configuration. DHCP uses UDP — client port 68, server port 67.
What DHCP assigns: IP address, subnet mask, default gateway, DNS server(s), lease duration, and optional parameters (NTP server, TFTP server, domain name).
DHCP scope — the range of IP addresses a DHCP server can assign. Example: 192.168.1.100 – 192.168.1.200. The scope also defines the subnet mask, gateway, and DNS for that range.
DHCP exclusions — IP addresses within the scope range that are excluded from assignment. Used for servers, printers, and other devices with static IPs that fall within the scope range.
DHCP reservations — binding a specific IP address to a specific MAC address. The device always gets the same IP from DHCP. Useful for printers and servers that need a consistent IP but managed centrally.
Lease duration — how long a client can use an assigned IP. Client attempts to renew at 50% of lease time (T1), then again at 87.5% (T2). If renewal fails, the IP is returned to the pool.
The DORA Process
DHCP uses a four-step process called DORA to assign an IP address:
Why DHCPREQUEST is broadcast: The client may have received offers from multiple DHCP servers. Broadcasting the REQUEST tells all servers which offer was accepted — other servers reclaim their offered IPs.
DHCPNAK — server sends this if the requested IP is no longer available. Client restarts the DORA process.
DHCPRELEASE — client sends this when it no longer needs the IP (e.g., graceful shutdown). Returns the IP to the pool immediately.
DHCP relay agent (IP helper) — DHCP uses broadcasts, which do not cross routers. A relay agent (configured on the router with ip helper-address) forwards DHCP broadcasts as unicast to the DHCP server on another subnet.
Exam Tip
DORA = Discover, Offer, Request, Acknowledge. DHCP uses UDP 67 (server) and 68 (client). Relay agents forward DHCP across subnets. Reservations bind IP to MAC. Exclusions remove IPs from the scope pool.
Key Terms
Key Terms
Knowledge Check — 10 Questions
Network+ — DHCP
What does DORA stand for?
- Detect, Offer, Respond, Assign
- Discover, Offer, Request, Acknowledge
- Discover, Offer, Reserve, Assign
- Detect, Offer, Request, Acknowledge
Answer: Discover, Offer, Request, Acknowledge
DORA is the four-step DHCP process: client Discovers, server Offers, client Requests, server Acknowledges.
DHCP uses which ports?
- TCP 67/68
- UDP 67/68
- UDP 53/54
- TCP 53/54
Answer: UDP 67/68
DHCP uses UDP — server listens on port 67, client listens on port 68. UDP is used because DHCP operates before the client has an IP.
Why is the DHCPREQUEST sent as a broadcast?
- Because the client has no IP yet
- To notify all DHCP servers which offer was accepted so others can reclaim their offered IPs
- Because UDP requires broadcast
- To reach the default gateway
Answer: To notify all DHCP servers which offer was accepted so others can reclaim their offered IPs
Multiple servers may have sent offers. Broadcasting the REQUEST tells all of them — only the selected server sends DHCPACK.
A DHCP reservation binds:
- An IP range to a subnet
- A specific IP to a specific MAC address
- A scope to a VLAN
- A lease time to a user
- Answer: A specific IP to a specific MAC address
Reservations ensure a device always gets the same IP from DHCP — identified by its MAC address. Useful for printers and servers. A DHCP relay agent is needed when:
- The DHCP server is on the same subnet as clients
- Clients and the DHCP server are on different subnets separated by a router
- The scope is full
- Clients use static IPs
- Answer: Clients and the DHCP server are on different subnets separated by a router
DHCP broadcasts do not cross routers. A relay agent (ip helper-address) forwards the broadcast as unicast to the DHCP server. DHCP exclusions are used to:
- Reserve IPs for specific MAC addresses
- Remove specific IPs from the scope pool so they are not assigned dynamically
- Block devices from getting DHCP
- Set shorter lease times
- Answer: Remove specific IPs from the scope pool so they are not assigned dynamically
Exclusions prevent DHCP from assigning specific IPs — used for devices with static IPs that fall within the scope range.
A client attempts to renew its DHCP lease at what percentage of the lease time?
- 25%
- 50%
- 75%
- 100%
Answer: 50%
T1 renewal attempt = 50% of lease time. T2 (rebind) = 87.5%. If both fail, the client must restart DORA when the lease expires.
DHCPNAK is sent by the server when:
- The client requests renewal
- The requested IP is no longer available
- The scope is empty
- The client releases its IP
- Answer: The requested IP is no longer available
DHCPNAK (Negative Acknowledgement) tells the client its requested IP is unavailable — client must restart the DORA process.
Which DHCP message does a client send when shutting down gracefully?
- DHCPDISCOVER
- DHCPNAK
- DHCPRELEASE
- DHCPDECLINE
Answer: DHCPRELEASE
DHCPRELEASE returns the IP to the pool immediately — allows the server to reassign it rather than waiting for the lease to expire.
The router command _____ forwards DHCP broadcasts to a remote server.
Answer: ip helper-address
ip helper-address [DHCP server IP] configured on the router interface converts DHCP broadcasts to unicast and forwards them.
Previous lesson: DNS record types: A, AAAA, CNAME, MX, PTR, TXT, NS, SOA
Back to CompTIA Network+ Preparation
Next lesson: Network topologies: star, mesh, bus, ring, hybrid; IP addressing and subnetting