Relay DHCP to another network#
You will end up with the router passing DHCP requests from one or more networks to a server somewhere else. DHCP discovery is a broadcast and broadcasts do not cross a router, so a central DHCP server needs a relay on every network it serves.
Before you start#
- The operator role and a licence.
- The server's address, reachable from the router.
- Which interfaces have clients, and which interface faces the server.
- No DHCP scope on the router for those networks. A relay and a server on the same network race each other.
Step 1 — Turn on the relay#
Services → DHCP, Relay tab, Turn on the DHCP relay.
- Under Listen on, tick every interface with clients — VLANs are listed like any other.
- Under Forward out of, tick the interface the server is reached through.
- Add the server under DHCP servers; more than one is allowed.
- Save changes, and apply.
Step 2 — Let the traffic through#
The relay talks to the server on UDP 67, from the router. If your firewall is narrow, the router must be able to reach the server and the server must be able to answer.
Step 3 — Make the server route back#
The server needs a route to each relayed network, and a scope for each. That is configuration on the server, not on the router. Without it the relay works, the request arrives, and the server has no scope for the network it came from.
Check it worked#
A client on a relayed network gets a lease, from the central server's range rather than anything local. On the server, the lease shows the relay's address as the relay agent, which is how the server chose the scope. The Logs page shows the relay's own messages.
Undoing it#
Edit → Turn off on the Relay tab, or Disabled to keep the settings. Everything on a relayed network loses addressing at its next renewal, so have the replacement ready.
See also#
- Give a device the same address every time — the local server case
- Add a VLAN — the usual reason to want a relay
- DHCP relay