Platform status
FreeBSD is a Tier 1 platform - actively tested for every source commit across multiple FreeBSD versions. Other BSD variants (OpenBSD, NetBSD, DragonFly BSD) are Tier 2 platforms - functionality is maintained but not actively tested on latest versions.FreeBSD
FreeBSD provides first-class OpenVPN support with modern kernel features.TUN/TAP driver
FreeBSD ships with integrated TUN/TAP driver support. Device nodes:tap0, tap1, tap2, tap3, tun0, tun1, tun2, tun3 are created by default.
Driver loading
FreeBSD 12.0+: TUN/TAP drivers are integrated and always loaded. No manual loading required. FreeBSD prior to 12.0: The TAP driver needed manual loading:/boot/loader.conf:
Data Channel Offload (ovpn)
FreeBSD 14+ includes theovpn(4) kernel module for data channel offload.
OpenVPN 2.6+ automatically uses ovpn(4) on FreeBSD 14+ if available for kernel-level acceleration.
- Kernel-level OpenVPN data packet processing
- Significant performance improvements
- Automatic detection and usage by OpenVPN 2.6+
Installation
- Packages
- Ports
- From source
Install OpenVPN using pkg:
Service management
Enable OpenVPN service:Topology subnet mode
FreeBSD tun interfaces with--topology subnet are put into real subnet mode (IFF_BROADCAST) instead of point-to-point mode (IFF_POINTOPOINT).
This change (introduced in OpenVPN 2.4+) might affect software that enumerates interfaces looking for broadcast capability, but normal operations are unaffected.
FreeBSD-specific features
IPv4 forwarding
Enable IP forwarding for routing:/etc/sysctl.conf:
IPv6 forwarding
Enable IPv6 forwarding:Firewall (pf)
Configure packet filter for VPN: /etc/pf.conf:OpenBSD
OpenBSD provides secure and reliable OpenVPN support with dynamic TUN device creation.TUN/TAP driver
OpenBSD has dynamically createdtun* devices.
Create devices at boot:
Create empty hostname files for each tun device:
Installation
Service management
Enable and start OpenVPN:Firewall (pf)
OpenBSD uses pf as its firewall: /etc/pf.conf:NetBSD
NetBSD provides stable OpenVPN support with integrated TUN/TAP drivers.Installation
TUN/TAP driver
NetBSD includes TUN/TAP drivers in the kernel. Devices are created dynamically or can be pre-created:DragonFly BSD
DragonFly BSD maintains compatibility with FreeBSD’s TUN/TAP implementation.Installation
TUN/TAP driver
DragonFly BSD includes TUN/TAP support similar to FreeBSD. Device nodes are available by default.Common BSD configuration
System requirements
- OpenSSL 1.1.0+ or mbed TLS 3.2.1+: For encryption
- LZO (optional): For compression
- LZ4 (optional): For LZ4 compression
Building from source
All BSD variants support building from source:IP forwarding
IPv4:Sample server configuration
/usr/local/etc/openvpn/server.conf:Sample client configuration
/usr/local/etc/openvpn/client.conf:BSD-specific considerations
User/group names
BSD systems often use different unprivileged user names:- FreeBSD:
nobody:nobody - OpenBSD:
_openvpn:_openvpn(create dedicated user) - NetBSD:
nobody:nobody
Device permissions
Ensure proper device permissions:Routing
BSD routing usesroute command:
Process management
Run as daemon:Performance optimization
Buffer sizes
Increase socket buffers for better throughput:MTU settings
Optimize MTU for your network:Fast I/O
Disable compression for high-speed links:Troubleshooting
Permission errors
Symptom: Cannot open TUN device Solution:- Check device nodes exist:
ls -l /dev/tun* - Verify permissions
- Run as root initially to diagnose
Routing issues
Symptom: Cannot reach remote networks Solution:- Verify IP forwarding:
sysctl net.inet.ip.forwarding - Check firewall rules:
pfctl -sr - Verify routes:
netstat -rn
Connection timeouts
Symptom: Connection hangs during handshake Solution:- Check firewall allows UDP port 1194
- Verify server is listening:
sockstat -4 -l - Test with TCP:
proto tcp
Best practices
- Use dedicated user/group instead of nobody
- Enable persist-key and persist-tun to maintain connection through restarts
- Configure proper firewall rules for security
- Enable IP forwarding via sysctl.conf
- Use modern ciphers (AES-256-GCM)
- Monitor logs for connection issues
- Keep system updated for security patches
Resources
- FreeBSD Handbook: https://docs.freebsd.org/
- OpenBSD FAQ: https://www.openbsd.org/faq/
- NetBSD Guide: https://www.netbsd.org/docs/
- OpenVPN Community: https://community.openvpn.net/