DHCPv4 relay agent

Hop count in DHCP requests

When a DHCP client broadcasts requests, the DHCP relay agent in the routing switch receives the packets and forwards them to the DHCP server as unicast requests. During this process, the DHCP relay agent increments the hop count before forwarding DHCP packets to the server. The DHCP server, in turn, includes the hop count in DHCP header from the received DHCP request in the response sent back to a DHCP client.

DHCP relay option 82

Option 82 is called the relay agent information option. The option 82 field is inserted/replaced or the packet with this option is dropped by the DHCP relay agent, when forwarding client-originated DHCP packets to a DHCP server. Servers recognizing the relay agent information option may use the information to implement an IP address or other parameter assignment policies. The relay agent relays the server-to-client replies to the client. This feature allows the second relay agent to encapsulate option 82 information in a received message from the first relay agent if the second relay agent is configured to add its own option 82 information. The DHCP server can use option 82 information from both relay agents in deciding IP for the client.

The reply message from the DHCP server reaches the DHCP client via the relay agents.

Configuring a BOOTP/DHCP relay gateway

The DHCP relay agent selects the lowest-numbered IP address on the interface to use for DHCP messages. The DHCP server then uses this IP address when it assigns client addresses. However, this IP address may not be the same subnet as the one on which the client needs the DHCP service. This feature provides a way to configure a gateway address for the DHCP relay agent to use for relayed DHCP requests, rather than the DHCP relay agent automatically assigning the lowest-numbered IP address.