Configure and verify DHCP client and relay

📘 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)

  1. DHCP Discover:
    • The client doesn’t have an IP yet. It broadcasts a message asking if there’s a DHCP server on the network.
  2. DHCP Offer:
    • Any DHCP server that receives the discover message offers an IP address to the client.
  3. DHCP Request:
    • The client chooses one offer and asks the server to assign it that IP.
  4. DHCP Acknowledgment (ACK):
    • The server confirms the assignment and sends details like:
      • IP address
      • Subnet mask
      • Default gateway
      • DNS server

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-address on 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

  1. DHCP Client:
    • Requests an IP from DHCP server automatically.
    • Use ip address dhcp to configure on Cisco interfaces.
    • Verify using show ip interface brief and show dhcp lease.
  2. DHCP Relay:
    • Forwards client requests to a DHCP server on another subnet.
    • Configured with ip helper-address on the router interface.
    • Verify with show running-config or show ip dhcp binding.
  3. DORA Process: Discover → Offer → Request → Acknowledge.
  4. DHCP relay only forwards certain UDP ports:
    • Port 67 for server, 68 for client (standard DHCP ports).

Summary Table:

FeaturePurposeCisco CommandVerification
DHCP ClientAuto-assign IP to interfaceip address dhcpshow ip interface brief
DHCP RelayForward DHCP requests to remote serverip helper-address <server-IP>show running-config

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee