Synopsis #
OpenBSD supports Stateless Address Autoconfiguration (SLAAC), described in RFC 4862 . Hosts use Router Advertisements (RA) from local routers to set their IPv6 addresses automatically. SLAAC is OpenBSD’s default IPv6 client configuration method and does not need a central DHCPv6 server.
The slaacd(8) daemon is responsible for receiving these advertisements and configuring IPv6 addresses, routes, and resolver settings accordingly.
In typical OpenBSD networks, slaacd(8) is used in conjunction with rad(8)
, which provides Router Advertisements on the server or router side.
DHCP and Autoconfiguration Components in OpenBSD #
The table below summarizes the primary components used for DHCP and autoconfiguration on OpenBSD, including both IPv4 and IPv6 support:
| Component | Role | IP Version | In Base | Purpose |
|---|---|---|---|---|
dhcpleased(8) | DHCP client | IPv4 | ✔ | Assigns IPv4 address and DNS from DHCP server |
dhcpd(8) | DHCP server | IPv4 | ✔ | Assigns IPv4 addresses and configuration to clients |
slaacd(8) | SLAAC client daemon | IPv6 | ✔ | Receives RA messages and configures interfaces |
rad(8) | Router advertisement daemon | IPv6 | ✔ | Advertises IPv6 prefix and routing info |
dhcp6s | DHCPv6 server (from ports) | IPv6 | ✘ | Provides stateful IPv6 configuration (rarely needed) |
For most IPv6 networks, slaacd(8) and rad(8)
are sufficient and require no third-party software.
Configuring SLAAC with slaacd(8) #
The slaacd(8) daemon listens for Router Advertisements and configures:
- IPv6 addresses (using the advertised prefix)
- Default gateways
- DNS resolver settings (if advertised via RDNSS)
Enabling SLAAC on an Interface #
To enable SLAAC on an interface, create or edit the corresponding /etc/hostname.if file to contain:
inet6 autoconf
For example, to enable SLAAC on em0:
Add the line above to /etc/hostname.em0 without discarding existing IPv4 or link settings, then apply it:
doas sh /etc/netstart em0
The default-enabled slaacd daemon handles interfaces with the autoconfiguration flag. Setting that flag does not start a deliberately disabled daemon.
Managing slaacd at Runtime #
Although slaacd runs automatically for configured interfaces, it can be explicitly managed via rcctl(8):
doas rcctl enable slaacd
doas rcctl start slaacd
doas rcctl check slaacd
doas rcctl restart slaacd
To inspect logs:
doas tail -f /var/log/daemon
Viewing Assigned IPv6 Addresses #
After successful configuration, IPv6 addresses can be inspected with:
ifconfig em0
Example output:
inet6 fe80::1%em0 prefixlen 64 scopeid 0x1
inet6 2001:db8:abcd:1234::123 prefixlen 64 autoconf
The autoconf keyword indicates that the address was assigned via SLAAC.
DNS Configuration via RDNSS #
slaacd sends advertised RDNSS information as resolver proposals. resolvd(8)
merges them into /etc/resolv.conf alongside other proposals and user-edited lines. Do not make the file immutable; inspect the daemon and proposal state when DNS configuration is missing.
Advertising IPv6 Prefixes #
Router Advertisements must be present on the network for SLAAC to succeed. These are typically provided by rad(8), which must run on the default gateway or router.
See the rad(8) chapter for full configuration details.
Disabling SLAAC on an Interface #
Replace inet6 autoconf with inet6 -autoconf in the interface file, preserving its other settings. Disable automatic configuration at runtime with:
doas ifconfig em0 inet6 -autoconf
For a static address, add an appropriate address and prefix length, for example inet6 2001:db8::123 64, and configure the actual IPv6 gateway. Merely deleting the file does not undo a running interface’s configuration.
Troubleshooting #
Confirm Interface Addressing #
ifconfig em0
Check for inet6 addresses with the autoconf tag.
Monitor Router Advertisements #
doas tcpdump -i em0 icmp6
This will display incoming RA messages.
Verify DNS Configuration #
cat /etc/resolv.conf
host openbsd.org
If resolv.conf does not reflect expected settings, ensure that RDNSS is being advertised and the file is not protected.