What is a DHCP (Dynamic Host Configuration Protocol) relay agent, and why is it needed?
A DHCP relay agent forwards DHCP broadcast messages from clients to a DHCP server on a different subnet, because routers don't forward broadcasts.
* DHCP relay across subnets via ip helper-address. *
* Relayed DORA (Discover, Offer, Request, Acknowledge) message flow through R1. *
* A DHCP relay agent forwarding across subnets. — Gmelander, CC BY-SA 4.0, via Wikimedia Commons. *
The problem:
- DHCP clients use broadcast messages (DHCPDISCOVER) to find a server
- Routers do not forward broadcasts between subnets
- If the DHCP server is on a different subnet, the client's discover message never reaches it
The solution — ip helper-address:
Configure the router interface facing the clients to relay DHCP broadcasts to the server's IP (Internet Protocol):
R1(config)# interface g0/0/0
R1(config-if)# ip helper-address 192.168.11.6
How it works:
- Client broadcasts DHCPDISCOVER on its local subnet
- Router (relay agent) receives the broadcast on g0/0/0
- Router converts it to a unicast and forwards it to 192.168.11.6
- DHCP server processes the request and responds (via the relay)
- Router forwards the response back to the client
Verify with: show ip interface g0/0/0 — look for the "Helper address" line.
Tip: The helper-address goes on the client-facing interface, not the server-facing one. Think: "where do the broadcasts arrive?"
Go deeper:
DHCP — relaying (Wikipedia) — how a relay converts client broadcasts to unicast and uses giaddr to identify the subnet.
RFC 2131 §4 — BOOTP relay agents and giaddr — the normative forwarding behaviour between client subnet and remote server.