DHCP Relay Agents
Bridging the Broadcast Boundary
The Broadcast Dilemma
When a host boots up and requests an IP address (DHCPDISCOVER), it sends a broadcast to . By design, routers do not forward broadcasts. Without a relay agent, you would need a DHCP server physically connected to every single subnet in the building—an administrative and security nightmare.
DHCP Relay Transaction
Broadcast Domain Bridging
Internal Header Modification: GIADDR
How does a central server know which subnet a relay request came from? The relay agent modifies the DHCP header, inserting its own IP address into the GIADDR (Gateway IP Address) field.
- The server examines the GIADDR.
- It matches the GIADDR to a corresponding scope (pool).
- It selects an available IP from that specific subnet to offer to the client.
DHCP Option 82: The Relay Agent Information Option
In large ISP or campus environments, the server needs more than just the subnet; it needs to know exactly which physical port the request came from. Option 82 allows the relay agent to attach circuit-level metadata:
- Agent Circuit ID: Identifies the VLAN and physical port on the access switch.
- Agent Remote ID: Identifies the specific relay agent's MAC address or name.
The Return Path
The DHCP server sends the DHCPOFFER back as a unicast to the Relay Agent's IP (the GIADDR). The relay agent then strips the encapsulation and broadcasts the offer onto the local VLAN, where the client can receive it.
Modern implementations use Unicast replies (if the client supports it) to reduce noise in the subnet, but the Relay Agent remains the critical state-tracking anchor in the middle of the exchange.