What Is DHCP Client and Server in Networking?
Also known as: DHCP client, DHCP server, DORA process, DHCP relay, DHCP snooping
On This Page
Quick Definition
A DHCP client is a device like a laptop or phone that asks for an IP address when it connects to a network. A DHCP server is a computer or router that gives out IP addresses and other settings automatically. This saves network administrators from having to manually configure each device.
Must Know for Exams
DHCP is a core topic for Cisco CCNP Enterprise (350-401 ENCOR and 300-410 ENARSI) exams, where it appears in the Infrastructure Services section. Candidates must understand the DORA process in detail, including the contents of each message type. The ENARSI exam specifically tests advanced DHCP features such as DHCP relay, DHCPv6, DHCP snooping, and DHCP options.
Exam questions often require candidates to interpret debug output or packet captures. For example, a question might show a troubleshooting scenario where a client fails to obtain an IP address, and the candidate must identify whether the problem is that the DHCP server is unreachable, the client is sending requests but not receiving offers, or the server is out of addresses.
DHCP relay agents are a frequent topic. In routed networks, DHCP broadcast messages do not cross routers by default. A relay agent on the router forwards the client’s Discover message as a unicast to the DHCP server on another subnet. Exam questions may ask how to configure the ip helper-address command on a Cisco router to enable DHCP relay.
DHCP snooping is another exam-relevant feature. Questions may present a scenario where a rogue DHCP server is causing connectivity issues, and the candidate must configure DHCP snooping on a switch to trust only specific ports. The exam may also test the interaction between DHCP and other services like DNS, NAT, and IP address reservation.
In the context of the ENARSI exam, DHCPv6 configuration and operation are also covered. Candidates need to know the difference between stateless and stateful DHCPv6, and how to configure the ipv6 dhcp pool command. The exam may also include questions about DHCP option 82, which adds relay agent information to DHCP packets, and how it is used for security and policy enforcement.
Simple Meaning
Imagine you walk into a large office building for the first time. You need a desk, a phone, and a copy of the office rules to get started. Instead of hunting down the building manager for each item, you go to a central reception desk. The receptionist checks your identity, hands you a key card for the door, assigns you a desk number, and gives you a printed sheet with the office Wi-Fi password and phone extension. All of this happens in one quick conversation. That is exactly what DHCP does for devices on a network.
When you plug a laptop into an Ethernet port or connect your phone to Wi-Fi, your device acts as a DHCP client. It sends out a broadcast message saying, “Hello, I am new here. Can someone give me an address and tell me how to connect?” The DHCP server, which is often built into a router or a dedicated server, receives that request. It then checks its pool of available addresses, picks one that is not in use, and sends it back to your device along with other important details. These details might include the subnet mask, which tells your device how big the network is, the default gateway, which is the door to the internet, and the DNS server addresses, which help translate website names into numbers.
The entire exchange takes only a few milliseconds. Your device then configures itself automatically and you can start browsing the web or accessing network resources. If you later disconnect and come back the next day, the process repeats, but the server might give you the same address it gave you before, like a hotel giving you the same room on your return visit. This automatic assignment prevents two devices from accidentally getting the same address, which would cause confusion and connectivity problems. Without DHCP, a network administrator would have to visit every device, manually type in an IP address, and keep a written log to avoid conflicts. On a large network with hundreds or thousands of devices, that would be impossible.
DHCP also handles leases. A lease is like a temporary parking permit. Your device gets to use the assigned IP address for a set period of time, maybe one day or one week. When the lease is halfway expired, your device quietly asks the server to renew it. If it does not renew, the server can give that address to another device later. This makes efficient use of a limited number of addresses.
Full Technical Definition
The Dynamic Host Configuration Protocol (DHCP) operates at the application layer of the OSI model, specifically using UDP ports 67 and 68. The DHCP server listens on UDP port 67, while the DHCP client uses UDP port 68. The protocol defines a four-step process known as DORA: Discover, Offer, Request, and Acknowledge.
When a DHCP client boots up or connects to a network, it first sends a DHCP Discover message. This is a broadcast packet sent to the destination IP address 255.255.255.255, because the client does not yet know the IP address of any DHCP server. The source IP is 0.0.0.0, since the client has no IP address of its own. The packet includes the client’s MAC address and sometimes a requested lease duration.
Any DHCP server that receives this Discover message responds with a DHCP Offer. This offer is typically a unicast packet sent directly to the client’s MAC address, though in some cases it may be broadcast. The Offer contains a proposed IP address, subnet mask, default gateway, DNS server addresses, and the lease duration. The offer is not binding; the client may receive multiple offers from different servers on the same network.
The client then selects one offer and sends a DHCP Request message back to that specific server. This message is a broadcast packet that tells the chosen server, “I accept your offer.” It also informs any other servers that their offers were declined. The DHCP Request includes the server identifier to avoid confusion.
Finally, the selected server responds with a DHCP Acknowledgment (ACK) packet. This ACK confirms the lease and provides the client with the final configuration parameters. The client then applies these settings to its network interface. If the server cannot fulfill the request, perhaps because the offered address is now taken, it sends a DHCP NAK (negative acknowledgment), and the client must start the process over.
DHCP also supports renewal and rebinding. When 50 percent of the lease time has passed, the client attempts to renew the lease by sending a unicast DHCP Request directly to the server that granted the lease. If no response is received by the time 87.5 percent of the lease has elapsed, the client sends a broadcast DHCP Request to any server on the network, a phase called rebinding. If the lease expires completely, the client must release its IP address and go through the full DORA process again.
DHCP can be configured on Cisco routers using the ip dhcp pool command in global configuration mode. Administrators define the network, default router, DNS server, lease time, and optionally an excluded address range to reserve addresses for static devices like servers and printers. DHCP snooping is an additional security feature on Cisco switches that prevents rogue DHCP servers from handing out malicious addresses. It filters DHCP messages and only allows trusted ports to send Offer and ACK packets.
DHCPv6, the version for IPv6, uses a different set of options and messages but follows a similar client-server model. It can operate in stateless mode, where the client uses its own interface identifier and only receives DNS and other parameters from the server, or stateful mode, where the server assigns the entire IPv6 address.
Real-Life Example
Think about a large hotel with hundreds of rooms. When a guest arrives at the front desk to check in, the receptionist asks for their name and reservation details. This is like the DHCP client sending a Discover message. The receptionist then looks at a computer screen showing which rooms are currently empty and ready for guests. That screen is the pool of available IP addresses. The receptionist picks a room, say room 305, and hands the guest a key card. This is the DHCP Offer, giving the guest a specific address and the key to access it.
The guest looks at the key card and decides to accept room 305. They say, “Yes, I will take room 305.” This is the DHCP Request. The receptionist then confirms by swiping the key card to activate it for that room and says, “You are now checked in. Your room is 305, breakfast is served from 7 to 10 in the restaurant on the ground floor, and the Wi-Fi password is on the card.” That final confirmation is the DHCP Acknowledgment. The guest now has a room number (IP address), instructions for the hallway maps (subnet mask), directions to the main exit (default gateway), and restaurant recommendations (DNS server addresses).
If the guest stays for three nights, the key card is programmed to work only until checkout time on the third day. That is the lease duration. On the second night, the guest might receive an automated call from the front desk asking if they want to extend their stay. That is like the DHCP renewal at 50 percent of the lease time. If the guest does not respond, the card stops working at checkout time, and the room is freed for the next guest. This ensures that every room is used efficiently. If two guests were accidentally given the same room number, chaos would ensue. DHCP prevents that by ensuring each device gets a unique address.
Why This Term Matters
In real IT work, DHCP is one of the most critical services for network connectivity. Without it, every device would require manual IP configuration, which is impractical for any network larger than a handful of devices. In a corporate environment with hundreds or thousands of computers, phones, printers, and IoT sensors, manual assignment would consume an enormous amount of time and be prone to human error. A single typo when entering an IP address could cause a conflict that takes down a segment of the network.
DHCP also simplifies network changes. If an organization needs to change its DNS server addresses, for example, the network administrator simply updates the DHCP server configuration. All clients that renew their leases will automatically receive the new DNS addresses. Without DHCP, the administrator would have to manually reconfigure every device on the network.
Security is another reason DHCP matters. Rogue DHCP servers can be installed by attackers to hand out malicious gateway or DNS addresses. For example, a rogue server could direct all web traffic to a fake login page to steal credentials. Network security features like DHCP snooping on Cisco switches can detect and block these rogue servers. Understanding DHCP client-server interactions is essential for troubleshooting connectivity issues. When a user cannot connect to the internet, a common first step is to check whether the client received a valid IP address from the DHCP server.
In cloud infrastructure, DHCP plays a role in virtual networks. When you spin up a virtual machine in AWS or Azure, it typically receives its IP address from a DHCP server managed by the cloud provider. This allows virtual machines to be provisioned automatically without manual networking configuration. DHCP is also used in home networks. Every home router has a built-in DHCP server that assigns addresses to smartphones, tablets, laptops, and smart TVs.
For system administrators and network engineers, DHCP reduces operational overhead, improves reliability, and provides centralized control over IP address management. It also integrates with Dynamic DNS (DDNS) to automatically update DNS records when a device receives a new IP address, making it easier to reach devices by hostname.
How It Appears in Exam Questions
In certification exams like CCNP ENARSI, DHCP appears in several question formats. The most common type is the scenario-based multiple-choice question. For example: A network administrator notices that clients on VLAN 10 are not receiving IP addresses from the DHCP server located on VLAN 20. The router interface connected to VLAN 10 is configured with an IP address and is operational. What is missing? The answer would be the ip helper-address command.
Another type is the configuration completion question. The exam might show a partial router configuration and ask which command completes the DHCP relay setup. The candidate must select the correct syntax from a list of options.
Troubleshooting questions often present output from debug ip dhcp server packet or show ip dhcp binding. A question might display that the DHCP server pool has 100 addresses but only 50 are in use, yet a new client fails to get an address. The candidate must realize that the client is on a different subnet and no relay agent is configured.
Simulation questions are also possible. In these, the candidate must configure a DHCP server on a Cisco router, including defining the pool, setting the default router, excluding certain addresses, and setting the lease time. These questions test both knowledge and the ability to apply it in a command-line interface.
Some questions focus on DHCP snooping. For instance: A switch is experiencing issues where clients intermittently receive incorrect IP addresses. Network logs show DHCP Offer messages from a device on port Fa0/5. Which configuration change should be implemented? The correct answer is to enable DHCP snooping and configure port Fa0/5 as an untrusted port, allowing only Discover and Request messages.
Lastly, some questions integrate DHCP with IPv6, asking candidates to differentiate between SLAAC (Stateless Address Autoconfiguration) and DHCPv6, and when each should be used. The exam may also ask about the role of the DHCP Unique Identifier (DUID) in DHCPv6 operations.
Study enarsi
Test your understanding with exam-style practice questions.
Example Scenario
A medium-sized company has three floors in its office building. Each floor has its own network segment: 192.168.10.0/24 on floor one, 192.168.20.0/24 on floor two, and 192.168.30.0/24 on floor three. The DHCP server is located on floor one. When an employee on floor two plugs their laptop into an Ethernet port, the laptop sends a DHCP Discover broadcast. Because the laptop is on a different subnet than the DHCP server, the router on floor two does not forward the broadcast. The laptop gets no response and shows an error that it cannot connect to the network.
The network administrator then configures the router on floor two with the ip helper-address command on the interface connected to floor two, pointing to the IP address of the DHCP server on floor one. Now, when the laptop sends a Discover broadcast, the router converts it into a unicast and forwards it directly to the DHCP server. The server responds with an Offer, which the router forwards back to the laptop. The laptop sends a Request, and the server sends an ACK. The laptop receives an IP address from the pool for the 192.168.20.0 network and can now access the internet and internal resources. The administrator has successfully solved the connectivity issue by implementing a DHCP relay agent.
Common Mistakes
Thinking that DHCP assigns the same IP address permanently to a device.
DHCP uses lease durations, not permanent assignments. The device must renew the lease periodically. If it does not, the address is returned to the pool and can be given to another device.
Understand that DHCP leases are temporary by default, though they can be set to very long durations. A device is not guaranteed the same address forever unless a reservation is configured.
Believing that a DHCP server always responds to a Discover with an Offer.
A DHCP server may not respond if it has no available addresses in its pool, if the client is on a different subnet without a relay agent, or if the server is configured to ignore requests from certain MAC addresses.
Always check the DHCP pool size, subnet configuration, and network connectivity between client and server when troubleshooting.
Confusing DHCP client broadcast messages with unicast behavior.
The initial Discover and Request messages are broadcast because the client does not yet know the server’s IP address. Some learners think all DHCP messages are unicast.
Remember that the first two steps of DORA (Discover and Request) are broadcast. Offer and ACK are typically unicast, but can be broadcast in some implementations.
Assuming that a router automatically forwards DHCP broadcasts across subnets.
Routers do not forward broadcasts by default. Without a helper address, a DHCP Discover broadcast will never reach a server on another subnet.
Configure the ip helper-address command on the router interface facing the client subnet to enable DHCP relay.
Exam Trap — Don't Get Fooled
An exam question states that a DHCP client received an Offer from a server, but the client then sends a DHCP Request as a unicast to that server. The question asks whether this is correct behavior. Remember that the DHCP Request in the DORA process is a broadcast.
It serves a dual purpose: accepting the chosen offer and silently declining any other offers. Only after the ACK is received does the client use unicast for renewal.
Commonly Confused With
ARP resolves IP addresses to MAC addresses on a local network, while DHCP assigns IP addresses to devices. ARP operates at layer 2 and layer 3, whereas DHCP operates at the application layer.
A device uses DHCP to get an IP address. Later, it uses ARP to find the MAC address of the default gateway to send traffic out of the network.
DNS translates human-readable domain names like example.com into IP addresses. DHCP provides the IP address itself, along with the DNS server address that the device should use for name resolution.
A computer gets 192.168.1.10 from DHCP. When the user types google.com, the computer asks the DNS server (provided by DHCP) for its IP address.
Static IP addressing requires an administrator to manually configure an IP address on each device. DHCP automates this process and centralizes management, reducing errors.
A server that must always have the same IP address for client access is configured with a static IP. A visitor’s laptop uses DHCP to get a temporary address.
Step-by-Step Breakdown
Step 1: DHCP Discover
The client sends a broadcast packet to 255.255.255.255 from source IP 0.0.0.0. This packet asks for any available DHCP server on the network. It includes the client’s MAC address so the server can respond.
Step 2: DHCP Offer
The DHCP server receives the Discover and replies with an Offer. This packet proposes an IP address, subnet mask, default gateway, DNS servers, lease time, and the server’s own identifier. The Offer is usually unicast to the client’s MAC address.
Step 3: DHCP Request
The client selects one Offer and sends a broadcast DHCP Request. The broadcast nature ensures that all other servers know their offers were declined. The Request includes the selected server’s identifier to avoid confusion.
Step 4: DHCP Acknowledgment
The selected server sends a DHCP ACK packet confirming the lease. The client then applies the configuration: IP address, subnet mask, default gateway, and DNS servers. If the server cannot fulfill the request, it sends a NAK and the client restarts.
Step 5: Lease Renewal
When 50% of the lease time expires, the client sends a unicast DHCP Request directly to the server that granted the lease. The server extends the lease by sending a new ACK. This renewal process is invisible to the user.
Step 6: Lease Rebinding
If the client does not receive a response from the original server after 87.5% of the lease time has passed, it broadcasts a DHCP Request to any server on the network. Any available server may respond and extend the lease.
Practical Mini-Lesson
In real-world networking, DHCP is not just about giving out IP addresses; it is about managing network resources efficiently and securely. As a network engineer, you need to understand both how to configure a DHCP server and how to troubleshoot it.
On a Cisco router, the basic configuration for a DHCP server starts with defining a pool. Enter global configuration mode and type ip dhcp pool LAN_POOL. Then specify the network and subnet mask, for example network 192.168.1.0 255.255.255.0. Next, define the default router with default-router 192.168.1.1, and optionally DNS servers with dns-server 8.8.8.8 8.8.4.4. Set the lease duration with lease 1 0 0 for one day, or lease infinite for a permanent lease if needed. To reserve addresses for static devices, use the ip dhcp excluded-address 192.168.1.1 192.168.1.10 command outside the pool configuration.
Troubleshooting is a vital skill. Use show ip dhcp binding to see which addresses are leased and to which MAC addresses. Use show ip dhcp pool to see pool utilization statistics. If a client is not getting an address, use debug ip dhcp server events to see if the server receives Discover messages. If the client is on a different subnet, verify that the ip helper-address command is correctly applied on the router interface of the client’s VLAN.
Security is also critical. DHCP snooping should be enabled on all access switches. On a Cisco switch, enter ip dhcp snooping globally, then ip dhcp snooping vlan 10,20,30 to enable it on specific VLANs. Configure trusted ports (usually uplinks to routers and other switches) with ip dhcp snooping trust. All other ports remain untrusted by default and will not forward Offer or ACK messages from any device plugged into them. This prevents a rogue DHCP server on an access port from distributing malicious addresses.
Another practical consideration is DHCP options. Option 150, for example, is used by Cisco IP phones to learn the IP address of a TFTP server for downloading configuration files. You can configure this with option 150 ip 10.0.0.5 inside the DHCP pool. Understanding options allows you to extend DHCP’s functionality for specialized devices.
Finally, DHCP works hand-in-hand with IP address management (IPAM) tools in larger enterprises. IPAM solutions track all IP addresses, subnets, and DHCP scopes, and can integrate with DNS to automatically update host records. This is known as Dynamic DNS (DDNS). When a DHCP client receives a new address, the DNS records are updated so that other devices can reach it by hostname. This is especially useful for servers and printers that change IP addresses but need to stay accessible.
Memory Tip
Remember the four steps of DORA: Discover, Offer, Request, Acknowledge. Think of a conversation: “Hello? (Discover) I have a room. (Offer) I want that one. (Request) You got it. (Acknowledge)”
Covered in These Exams
Related Glossary Terms
802.1Q is the networking standard that allows multiple virtual LANs (VLANs) to share a single physical network link by tagging Ethernet frames with VLAN identification information.
802.1X is a network access control standard that authenticates devices before they are allowed to connect to a wired or wireless network.
Two-factor authentication (2FA) is a security method that requires two different types of proof before granting access to an account or system.
An A record is a DNS record that maps a domain name to the IPv4 address of the server hosting that domain.
Frequently Asked Questions
What is the difference between a DHCP client and a DHCP server?
A DHCP client is a device that requests network configuration, while a DHCP server is a device that provides that configuration. The client asks for an IP address and the server gives one.
Can a device have both a static IP and DHCP?
No, a device can only use one method at a time per network interface. You can configure a DHCP reservation on the server so that the same IP is always given to that device, which combines the convenience of DHCP with the predictability of a static IP.
What happens if two DHCP servers exist on the same network?
Both servers may send offers. The client chooses one. To avoid problems, ensure that both servers have non-overlapping address pools or use DHCP snooping to control which server is trusted.
Why does my device show an IP address starting with 169.254.x.x?
This is an Automatic Private IP Addressing (APIPA) address. It means the device requested an IP from a DHCP server but did not receive a response. It assigns itself a random address to allow limited local communication.
How does a DHCP relay agent work?
A DHCP relay agent is a router or switch that forwards DHCP broadcast messages between different subnets. It receives the broadcast from the client and sends it as a unicast to a configured DHCP server IP address.
What is a DHCP lease time and how should I set it?
The lease time is how long a device can use an assigned IP address before it must renew. Set it shorter for networks with many transient devices (like guest Wi-Fi) and longer for stable networks with few changes.
Summary
DHCP client and server are fundamental to modern networking. The client is any device that needs an IP address, and the server is the central authority that assigns addresses along with other configuration details like subnet mask, default gateway, and DNS servers. The interaction follows the DORA process: Discover, Offer, Request, Acknowledge. This automated system eliminates manual IP configuration, reduces human error, and enables efficient use of address space through leases.
Understanding DHCP is critical for network certification exams, especially CCNP ENARSI, where topics like DHCP relay, DHCP snooping, and DHCPv6 are tested in detail. Exam questions often involve troubleshooting scenarios, configuration tasks, and security features. Common mistakes include misunderstanding broadcast versus unicast behavior and forgetting to configure helper addresses for remote subnets.
In real IT work, DHCP simplifies network management, supports IPAM integration, and improves security when combined with snooping. Whether in a small home office or a large enterprise data center, DHCP remains a core service that every network professional must master. Remember the DORA steps, practice configuration on Cisco routers and switches, and always consider security implications to prevent rogue server attacks.