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
      • 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
          • 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
        • Relation to “Networking” and “OpenBGPD”
        • Contents
        • How to Use This Section
        • Next Steps

        Advanced Networking

        Synopsis #

        This section presents advanced configuration patterns for building and operating complex OpenBSD networks. It focuses on high availability, multi-homing, tunneling, IPv6 at scale, quality of service, MPLS, large-scale network services, virtualization-aware designs, L2/L3 architecture, telemetry, hardening, reference topologies, and troubleshooting playbooks. Each chapter provides concise design guidance, annotated configurations, verification steps, and operator-focused troubleshooting procedures.

        Relation to “Networking” and “OpenBGPD” #

        The Networking section covers foundational interfaces, routing, and packet filtering concepts suitable for most single-host or small deployments. Advanced Networking builds on those foundations to address redundancy, scale, and operational safety across larger environments.

        The OpenBGPD section focuses on external and internal BGP policy, peering, and route distribution. Where appropriate, this section references BGP as a control plane input (for example, anycast services or MPLS VPNs), but defers detailed BGP policy and session management to the dedicated OpenBGPD chapter at /openbgpd.

        Contents #

        The following chapters are ordered for incremental complexity. Each item links to its chapter and includes a one-line summary.

        • High Availability and State Replication — Redundant gateways and firewalls using CARP, pfsync, relayd, and event-driven failover.
        • Multi-WAN and Policy-Based Routing — Route-to, reply-to, monitoring, and inbound considerations for multi-provider edges.
        • VPN and Cryptographic Tunneling — IKEv2 with iked, WireGuard-style tunnels, NAT traversal, and performance tuning.
        • Classic and Lightweight Tunnels — gif, gre, and etherip for pragmatic overlays and migrations.
        • IPv6 at Scale — Router Advertisements, ND, prefix delegation, NPTv6, and large-segment IPv6 operations.
        • QoS and Traffic Shaping — Classification and queuing with PF for latency-sensitive and bulk traffic.
        • MPLS and Label Distribution — mpls(4) data plane with LDP via ldpd, PE interfaces (mpe), and L2 VPLS pseudowires.
        • Network Services at Scale — Authoritative DNS with nsd, validating recursion with unbound, DHCP roles, and time services.
        • Virtualization and Host Networking — vmd, tap/vether, bridging/VLANs, and micro-segmentation with PF anchors.
        • Large-Scale L2 and L3 Design — VLAN strategy, routed access, first-hop redundancy, and anycast service placement.
        • Telemetry, Logging, and Flow Export — pflog analysis, pflow (NetFlow/IPFIX), snmpd, and time-series integration.
        • Hardening and Operational Safety — Anti-spoofing, RPF, secrets management, and safe rollout procedures.
        • Reference Architectures — End-to-end designs: redundant Internet edge, campus/branch, and POP patterns.
        • Troubleshooting Playbooks — Diagnosing HA flips, asymmetric paths, tunnel MTU issues, IPv6 ND, and QoS verification.

        How to Use This Section #

        1. Read chapters in order on a first pass to establish common patterns and terminology.
        2. For implementation, jump directly to the relevant chapter based on your objective (for example, HA, IPv6, or QoS).
        3. Apply the Design Considerations before touching configuration.
        4. Use the Verification steps immediately after deployment to confirm behavior.
        5. Keep the Troubleshooting playbooks nearby during rollouts and incident response.

        Next Steps #

        Proceed to High Availability and State Replication , then continue through the chapters in order for a complete tour. You can also jump directly to the chapter that matches your current task.

        Report a bug
        • Synopsis
        • Relation to “Networking” and “OpenBGPD”
        • Contents
        • How to Use This Section
        • Next Steps