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
          • smtpd
          • Dovecot
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound
          • NSD
          • BIND
        • Networking
          • OpenBGPD
          • rad
          • 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
      • How-to Guides
        • 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
      rad
      • 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

      rad

      Synopsis #

      IPv6 addressing on OpenBSD is typically handled using Stateless Address Autoconfiguration (SLAAC) rather than DHCPv6. The rad(8) daemon provides Router Advertisements (RA) that clients such as slaacd(8) use to self-configure IPv6 addresses, routes, and optional DNS resolver information without requiring a central DHCPv6 server.

      Older OpenBSD releases used rtadvd(8) for this role. rtadvd(8) was replaced by rad(8) in OpenBSD 6.4, so new OpenBSD systems should use rad(8) and /etc/rad.conf.

      In contrast with IPv4, where DHCP is commonly 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
      rad(8)Router advertisement daemonIPv6✔Broadcasts IPv6 prefix, route, and DNS information
      dhcp6sDHCPv6 server (from ports)IPv6✘Provides stateful IPv6 configuration when required

      For most IPv6 environments on OpenBSD, rad(8) and slaacd(8) are sufficient to provide robust autoconfiguration without requiring additional software.

      Configuration #

      The configuration file for rad(8) is /etc/rad.conf. A minimal configuration advertises on the selected interface:

      interface em0
      

      To advertise IPv6 prefixes on interface em0, enable and start the daemon as follows:

      # rcctl enable rad
      # rcctl start rad
      

      This instructs rad(8) to send Router Advertisements on em0, which are then processed by client machines, typically running slaacd(8).

      Customizing Advertisement Behavior #

      A more explicit /etc/rad.conf can set the advertised prefix and DNS information:

      interface em0 {
          prefix 2001:db8:1::/64
          dns {
              nameserver 2001:db8:1::1
              search example.org
          }
      }
      

      This announces the LAN prefix and provides Recursive DNS Server (RDNSS) information to clients that support it.

      Example: LAN Router with Static IPv6 Prefix #

      Given a statically assigned IPv6 prefix (for example, 2001:db8:1::/64), the router must:

      1. Assign an address to its LAN interface:

        # ifconfig em0 inet6 2001:db8:1::1 prefixlen 64 alias
        
      2. Create /etc/rad.conf with an interface em0 block.

      3. Ensure that packet forwarding is enabled:

        # sysctl net.inet6.ip6.forwarding=1
        
      4. Persist forwarding in /etc/sysctl.conf:

        net.inet6.ip6.forwarding=1
        
      5. Enable and start rad(8):

        # rcctl enable rad
        # rcctl start rad
        

      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 it is generally used only when stateful IPv6 configuration is required, such as central IP management or lease tracking.

      Most OpenBSD systems will operate using:

      • rad(8) to announce prefixes, routes, and optional DNS resolver information
      • slaacd(8) on clients to auto-configure

      This configuration provides full IPv6 connectivity without requiring DHCPv6 and aligns with common IPv6 deployment practice.

      Debugging and Verification #

      Check that rad(8) is enabled and running:

      # rcctl check rad
      

      To verify that router advertisements are being sent:

      # tcpdump -n -i em0 icmp6
      

      Look for Router Advertisement ICMPv6 messages.

      To verify that a client interface 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