DHCP and IPv6#
The third tab of DHCP, at /dhcp: the DHCPv6 server, and a link to the router
advertisements, which are edited on the IPv6 page.
IPv6 hosts usually need no DHCP server. They learn their prefix, their gateway and their DNS servers from router advertisements, and make their own addresses from the prefix (SLAAC). The DHCPv6 server is for the cases where that is not enough.
Router advertisements#
Router advertisements are edited in one place: Network → IPv6 → Router advertisements, beside the addresses and delegated prefixes they announce. This tab links there with Open router advertisements. The two switches there that matter to this tab are Addresses from DHCPv6 and Other settings from DHCPv6: they tell hosts to ask the server below.
The DHCPv6 server#
The table lists each DHCPv6 scope: subnet, network name, interface, pools, prefix delegation and the number of reservations. Add scope, or a click on a row, opens the form:
| Field | What it takes |
|---|---|
| Network name, Subnet | the scope's network; both fixed once created |
| Interface | the interface it answers on; otherwise the one connected to the subnet |
| Address pools | the first and last address of each pool |
| Prefix pools | a pool written as a network inside the subnet, such as 2001:db8:1::/80, instead of a first and last address |
| DNS servers, Search domains | handed to clients |
| Prefix delegation | a prefix, its length, and the length of each prefix handed to a downstream router |
| Lease time | in seconds |
| Reservations | a host name, the host's MAC address or DHCPv6 client ID (DUID), and the address it always gets |
A reservation's address must be inside the subnet, and no two reservations may share a name, a client or an address. A reservation can hold more than one address; the form shows the first, and leaves the others as they are. Renaming a reservation keeps what the form does not show, such as its own DNS servers.
A new scope is given the identifier the router requires, one more than any DHCPv6 scope or pending change already uses. The form warns when no interface of this router has an address in the subnet: the server answers only on a network the router is connected to. Delete scope asks first; deleting the only scope of a network removes the network, and the last scope turns the DHCPv6 server off.
There is no DHCPv6 lease table: the lease table on the IPv4 tab is the IPv4 server's.
When you need it at all#
Most IPv6 networks need none of it. Reach for DHCPv6 for:
- stateful addresses — a recorded, predictable address per host;
- prefix delegation — handing a shorter prefix to a router behind this one;
- options for hosts that ignore the DNS servers in advertisements.
Pair a scope with Addresses from DHCPv6 in the interface's router advertisement, or hosts never ask it.
What breaks if you get it wrong#
- Advertising
::/64on an interface with no IPv6 address. There is nothing to advertise; hosts get nothing. - Two routers advertising on one network. Hosts take addresses from both. Set the router lifetime to 0 on the one that should not be a gateway.
- Addresses from DHCPv6 with no DHCPv6 scope. Hosts ask, nothing answers, and depending on the client they fall back to SLAAC or end up with nothing.
- Removing an advertisement to turn IPv6 off. Hosts keep their addresses until the prefix's lifetime expires.
See also#
- DHCP — the IPv4 server, reservations and leases.
- DHCP relay — the second tab.
- IPv6 — addresses, router advertisements and prefix delegation.
- Addressing — putting an IPv6 address on the interface.
- DNS — the resolver whose address you advertise.