OPNsense Router
Flat isometric illustration of two pink server cubes on pads joined by glowing cables to a padlock overhead, on a dark grid floor.
VPN

WireGuard vs OpenVPN vs IPsec on OPNsense

Compare WireGuard, OpenVPN and IPsec on OPNsense, then choose by peer compatibility, client access, credentials and network restrictions.

By OPNsense Router Editorial · · 4 min read

On OPNsense, pick IPsec with IKEv2 for a gateway that requires it or for staff who must use a compatible built-in VPN client. Pick OpenVPN for staff who can install a client and need individual certificates or a TCP connection. Pick WireGuard for devices you manage when you can issue a key per device and the network allows UDP.

The short version

DecisionWireGuardOpenVPNIPsec with IKEv2
Best fitManaged devices and gateways that support WireGuardStaff with individual certificates or a link between OpenVPN gatewaysA partner gateway requiring IKEv2 or staff using a compatible native client
IdentityPublic key per peer and its allowed IPsIndividual client certificates, with username matching when configuredAgreed gateway authentication or a staff profile with a server certificate and user credentials
TransportUDP onlyUDP or TCP, as configured on both endsUDP 500 and 4500. Check whether the gateways also need to pass ESP directly.

IPsec vs OpenVPN

For a link between gateways, choose IPsec when the other gateway requires IKEv2. Ask for the partner’s tunnel settings before configuring OPNsense. OpenVPN is an option when both gateways support it and the two administrators can agree on the client and server roles, certificate trust, transport, and networks to route. OPNsense OpenVPN site-to-site guide

What to agree on for a partner IPsec tunnel

Ask whether the partner expects a policy-based or route-based tunnel. For a policy-based IKEv2 link, fill in this worksheet with the other administrator. OPNsense VPN documentation

SettingWhat both sides should record
Peer addressesRecord the address of each gateway. Site A’s local address is Site B’s remote address, and vice versa.
IKE and ESP proposalsConfirm IKEv2. Agree on an IKE proposal for the connection and an ESP proposal for the child tunnel.
AuthenticationAgree on the method and each gateway’s ID. With a pre-shared key, both sides use the same secret and expect the other gateway’s ID.
Protected subnetsList the networks on each side in CIDR notation. Site A’s local traffic selector is Site B’s remote selector, and vice versa.

For example, if Site A protects 192.168.1.0/24 and Site B protects 10.0.1.0/24, Site A lists 10.0.1.0/24 as remote and Site B lists 192.168.1.0/24 as remote. OPNsense policy-based IPsec example

OpenVPN for staff with individual certificates

Check that each staff device can run an approved OpenVPN client and import the exported .ovpn profile. Plan one client certificate per person. If you pair certificates with user accounts, use the username as the certificate’s common name and enable strict matching. OPNsense OpenVPN remote-access guide

For offboarding, configure the server to check a certificate revocation list so it can reject a revoked certificate. OpenVPN certificate revocation guide

IPsec for staff who need a native client

If company policy requires the built-in VPN client, choose IKEv2 once you confirm that the device supports the profile and its authentication method. The OPNsense guide shows native Windows and iOS profiles that use a trusted CA certificate and individual usernames and passwords. OPNsense IKEv2 remote-access guide

Can clients connect when UDP is blocked?

OpenVPN can connect if its server listens on TCP, the client profile uses TCP and the network allows traffic to that host and port. A UDP-only OpenVPN profile needs to be replaced with a matching TCP profile. OpenVPN server and client configuration guide

WireGuard uses UDP for all packets. The native IKEv2 setup described above needs UDP 500 and 4500. If staff must use that native client and their network blocks UDP, arrange access from a network that permits those ports. WireGuard protocol · OPNsense IKEv2 remote-access guide

WireGuard for devices you manage

Choose WireGuard for managed phones, laptops or gateways when you can configure both ends and UDP is available. For a phone or laptop, register the device’s public key and give that peer its own tunnel IP in OPNsense. OPNsense WireGuard remote-access guide

For two gateways, follow the WireGuard site-to-site routing guide. If the tunnel fails to connect or pass traffic, see WireGuard troubleshooting.

Hardware implications

Use the OPNsense hardware requirements guide for appliance sizing. The state table and bandwidth sizer takes the number of active WireGuard or IPsec tunnels as an input.

A decision shortcut

  1. Peer support. For a gateway link, start with the protocols the other administrator can configure. If the partner requires IKEv2, use the IPsec worksheet.
  2. Client availability. If staff must use their operating system’s built-in VPN, check its IKEv2 profile. If a separate client is allowed, check that it can be deployed to every required device.
  3. Identity. Pick OpenVPN when you need a certificate per person and can deploy its client. Pick WireGuard when a key per managed device fits. Native IKEv2 can still use individual usernames and passwords.
  4. Transport. Confirm the network allows the selected transport. If UDP is blocked, pick OpenVPN over TCP only if both the client and TCP listener are available and reachable.

The comparison was prepared using the OPNsense VPN guides and the Community Edition 26.7 series release notes. No lab runs were performed. OPNsense 26.7 release notes

Sources

  1. Virtual Private Networking - OPNsense documentation
  2. IPsec - Policy based public key setup - OPNsense documentation
  3. Setup SSL VPN site to site tunnel - OPNsense documentation
  4. Setup SSL VPN Road Warrior - OPNsense documentation
  5. IPsec - Roadwarriors IKEv2 - OPNsense documentation
  6. Creating Configuration Files for Server and Clients - OpenVPN
  7. Revoking Certificates - OpenVPN
  8. WireGuard Road Warrior Setup - OPNsense documentation
  9. WireGuard: Protocol & Cryptography
  10. OPNsense 26.7 "Xenial Xenops" Series release notes

Related