How to choose, use and configure a VPN in HardenedBSD (Comparison)

Choosing the Right VPN for HardenedBSD

HardenedBSD is a security-focused fork of FreeBSD, beloved by sysadmins and security professionals who demand a hardened kernel, PaX support, W^X enforcement and strong ASLR. Its package manager (pkg) and Ports Collection make installing network tools straightforward, while desktop users often opt for XFCE, KDE or lightweight window managers such as Openbox and Fluxbox. Because PF is the default firewall and rc.d scripts handle service start‐up, any VPN client should integrate cleanly with /etc/rc.conf and PF rules.

When selecting a VPN for HardenedBSD, look for:

  • Native openvpn and WireGuard support in pkg.
  • Scripts or clear documentation for BSD integration (rc.d, PF-based kill‐switch).
  • Providers offering .ovpn profiles and WireGuard key files you can place under /usr/local/etc.
  • Strong encryption, DNS leak prevention and reliability under the HardenedBSD kernel.

Comparison of Top VPN Providers for HardenedBSD

VPN Provider Protocols WireGuard BSD Support PF-Friendly Kill-Switch
Mullvad OpenVPN, WireGuard Yes Config examples for FreeBSD (apply to HardenedBSD) Easily scripted via PF and rc.d
ProtonVPN OpenVPN, IKEv2 (no official WireGuard yet) No (planned) Community guides for FreeBSD/OpenVPN Use PF block rules for kill-switch
IVPN OpenVPN, WireGuard Yes FreeBSD tutorials available PF example scripts provided

Detailed Setup: Mullvad and IVPN on HardenedBSD

1. Mullvad VPN

Mullvad provides both OpenVPN configuration files and WireGuard key pairs. Below illustrates installation via pkg, then configuration of OpenVPN and WireGuard, and integration with PF.

Install Required Packages

# pkg update
# pkg install openvpn wireguard-tools

Configure OpenVPN

1. Download your Mullvad .ovpn profile from your account, place it in /usr/local/etc/openvpn/mullvad.ovpn.

# mkdir -p /usr/local/etc/openvpn
# fetch -o /usr/local/etc/openvpn/mullvad.ovpn https://mullvad.net/download/openvpn-config/your‐config.ovpn

2. Enable OpenVPN in /etc/rc.conf:

openvpn_enable=YES
openvpn_configfile=/usr/local/etc/openvpn/mullvad.ovpn

3. Add PF rules for a basic kill-switch in /etc/pf.conf:

vpn_if=tun0
set skip on lo
block out quick on !( vpn_if ) from any to any
pass out on vpn_if from any to any keep state

4. Reload PF and start OpenVPN:

# service pf reload
# service openvpn start

Configure WireGuard

1. Generate keys and request Mullvad WireGuard credentials online. Save them in /usr/local/etc/wireguard/mullvad.conf:

[Interface]
PrivateKey = YOUR_PRIVATE_KEY
Address    = 10.7.0.2/32
DNS        = 10.7.0.1

[Peer]
PublicKey  = MULLVAD_PUBLIC_KEY
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint   = se-wireguard.mullvad.net:51820
PersistentKeepalive = 25

2. Enable at boot by editing /etc/rc.conf:

wireguard_enable=YES
wireguard_interfaces=mullvad

3. Reload PF and start WireGuard:

# service pf reload
# service wireguard start mullvad

2. IVPN

IVPN offers a robust BSD guide and supports both protocols. The steps closely mirror Mullvad’s, with the only difference in endpoints and config filenames.

Install Packages

# pkg update
# pkg install openvpn wireguard-tools

Configure OpenVPN

# mkdir -p /usr/local/etc/openvpn
# fetch -o /usr/local/etc/openvpn/ivpn.ovpn https://www.ivpn.net/ivpn.ovpn
# echo openvpn_enable=YES >> /etc/rc.conf
# echo openvpn_configfile=/usr/local/etc/openvpn/ivpn.ovpn >> /etc/rc.conf
# service pf reload
# service openvpn start

Configure WireGuard

# mkdir -p /usr/local/etc/wireguard
# vi /usr/local/etc/wireguard/ivpn.conf
…[insert IVPN keypair and peer block per IVPN dashboard]…

# echo wireguard_enable=YES >> /etc/rc.conf
# echo wireguard_interfaces=ivpn >> /etc/rc.conf
# service pf reload
# service wireguard start ivpn

Conclusion

For a security-hardened platform like HardenedBSD, Mullvad and IVPN stand out by offering first-class support for OpenVPN and WireGuard, clear BSD documentation, and easy integration into pkg, rc.d scripts and PF. ProtonVPN is a solid choice if you rely exclusively on OpenVPN and IKEv2, but you’ll need manual WireGuard workarounds until official support arrives. Whichever provider you choose, the combination of HardenedBSD’s kernel hardening and a reliable VPN delivers a privacy-centric workstation or server environment you can trust.

Download TXT



Leave a Reply

Your email address will not be published. Required fields are marked *