Synopsis #
IPv6 addressing on OpenBSD is typically handled using Stateless Address Autoconfiguration (SLAAC) rather than DHCPv6. The rtadvd(8)
daemon provides Router Advertisements (RA) that clients such as slaacd(8)
use to self-configure IPv6 addresses and routes without requiring a central DHCPv6 server.
In contrast with IPv4, where DHCP is nearly always used for address configuration, OpenBSD’s base system intentionally omits DHCPv6 server functionality. A lightweight DHCPv6 server is available via ports (dhcp6s
) but is seldom needed in practice.
DHCP and Autoconfiguration Components in OpenBSD #
The following table summarizes the major DHCP and IPv6 autoconfiguration components available on OpenBSD, covering both IPv4 and IPv6.
Component | Role | IP Version | In Base | Purpose |
---|---|---|---|---|
dhclient(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 |
rtadvd(8) | Router advertisement daemon | IPv6 | ✔ | Broadcasts IPv6 prefix and routing info |
dhcp6s | DHCPv6 server (from ports) | IPv6 | ✘ | Provides stateful IPv6 configuration (rarely needed) |
For most IPv6 environments on OpenBSD, rtadvd(8)
and slaacd(8)
are sufficient to provide robust, fully functional autoconfiguration without requiring additional software.
Configuration #
The configuration file for rtadvd
is located at /etc/rtadvd.conf
. For simple networks, the default configuration (an empty file) is usually sufficient.
To advertise IPv6 prefixes on interface em0
, enable and start the daemon as follows:
# rcctl enable rtadvd
# rcctl set rtadvd flags em0
# rcctl start rtadvd
This instructs rtadvd
to send Router Advertisements on the em0
interface, which are then processed by client machines (typically running slaacd(8)
).
Customizing Advertisement Behavior #
A more complex configuration can be defined in /etc/rtadvd.conf
:
em0:\
:addrs#1:prefixlen#64:tc=default:
Common configurable options include:
addrs#1
: Send prefix/address information.prefixlen#64
: Set advertised prefix length.tc=default
: Use default settings for unspecified values.
Example: LAN Router with Static IPv6 Prefix #
Given a statically assigned IPv6 prefix (e.g., 2001:db8:1::/64
), the router must:
Assign the address to its LAN interface:
# ifconfig em0 inet6 2001:db8:1::1 prefixlen 64 alias
Start
rtadvd
with appropriate interface flags.Ensure that packet forwarding is enabled:
# sysctl net.inet6.ip6.forwarding=1
Optionally persist this via
/etc/sysctl.conf
:net.inet6.ip6.forwarding=1
Notes on DHCPv6 and Mixed Environments #
OpenBSD’s base system does not include a DHCPv6 server. The dhcp6s
daemon is available via the ports collection, but is generally used only when stateful IPv6 configuration is required (e.g., central IP management or lease tracking).
Most OpenBSD systems will operate using:
rtadvd(8)
to announce prefixes and routesslaacd(8)
on clients to auto-configure
This configuration provides full IPv6 connectivity without requiring DHCPv6, and aligns with common best practices in IPv6 deployment.
Debugging and Verification #
To verify that router advertisements are being sent:
# tcpdump -n -i em0 icmp6
Look for Router Advertisement
ICMPv6 messages.
To verify that the interface has accepted the RA and configured an address:
# ifconfig em0
Expected output should include an inet6
autoconfigured address (typically starting with the advertised prefix).
Additional Considerations #
Ensure that the system firewall (pf(4)
) allows IPv6 traffic, including ICMPv6 Router Advertisements:
Example /etc/pf.conf
fragment:
pass inet6 proto ipv6-icmp from :: to ff02::1
This permits outgoing multicast advertisements necessary for SLAAC.