Follow a DHCP request from a client VLAN to its DHCP server
Contents
A DHCP relay passes local DHCP requests to a server on another subnet. It is useful when several VLANs share a central DHCP server. In a basic IPv4 setup, the relay also gives the server information about the client's subnet so the server can choose the right address pool.
Follow an IPv4 request across two subnets
A new client can broadcast a DHCPDISCOVER before it has an address. The relay on the client-facing network receives it, adds its relay address in the giaddr field, and forwards the request to the configured DHCP server. In the simple case described by RFC 2131, the server uses that field to determine which subnet to allocate from. It sends its response back through the relay.
Consider a client on VLAN 20 with subnet 192.168.20.0/24. Its relay interface is 192.168.20.1. A DHCP server at 192.168.10.5 is on a different subnet and has a scope for VLAN 20 with addresses 192.168.20.100 through 192.168.20.149.
| Point in the exchange | What you expect |
|---|---|
| Client-facing network | A DHCP discovery from the new client reaches the relay. |
| Request reaching the server | The relay address is 192.168.20.1 in this example. |
| Server pool choice | The server offers an available address from the VLAN 20 scope. |
| Reply reaching the client | The server sends the response to the relay, which delivers it on VLAN 20. |
The server's own address is on a different subnet. The client's CIDR prefix is what makes the offered address part of VLAN 20's network.
Decide whether you need a relay
If the DHCP server already serves requests directly on the client subnet, no relay is needed for that subnet. A small router often serves local DHCP itself. In a separate-VLAN design, the relay generally runs on the router or Layer 3 switch facing the client network. Cisco IOS XE is one example that configures a helper address on that interface.
Check the path when one VLAN cannot get a lease
Verify the client's VLAN first. Then confirm that the receiving interface has a relay configured for the intended server. Check that the relay and server can reach each other as permitted by the network policy. On the server, verify a matching scope with available leases. If the server can offer an address, check whether the reply returns through the relay to the client.
Frequently asked questions
Does the relay lease addresses?
The DHCP server chooses and manages the lease. The relay handles communication between the client network and server.
Is the relay address always the client’s default gateway?
The same device often provides both functions. Clients learn their gateway from the DHCP configuration or a manual setting.