OpenBSD Handbook

    • Part I. Install & Configure
      • Introduction
      • Installing OpenBSD
      • The X Window System
      • Networking
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • Graphical Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Security
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • TFTP
        • Mail
          • Dovecot
          • smtpd
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Named
          • Unbound
          • NSD
        • Networking
          • OpenBGPD
          • rtadvd
          • DHCP
          • slaacd
        • Web
          • Apache
          • nginx
          • httpd
          • relayd
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • sshd
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ
        • Time
          • NTP
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • Howto
        • Install Z shell (zsh)
        • Set Up WordPress
        • Build a Simple Router and Firewall
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • Package Search
      slaacd
      • Synopsis
      • DHCP and Autoconfiguration Components in OpenBSD
      • Configuring SLAAC with slaacd(8)
        • Enabling SLAAC on an Interface
        • Managing slaacd at Runtime
      • Viewing Assigned IPv6 Addresses
      • DNS Configuration via RDNSS
      • Advertising IPv6 Prefixes
      • Disabling SLAAC on an Interface
      • Troubleshooting
        • Confirm Interface Addressing
        • Monitor Router Advertisements
        • Verify DNS Configuration

      slaacd

      Synopsis #

      OpenBSD provides native support for Stateless Address Autoconfiguration (SLAAC), as described in RFC 4862 . SLAAC allows IPv6 hosts to configure their addresses automatically based on Router Advertisements (RA) sent by local routers. This mechanism avoids the need for a centralized DHCPv6 infrastructure and is the default method for client-side IPv6 configuration in OpenBSD.

      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 rtadvd(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:

      ComponentRoleIP VersionIn BasePurpose
      dhclient(8)DHCP clientIPv4✔Assigns IPv4 address and DNS from DHCP server
      dhcpd(8)DHCP serverIPv4✔Assigns IPv4 addresses and configuration to clients
      slaacd(8)SLAAC client daemonIPv6✔Receives RA messages and configures interfaces
      rtadvd(8)Router advertisement daemonIPv6✔Broadcasts IPv6 prefix and routing info
      dhcp6sDHCPv6 server (from ports)IPv6✘Provides stateful IPv6 configuration (rarely needed)

      For most IPv6 networks, slaacd(8) and rtadvd(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:

      # echo "inet6 autoconf" > /etc/hostname.em0
      # sh /etc/netstart em0
      

      This causes slaacd(8) to start automatically and apply the received IPv6 configuration.

      Managing slaacd at Runtime #

      Although slaacd runs automatically for configured interfaces, it can be explicitly managed via rcctl(8):

      # rcctl enable slaacd
      # rcctl start slaacd
      # rcctl check slaacd
      # rcctl restart slaacd
      

      To inspect logs:

      # tail -f /var/log/messages
      

      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 #

      If the router advertises DNS server addresses using Recursive DNS Server Advertisement (RDNSS), slaacd(8) will write them to /etc/resolv.conf, provided the file is writable.

      To allow this behavior, ensure that /etc/resolv.conf is not protected with the system immutable flag:

      # chflags noschg /etc/resolv.conf
      

      Otherwise, SLAAC will complete but DNS resolution may not function correctly.

      Advertising IPv6 Prefixes #

      Router Advertisements must be present on the network for SLAAC to succeed. These are typically provided by rtadvd(8), which must run on the default gateway or router.

      See the rtadvd(8) chapter for full configuration details.

      Disabling SLAAC on an Interface #

      To disable SLAAC, remove the inet6 autoconf directive from the interface’s configuration file and restart the interface:

      # rm /etc/hostname.em0
      # echo "inet6 2001:db8::123 255.255.255.0" > /etc/hostname.em0
      # sh /etc/netstart em0
      

      Alternatively, leave the file empty or omit the autoconf keyword to prevent automatic IPv6 configuration.

      Troubleshooting #

      Confirm Interface Addressing #

      $ ifconfig em0
      

      Check for inet6 addresses with the autoconf tag.

      Monitor Router Advertisements #

      # 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.

      Report a bug
      • Synopsis
      • DHCP and Autoconfiguration Components in OpenBSD
      • Configuring SLAAC with slaacd(8)
        • Enabling SLAAC on an Interface
        • Managing slaacd at Runtime
      • Viewing Assigned IPv6 Addresses
      • DNS Configuration via RDNSS
      • Advertising IPv6 Prefixes
      • Disabling SLAAC on an Interface
      • Troubleshooting
        • Confirm Interface Addressing
        • Monitor Router Advertisements
        • Verify DNS Configuration