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
      rtadvd
      • Synopsis
      • DHCP and Autoconfiguration Components in OpenBSD
      • Configuration
        • Customizing Advertisement Behavior
        • Example: LAN Router with Static IPv6 Prefix
      • Notes on DHCPv6 and Mixed Environments
      • Debugging and Verification
      • Additional Considerations

      rtadvd

      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.

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

      1. Assign the address to its LAN interface:

        # ifconfig em0 inet6 2001:db8:1::1 prefixlen 64 alias
        
      2. Start rtadvd with appropriate interface flags.

      3. Ensure that packet forwarding is enabled:

        # sysctl net.inet6.ip6.forwarding=1
        
      4. 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 routes
      • slaacd(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.

      Report a bug
      • Synopsis
      • DHCP and Autoconfiguration Components in OpenBSD
      • Configuration
        • Customizing Advertisement Behavior
        • Example: LAN Router with Static IPv6 Prefix
      • Notes on DHCPv6 and Mixed Environments
      • Debugging and Verification
      • Additional Considerations