IP Addresses and Services Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

PDF

IP Addresses and Services Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

How DHCP relay works

Want to summarize with AI?

Log in

This topic describes how a DHCP relay agent forwards a DHCP client broadcast to a DHCP server on another network segment on the Cisco 8000 Series Router.


DHCP clients use User Datagram Protocol (UDP) broadcasts to send DHCPDISCOVER messages when they lack information about the network to which they belong.

If a client is on a network segment that does not include a server, the network segment needs a relay agent. Presence of the relay agent ensures that DHCP packets reach the servers on another network segment. Routers do not forward UDP broadcast packets, because most routers are not configured to forward broadcast traffic. Configure a DHCP relay agent to forward DHCP packets to a remote server. Configure a DHCP relay profile on the DHCP relay agent and configure one or more helper addresses in it. Assign the profile to an interface or a VRF.

Summary

The key components involved in DHCP relay are:

  • DHCP client: Broadcasts a request for an IP address and other configuration parameters on its local LAN.

  • DHCP relay agent: A router that picks up the client broadcast, inserts the gateway address (giaddr) in the DHCP packet, and unicasts the message to the DHCP server specified by the helper address in the relay profile.

  • DHCP server: Receives the relayed message and uses the giaddr to determine which subnet receives the offer and to identify the appropriate IP address range.

The relay agent unicasts messages to the server address specified by the helper address in the relay profile, so that DHCP packets can traverse routed segments between the client and the server.

Workflow

Figure 1. Forward UDP broadcasts to a DHCP server using a helper address

These stages describe how a DHCP relay agent forwards packets between the client and the server:

  1. The DHCP client broadcasts a request for an IP address and other configuration parameters on its local LAN.

  2. Acting as a DHCP relay agent, Router B picks up the broadcast and inserts the IP address of the interface that receives the DHCP client's packets into the gateway address (giaddr) field of the DHCP packet.

  3. The relay agent changes the destination address to the DHCP server's address and sends the message out on another interface. It unicasts the message to the server address (in this case, 172.16.1.2), which is specified by the helper address in the relay profile.

  4. The DHCP server uses the giaddr to determine which subnet receives the offer and to identify the appropriate IP address range.