OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction to OpenBSD
      • Installing OpenBSD
      • The X Window System
      • Networking on OpenBSD
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • OpenBSD Desktop Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • OpenSMTPD Mail Server
          • Dovecot IMAP and POP3 Server
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound DNS Resolver
          • NSD Authoritative DNS Server
          • BIND DNS Server
        • Networking
          • OpenBGPD
          • rad
          • DHCP on OpenBSD
          • slaacd
        • Web
          • Apache HTTP Server
          • nginx Web Server
          • OpenBSD httpd Web Server
          • relayd Reverse Proxy
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • OpenSSH Server
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ Message Broker
        • Time
          • NTP Time Synchronization
        • Load Balancing
          • Build Redundant Load-Balanced Gateways
          • Load Balance Services with NAT or DSR
          • Build an HA HTTPS Load Balancer
      • 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
        • Installation and First Boot
          • Complete the First 30 Minutes After Installation
          • Check Hardware Compatibility Before Installing
          • Bootstrap Wi-Fi Firmware Without Ethernet
          • Run OpenBSD as a Virtual Machine Guest
          • Install OpenBSD on a VPS or Cloud Server
          • Install OpenBSD with Full-Disk Encryption
          • Run FreeBSD on OpenBSD with vmd
          • Dual-Boot OpenBSD on a UEFI System
          • Automate OpenBSD Installation with Autoinstall and PXE
        • Desktops and Laptops
          • Set Up OpenBSD as a Laptop or Workstation
          • Configure Laptop Power Management
          • Troubleshoot Web Browsers on OpenBSD
          • Use Plan 9 Tools on OpenBSD
          • Build a Minimal Desktop with suckless Tools
          • Install Z shell (zsh)
        • Networking and Remote Access
          • Create an Administrator Account with doas and SSH Keys
          • Configure Secure Remote Access with OpenSSH
          • Use FIDO Security Keys with OpenSSH
          • Configure Wi-Fi Roaming and Wired Failover
          • Troubleshoot PF, NAT, and Routing
          • Route Multiple VLANs with PF
          • Configure a Road-Warrior WireGuard VPN
          • Route IPv6 Networks without NAT
          • Test OpenBGPD with Two Providers
          • Unlock an Internal Service with an SSH Key
          • Build a Simple Router and Firewall
        • Servers and Services
          • Set Up WordPress on OpenBSD
          • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Security, Maintenance and Recovery
          • Establish a Conservative Security Baseline
          • Recover Access and Reset the Root Password
          • Collect OpenBSD Diagnostic Evidence
          • Troubleshoot Package Installation and Update Failures
          • Schedule Recurring Maintenance
          • Monitor an OpenBSD System
          • Back Up and Restore an OpenBSD System
          • Configure softraid RAID1
          • Recover an OpenBSD System That Does Not Boot
        • Building, Automation and Virtual Machines
          • Manage OpenBSD with Ansible
          • Build Third-Party Software from Ports
          • Build OpenBSD from Source
          • Plan a Docker Workload Migration to OpenBSD
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Architectures
      • OpenBSD Package Search
        • 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. The dhcp6s package provides a DHCPv6 server when stateful address assignment is required.

        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
        dhcpleased(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✔Advertises 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) provide autoconfiguration without 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:

        doas rcctl enable rad
        doas 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:

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

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

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

          doas rcctl enable rad
          doas 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

        Internet connectivity also requires an upstream route, a prefix routed back to the LAN, forwarding, and suitable PF policy. Prefix delegation from an ISP can use base-system dhcp6leased(8) where supported.

        Debugging and Verification #

        Check that rad(8) is enabled and running:

        doas rcctl check rad
        

        To verify that router advertisements are being sent:

        doas tcpdump -n -i em0 icmp6
        

        Look for Router Advertisement ICMPv6 messages.

        To verify that a client interface accepted the RA and configured an address:

        doas 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 icmp6
        

        This broad ICMPv6 fragment permits advertisements, solicitations, neighbor discovery, and path-MTU signaling. Router advertisements originate from a link-local address, not ::. Merge it with the intended interface policy.

        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