DHCP#
Services → DHCP, at /dhcp. Three tabs: IPv4, Relay and IPv6, plus
CLI in Advanced mode. This page documents the IPv4 tab. Relay and
IPv6 have pages of their own.
The IPv4 tab shows the scopes, the server's own settings, the reservations and the live leases. Everything but the leases can be changed from it. Like every editor in the product, a form adds to the pending changes, and nothing reaches the router until you apply them from the bar at the bottom of the page.
Scopes#
A scope is one network the server hands addresses out on: its subnet, the pools the addresses come from, how long a lease lasts, and the options clients are given with an address. The Scopes table lists each one with its network name, pools, lease time, default router, DNS servers and number of reservations; a scope turned off carries Off.
A router with no DHCP server shows No DHCP scopes and the button that adds the first.
The scope form#
Add scope, or a click on a scope, opens the form:
| Field | What it takes |
|---|---|
| Network name | the name scopes on one network segment share, such as LAN |
| Subnet | the network, such as 192.0.2.0/24, written as its network address |
| Description | |
| Address pools | the first and last address of each pool; a scope has one or more, and none may overlap |
| Lease time | in seconds, shown as hours or days beside the field; 1 day when unset |
Handed to clients:
| Field | What it is |
|---|---|
| Default router | the gateway clients use, usually this router's address on the network |
| Domain name | the domain clients add to short names |
| DNS servers | usually this router's address, when it runs the resolver |
| Search domains | domains clients try short names in |
| Time servers | NTP servers |
| TFTP server, Boot server, Boot file | network boot (PXE): the server to load from and the file to load |
| Proxy auto-configuration URL | where browsers find a proxy configuration (WPAD) |
| Client MTU | the MTU clients set on their interface |
| Time zone | the zone clients set, by name |
| UniFi controller | where Ubiquiti access points find their controller |
| Routes | networks reached through a gateway other than the default router |
Other options lists anything else the scope hands out that the form has no field for, each with Remove. When the network the scope belongs to has options of its own, they are edited under Handed to every scope in network ….
Two switches close the form: Check that an address is free, which has the router ping an address before offering it, and Disabled, which keeps the scope and hands out nothing from it.
Saving, and what the router checks#
Save changes sends the form to the agent, which works out the change against the router's configuration as it stands and stages it:
- A new scope is given the identifier the router requires of every subnet, one more than any it or a pending change already uses. You never type it.
- An edit changes only the fields you changed. Reservations, a pool's own settings and options the form does not show are not touched.
- A new subnet or network name moves the scope. Every reservation and every setting the form does not manage goes with it, and the old scope is removed in the same change. A new subnet that would leave a reservation outside it is refused, naming the reservations.
- Delete scope asks first, saying how many reservations go with it. Deleting the only scope of a network removes the network, and deleting the last scope turns the DHCP server off, because the router refuses either one empty.
Anything the agent refuses is said under the form, in the field's terms: an overlapping subnet, a pool outside the subnet, a pool that ends before it starts. Some things the router would accept are worth reading first — a subnet no interface of this router has an address in, a pool that includes the router's own address — and the form shows them before Save anyway.
Server settings#
The panel shows whether the server is on and whether client names go into DNS. Edit changes both:
- Add client names to DNS: a device that sends its name when it takes a lease can then be looked up by that name through the router's resolver. The names are added as leases are taken, so a device appears after its next renewal.
- Disabled: the server stops handing out addresses. Its scopes and reservations stay, and turning it on again brings them back as they were. To remove the server entirely, delete its last scope.
Reservations#
A reservation gives a device the same address every time it asks. The table:
| Column | What it shows |
|---|---|
| Name | the reservation's name |
| IP address, MAC address | the pair |
| Scope | the subnet it is in |
| Options | options the reservation hands out in place of the scope's |
| Lease | Active when the lease table holds a lease for the address |
A reservation with no Active mark is one no device has taken up — a typo in the MAC, a device that has not asked since, or one that has left.
The Filter box narrows the reservations and the leases at once.
Add reservation, or a click on a reservation, opens its form: the scope, the name, the IP address and the MAC address. The address must be inside the scope, and neither it nor the MAC may belong to another reservation in the scope; the form says which one holds it. Delete reservation asks first.
A reservation found with the search palette (⌘K) opens the same form. Two scopes can each
have a reservation of the same name, so a link names the scope as well as the reservation:
/dhcp?network=LAN&subnet=192.0.2.0/24&mapping=nas. A link with the name alone opens the
first reservation of that name.
Leases#
The live lease table, refreshed every few seconds:
| Column | What it is |
|---|---|
| IP address | the leased address |
| MAC address | the device holding it |
| Host name | the name the device sent, when it sent one |
| State | active, or the server's word for the lease's state |
| Remaining | how long the lease has left |
| Network | the network name of the scope it came from |
A click on a lease opens New reservation filled in from it: pin a device to the address it already has by giving it a name.
Pending changes#
The Commit Bar lists what the editors staged as sentences: Change the lease time of DHCP scope 10.0.0.0/16 to 1 day, Add reservation “nas” — 192.0.2.10, 00:53:00:12:34:56, Add DHCP clients’ names to DNS. A moved scope reads as the new scope, its reservations and the old scope removed. In Advanced mode the scope form shows the commands the agent planned, and the CLI tab shows the whole of the DHCP server as the router's commands.
What breaks if you get it wrong#
- A default router that is not this router's address on the network. Clients get addresses and cannot leave the network.
- DNS servers the resolver does not answer on. Names stop resolving and it looks like a DHCP fault — see DNS.
- A pool that includes a VRRP virtual address. The address handed to a client breaks the pair. Keep it out of every pool — see VRRP.
- A relay and a server on the same interface. They cannot share one — see DHCP relay.
- A new reservation for a device that already has a lease. It keeps its old address until the lease is renewed; restart the device or wait.
Worked example: pin the NAS to a fixed address#
The NAS has a lease of 192.0.2.187. It should keep 192.0.2.10.
- Services → DHCP, IPv4 tab. Find the NAS in Leases — the filter takes a MAC prefix — and click it.
- The form has its MAC address and current address. Name it
nas, change the IP address to192.0.2.10, and Add reservation. - Apply the changes. The reservation appears with no Active mark, because the NAS still holds its old lease.
- Restart the NAS, or wait for its lease to renew. The reservation shows Active and the
lease table shows
192.0.2.10.
App integrations#
Installed apps can offer configuration for this page — a DNS or ad-filtering container
suggesting itself as a scope's DNS server, for instance. The offers appear between the page
header and the tabs, and only when an app that declares a hint for the dhcp page is
installed. An offer may carry placeholders — the network name and the subnet among them —
which are filled from this router's own configuration before the offer is shown; the full
list is on Integration offers.
See also#
- DHCP relay — forwarding requests to a server somewhere else.
- DHCP and IPv6 — router advertisements and DHCPv6.
- DNS — the resolver whose address the scope usually hands out.
- Neighbours — the other list of who is on the network.
- Addressing — the router's own address on the network being served.