📘 CCNA 200-301 v1.1
4.6 Configure and Verify DHCP Client and Relay
1. What is DHCP?
- DHCP stands for Dynamic Host Configuration Protocol.
- Its main job is to automatically assign IP addresses to devices on a network so they can communicate.
- Without DHCP, every device would need a manual IP configuration (which is slow and error-prone).
Think of DHCP as an automatic address manager in a network.
2. DHCP Client
- A DHCP client is any device that requests an IP address from a DHCP server.
- Examples: computers, laptops, routers, switches (if configured as clients).
How it works (step by step)
- DHCP Discover:
- The client doesn’t have an IP yet. It broadcasts a message asking if there’s a DHCP server on the network.
- DHCP Offer:
- Any DHCP server that receives the discover message offers an IP address to the client.
- DHCP Request:
- The client chooses one offer and asks the server to assign it that IP.
- DHCP Acknowledgment (ACK):
- The server confirms the assignment and sends details like:
- IP address
- Subnet mask
- Default gateway
- DNS server
- The server confirms the assignment and sends details like:
This whole process is called the DORA process: Discover → Offer → Request → Acknowledge.
3. Configuring a DHCP Client on a Cisco Device
On routers or switches, you can set an interface to request an IP from a DHCP server.
Command example:
interface GigabitEthernet0/0
ip address dhcp
no shutdown
ip address dhcp→ Makes the interface a DHCP client.no shutdown→ Turns the interface on.
Verify DHCP client assignment:
show ip interface brief
show dhcp lease
These commands confirm the IP assigned to the interface by DHCP.
4. DHCP Relay
- Sometimes, a DHCP server is not on the same network as the client.
- Routers do not forward broadcasts by default, so a DHCP request cannot reach a server on a different network.
- DHCP Relay solves this problem.
Function:
- Receives DHCP requests from clients.
- Forwards them to a remote DHCP server using unicast.
- Sends the server’s response back to the client.
When is DHCP relay used?
- Large networks with multiple subnets where one DHCP server serves many networks.
5. Configuring DHCP Relay on a Cisco Device
- Use the command
ip helper-addresson the router interface facing the client subnet. - Example:
interface GigabitEthernet0/1
ip address 192.168.10.1 255.255.255.0
ip helper-address 192.168.1.100
no shutdown
192.168.10.1→ Router interface in client’s subnet.ip helper-address 192.168.1.100→ IP of the remote DHCP server.
Verify DHCP relay:
show ip dhcp binding
show running-config
6. Key Exam Points to Remember
- DHCP Client:
- Requests an IP from DHCP server automatically.
- Use
ip address dhcpto configure on Cisco interfaces. - Verify using
show ip interface briefandshow dhcp lease.
- DHCP Relay:
- Forwards client requests to a DHCP server on another subnet.
- Configured with
ip helper-addresson the router interface. - Verify with
show running-configorshow ip dhcp binding.
- DORA Process: Discover → Offer → Request → Acknowledge.
- DHCP relay only forwards certain UDP ports:
- Port 67 for server, 68 for client (standard DHCP ports).
✅ Summary Table:
| Feature | Purpose | Cisco Command | Verification |
|---|---|---|---|
| DHCP Client | Auto-assign IP to interface | ip address dhcp | show ip interface brief |
| DHCP Relay | Forward DHCP requests to remote server | ip helper-address <server-IP> | show running-config |
