5.6. DHCP Client and Relay
đź’ˇ First Principle: DHCP uses broadcasts, but routers don't forward broadcasts. This creates a problem: how does a client on one subnet get an address from a DHCP server on a different subnet? DHCP relay (ip helper-address) solves this by converting the client's broadcast into a unicast directed at the DHCP server.
Consider this troubleshooting scenario: Users on a new floor report "no network connectivity." You check their laptops—they all have 169.254.x.x addresses. The DHCP server is working fine; other floors get addresses. What's different? The new floor is on a new VLAN with a new router interface. Someone forgot to configure ip helper-address. The clients are broadcasting requests, but those broadcasts never reach the DHCP server.
What happens without DHCP relay: A new laptop broadcasts "I need an IP address!" The local router receives this broadcast but drops it—routers don't forward broadcasts by design. The DHCP server on a central subnet never hears the request. The laptop falls back to APIPA (169.254.x.x), which means no routing, no connectivity beyond the local link.
Why centralized DHCP matters:
- Single source of truth: One DHCP server for the whole network, not one per subnet
- Easier management: Update DNS servers or lease times in one place
- IP address tracking: Logs show who had what address when (critical for security)
DHCP Relay Configuration:
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip helper-address 10.1.1.100
The relay agent:
- Receives DHCP broadcast on the interface
- Adds its interface IP to the gateway IP address (giaddr) field
- Forwards as unicast to the helper address
- Server uses giaddr to select the correct scope