22.7. Planning IPv6 Address Services

IPv6 repeats every question from Section 22.1 with different mechanics: the address is four times wider, the client can configure itself without any server at all, and the router - not the DHCP server - is the authority on how hosts should behave. The plan decides who provides addresses, and one router advertisement field answers it.

22.7.1. Router Advertisements, SLAAC, and DHCPv6 Roles

A Linux host with IPv6 enabled listens on every link for router advertisements (RA), the periodic and solicited ICMPv6 messages routers send. One RA carries several decisions at once, and three fields choose the whole provisioning model:

RA content Meaning Client behavior
M (Managed) flag a DHCPv6 server holds the addresses clients run DHCPv6 stateful: request an address lease
O (Other config) flag a DHCPv6 server holds options only clients without addresses to fetch run DHCPv6 stateless: request options, keep SLAAC addresses
Prefix with A (Autonomous) flag hosts may self-assign from this prefix SLAAC: the host generates its own address from the prefix plus its interface identifier

The three models those fields produce:

Model Addresses from Options from Server keeps lease state
SLAAC only (A, no M) each host itself the RA's RDNSS/DNSSL options none
SLAAC + stateless DHCPv6 (A, O) each host itself DHCPv6 none
Stateful DHCPv6 (M) DHCPv6 leases DHCPv6 yes, per client DUID

SLAAC is the native IPv6 model - zero configuration, no server state, the reason most IPv6 networks "just work" when a router first advertises. DHCPv6 earns its place when something needs the lease record: address accounting, the DDNS chain of Section 22.6.3, or options the RA cannot carry. The practice network runs the mixed lab configuration - M, O, and A all set - so one exercise shows both paths a host can take; production guidance is to pick one address source and advertise it deliberately, because hosts that hold both a SLAAC address and a DHCPv6 address will use both unpredictably. Chapter 17 covered this from the client side - Figure 17.2 there shows what one advertisement produces on a host - and this chapter's subject is the router that sends it.

One Linux prerequisite shapes the whole section: a host only sends router advertisements when IPv6 forwarding is enabled on it. The router role and the forwarding decision are the same kernel switch - net.ipv6.conf.all.forwarding=1 on the advertising host, with persistent configuration in Chapter 19's vocabulary.

22.7.2. Providing DHCPv6 Configuration with Kea

The DHCPv6 service is the same Kea daemon family already installed. Its configuration, /etc/kea/kea-dhcp6.conf on ns1:

# /etc/kea/kea-dhcp6.conf - DHCPv6 for the practice LAN
{
  "Dhcp6": {
    "interfaces-config": { "interfaces": [ "eth1" ] },
    "control-socket": {
      "socket-type": "unix",
      "socket-name": "/run/kea/kea6-ctrl-socket"
    },
    "lease-database": {
      "type": "memfile",
      "persist": true,
      "name": "kea-leases6.csv",
      "lfc-interval": 300
    },
    "valid-lifetime": 1800,
    "preferred-lifetime": 1200,
    "renew-timer": 900,
    "rebind-timer": 1350,
    "subnet6": [
      {
        "id": 1,
        "subnet": "fd22:232::/64",
        "interface": "eth1",
        "pools": [ { "pool": "fd22:232::1000 - fd22:232::10ff" } ],
        "option-data": [
          { "name": "dns-servers", "data": "fd22:232::53" }
        ],
        "pd-pools": [
          { "prefix": "fd22:230::", "prefix-len": 56, "delegated-len": 64 }
        ]
      }
    ],
    "loggers": [
      {
        "name": "kea-dhcp6",
        "output_options": [
          { "output": "/var/log/kea/kea-dhcp6.log", "pattern": "%d %-5p %m\n" }
        ],
        "severity": "INFO",
        "debuglevel": 0
      }
    ]
  }
}

Structurally the IPv4 file again, with IPv6's differences: a subnet6 under the ULA prefix fd22:232::/64, an address pool from ::1000 to ::10ff, the IPv6 resolver option (dns-servers carries fd22:232::53), preferred and valid lifetimes in place of the single IPv4 lifetime - and one block IPv4 has no counterpart for: pd-pools, prefix delegation, Section 22.7.4's subject. The resolver option lists one address; a production network publishes a second IPv6 resolver beside it, exactly as the IPv4 lease carries its pair - the single address here is the lab economy Section 22.1.3 flagged. Validate exactly as before - as john on ns1:

$ sudo -u _kea /usr/sbin/kea-dhcp6 -t /etc/kea/kea-dhcp6.conf 2>&1 | tail -3
2026-11-22 11:16:07.100 INFO  [kea-dhcp6.dhcpsrv/25713.140591352616896] DHCPSRV_CFGMGR_NEW_SUBNET6 a new subnet has been added to configuration: fd22:232::/64 with params: t1=900, t2=1350, preferred-lifetime=1200, valid-lifetime=1800, rapid-commit is false
2026-11-22 11:16:07.100 INFO  [kea-dhcp6.dhcpsrv/25713.140591352616896] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw
2026-11-22 11:16:07.100 INFO  [kea-dhcp6.dhcpsrv/25713.140591352616896] DHCPSRV_CFGMGR_ADD_IFACE listening on interface eth1

The same validation gate, IPv6 edition: the subnet parsed with its timers, and listening on interface eth1 confirmed. The 2>&1 merge in the invocation is how Kea's log lines - which the daemon writes to its standard error - land in the terminal together; the tail -3 trims the routine startup banner. Start the service as root (systemctl restart kea-dhcp6-server, silent) and observe what it opened, in a root shell on ns1:

# ss -lunp | grep -E 'kea-dhcp|:67|:547|:53001'
UNCONN 0      0                      192.168.232.10:57253      0.0.0.0:*    users:(("kea-dhcp4",pid=25163,fd=21))    
UNCONN 0      0                      192.168.232.10:67         0.0.0.0:*    users:(("kea-dhcp4",pid=25163,fd=24))    
UNCONN 0      0                           127.0.0.1:53001      0.0.0.0:*    users:(("kea-dhcp-ddns",pid=25162,fd=13))
UNCONN 0      0      [fe80::5054:ff:fe78:e820]%eth1:547           [::]:*    users:(("kea-dhcp6",pid=25164,fd=15))    
UNCONN 0      0                    [ff02::1:2]%eth1:547           [::]:*    users:(("kea-dhcp6",pid=25164,fd=16))    

The whole DHCP suite's listening surface in one filter: DHCPv4 on .10:67; the DDNS service on loopback :53001; the anonymous .10:57253 socket is the DDNS sender Kea's IPv4 side binds (sender-ip from Section 22.5.1, given an ephemeral port); and DHCPv6 on :547 twice - once bound to the link-local address fe80::... and once to the ff02::1:2 multicast group, which is how a DHCPv6 server is found: clients send Solicit to the All_DHCP_Relay_Agents_and_Servers multicast group on the link, not to a broadcast address, and the server's reply names the client's link-local address.

The client exchange differs from IPv4 in every one of those mechanics - on lanclient, as john:

$ sudo dhclient -6 -1 -v eth1
Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on Socket/eth1
Sending on   Socket/eth1
Created duid "\000\001\000\0012\225\213yRT\000dz7".
PRC: Soliciting for leases (INIT).
XMT: Forming Solicit, 0 ms elapsed.
XMT:  X-- IA_NA 00:64:7a:37
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Solicit on eth1, interval 1050ms.
RCV: Advertise message on eth1 from fe80::5054:ff:fe78:e820.
RCV:  X-- IA_NA 00:64:7a:37
RCV:  | X-- starts 1795346170
RCV:  | X-- t1 - renew  +900
RCV:  | X-- t2 - rebind +1350
RCV:  | X-- [Options]
RCV:  | | X-- IAADDR fd22:232::1000
RCV:  | | | X-- Preferred lifetime 1200.
RCV:  | | | X-- Max lifetime 1800.
RCV:  X-- Server ID: 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b
RCV:  Advertisement recorded.
PRC: Selecting best advertised lease.
PRC: Considering best lease.
PRC:  X-- Initial candidate 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b (s: 10104, p: 0).
XMT: Forming Request, 0 ms elapsed.
XMT:  X-- IA_NA 00:64:7a:37
XMT:  | X-- Requested renew  +3600
XMT:  | X-- Requested rebind +5400
XMT:  | | X-- IAADDR fd22:232::1000
XMT:  | | | X-- Preferred lifetime +7200
XMT:  | | | X-- Max lifetime +7500
XMT:  V IA_NA appended.
XMT: Request on eth1, interval 990ms.
RCV: Reply message on eth1 from fe80::5054:ff:fe78:e820.
RCV:  X-- IA_NA 00:64:7a:37
RCV:  | X-- starts 1795346171
RCV:  | X-- t1 - renew  +900
RCV:  | X-- t2 - rebind +1350
RCV:  | X-- [Options]
RCV:  | | X-- IAADDR fd22:232::1000
RCV:  | | | X-- Preferred lifetime 1200.
RCV:  | | | X-- Max lifetime 1800.
RCV:  X-- Server ID: 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b
PRC: Bound to lease 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b.

Every DHCPv4 message has its IPv6 counterpart and a new name: Solicit (DISCOVER), Advertise (OFFER), Request, Reply (ACK). The differences that matter:

  • The server was found by multicast - fe80::5054:ff:fe78:e820 is ns1's link-local address, the IPv6 way to reach a neighbor without any global address configured.
  • The client is identified by its DUID (Created duid ...), not its link address - the same client identity across interfaces and reboots, which is what DHCPv6 lease state keys on.
  • The lease is an IA_NA (identity association, non-temporary address) with two lifetimes: preferred (1200 s - the address is deprecated after this) and valid (1800 s - it stops working after this). Deprecation is IPv6's replacement for the abrupt IPv4 expiry: new connections avoid the address, old ones keep working to the bitter end.
  • The client asked for longer lifetimes (7200/7500) and the server granted its configured ones (1200/1800) - policy stays server-side, same as IPv4.

The address is on the interface, with the /128 that DHCPv6 addresses carry:

$ ip -6 addr show eth1 | grep fd22:232::1000
    inet6 fd22:232::1000/128 scope global dynamic

Note for production clients: dhclient -6 here is the same deprecated ISC client from the IPv4 sections, invoked explicitly. Desktop and NetworkManager hosts run their own DHCPv6 client and react to the RA's M flag automatically - the explicit invocation is the lab's way of showing the protocol without touching the client's network manager.

22.7.3. Advertising Gateways and DNS Information

The router advertisement itself comes from radvd, the Router Advertisement Daemon. Its configuration on ns1, /etc/radvd.conf:

# /etc/radvd.conf - advertise the practice LAN's IPv6 defaults
interface eth1 {
    AdvSendAdvert on;
    MinRtrAdvInterval 5;
    MaxRtrAdvInterval 15;
    AdvManagedFlag on;
    AdvOtherConfigFlag on;
    prefix fd22:232::/64 {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr off;
    };
    RDNSS fd22:232::53 {
        AdvRDNSSLifetime 30;
    };
    DNSSL handbook.test {
        AdvDNSSLLifetime 30;
    };
};

Read against Section 22.7.1's table: AdvManagedFlag on sets M, AdvOtherConfigFlag on sets O, and the prefix block's AdvAutonomous on sets A - the mixed lab configuration, all three provisioning models offered at once. The gateway itself is implicit: the sender of the RA is the default router, and the advertisement's router lifetime says how long clients may keep using it - here the RA's default 45 seconds at these intervals, so a dead router is forgotten within a minute. RDNSS carries the IPv6 resolver address and DNSSL the search domain, the IPv6 equivalent of DHCP options 6 and 15 - with deliberately short 30-second lifetimes, so a changed resolver propagates within half a minute. Install and start - as root on ns1:

# apt install radvd
# systemctl restart radvd

The restart prints nothing; the advertiser begins sending on eth1. The client-side check below uses rdisc6, which a default installation does not carry - as root on lanclient:

# apt install ndisc6

The one-liner that shows exactly what hosts receive - on lanclient, as john:

$ rdisc6 -1 eth1
Soliciting ff02::2 (ff02::2) on eth1...

Hop limit                 :           64 (      0x40)
Stateful address conf.    :          Yes
Stateful other conf.      :          Yes
Mobile home agent         :           No
Router preference         :       medium
Neighbor discovery proxy  :           No
Router lifetime           :           45 (0x0000002d) seconds
Reachable time            :  unspecified (0x00000000)
Retransmit time           :  unspecified (0x00000000)
 Prefix                   : fd22:232::/64
  On-link                 :          Yes
  Autonomous address conf.:          Yes
  Valid time              :        86400 (0x00015180) seconds
  Pref. time              :        14400 (0x00003840) seconds
 Recursive DNS server     : fd22:232::53
  DNS server lifetime     :           30 (0x0000001e) seconds
 DNS search list          : handbook.test
  DNS search list lifetime:           30 (0x0000001e) seconds
 Source link-layer address: 52:54:00:78:E8:20
 from fe80::5054:ff:fe78:e820

rdisc6 -1 sends one Router Solicitation and prints the advertisement that answers it - the same file, decoded line by line: Stateful address conf. Yes and Stateful other conf. Yes are the M and O flags; the prefix block shows Autonomous address conf. Yes (A) with its own valid and preferred times - 24 hours and 4 hours, far longer than the DHCPv6 lease's, so SLAAC addresses are the stable ones here; and the RDNSS/DNSSL pairs carry the resolver and search list with their 30-second lifetimes. With this advertisement on the wire, a native IPv6 host configures itself: SLAAC address from the prefix, default route toward the RA's sender, resolver address and search domain installed. The chapter's own resolver checks ran over IPv4; the RDNSS path is the one an IPv6-only client would take, and its two records - the resolver's IPv6 address and the search domain - are the same information Section 22.2.3 put in the forwarders' configuration.

22.7.4. Prefix Delegation and Address Plan Changes

Prefix delegation (PD) is DHCPv6's answer to a question IPv4 answers with NAT: a downstream router - a home gateway, a branch office box - needs address space for its own links, not just one address for itself. The requesting router asks for a prefix; the delegating router grants one from a pool and remembers the binding; the requesting router announces the granted prefix on its downstream link. All of it rides the same DHCPv6 protocol as Section 22.7.2, with an IA_PD (identity association, prefix delegation) in place of the IA_NA.

The Kea side is the pd-pools block from Section 22.7.2's listing: a /56 (fd22:230::, prefix-len 56) carved into delegatable /64s (delegated-len 64) - 256 downstream links' worth of space from one pool entry. The client side, on lanclient as john:

$ sudo dhclient -6 -P -1 -v eth1
Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on Socket/eth1
Sending on   Socket/eth1
PRC: Confirming active lease (INIT-REBOOT).
XMT: Forming Rebind, 0 ms elapsed.
XMT:  X-- IA_PD 00:64:7a:37
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Rebind on eth1, interval 920ms.
RCV: Reply message on eth1 from fe80::5054:ff:fe78:e820.
RCV:  X-- IA_PD 00:64:7a:37
RCV:  | X-- starts 1795346178
RCV:  | X-- t1 - renew  +900
RCV:  | X-- t2 - rebind +1350
RCV:  | X-- [Options]
RCV:  | | X-- IAPREFIX fd22:230::/64
RCV:  | | | X-- Preferred lifetime 1200.
RCV:  | | | X-- Max lifetime 1800.
RCV:  X-- Server ID: 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b
PRC: Bound to lease 00:01:00:01:32:95:8a:c9:52:54:00:e5:19:6b.

dhclient -6 -P requests a prefix instead of an address, and the exchange carries IAPREFIX fd22:230::/64 - the first /64 out of the /56 pool, with the same two-lifetime structure as an address lease. (The transcript opens with Confirming active lease rather than a fresh Solicit because this client had a pending lease from its IA_NA run moments before; the protocol let it rebind, and the granted prefix is the same one a cold Solicit would have produced.) The lease lands in the client's own record - on lanclient, as john:

$ grep -A4 "ia-pd" /var/lib/dhcp/dhclient6.leases | tail -6
  ia-pd 00:64:7a:37 {
    starts 1795346178;
    renew 900;
    rebind 1350;
    iaprefix fd22:230::/64 {

The practice client holds the prefix but does nothing with it - it is not a router. A real requesting router would now advertise fd22:230::/64 on its downstream link with the radvd configuration of Section 22.7.3, and hosts behind it would configure themselves by SLAAC exactly as lanclient did. That downstream advertisement, and DHCPv6 relaying for remote requesting routers, are the two pieces of the PD model this network did not wire up; the delegation itself - request, grant, record, lifetimes - is the part on display.

Address plan changes are the last planning topic because PD shows how they propagate. Renumbering an IPv6 network means new prefixes, not re-used addresses: advertise the new prefix while the old one's lifetime still runs, let hosts hold both, then let the old one age out of every lease and advertisement - the lifetimes are the renumbering schedule, and the reason to keep RA prefix lifetimes and PD lease lifetimes modest. The practice network's 24-hour SLAAC lifetime and 30-minute DHCPv6 lifetime are lab extremes of the same trade-off: short lifetimes renumber fast but depend on the advertiser's uptime; long lifetimes survive advertiser outages but renumber slowly.