IPsec protects traffic at the IP layer and is the usual choice for site-to-site tunnels and devices with built-in clients. OpenVPN builds a tunnel on TLS in user space and is easier to run over awkward networks. Neither is stronger by default. Your choice depends on peers, platforms and who manages the keys.
How do the two differ in design?
IPsec is a framework, not a single protocol. RFC 4301 describes the security architecture for IP, and IKEv2 in RFC 7296 handles mutual authentication and the setup of security associations. Because it sits in the IP stack, applications never notice it. IKE messages travel on UDP port 500, or on UDP port 4500 when NAT traversal is needed.
OpenVPN is a single open-source daemon. Its reference manual lists SSL/TLS security, Ethernet bridging, TCP or UDP transport through proxies and NAT, and support for dynamic addresses. It listens on port 1194 in the manual's examples, though the port is configurable.
Which one is easier to deploy?
It depends on where the endpoints are. Firewalls, routers and cloud gateways almost always speak IPsec, so linking two offices needs no extra software. A phone or laptop can use IPsec through a built-in client, which removes an agent from the support list.
OpenVPN needs a client on each device but gives you more knobs. Because it can run over TCP, it can sometimes get through networks that block UDP and unknown IP protocols. The cost is that tunneling TCP inside TCP can behave badly on lossy links, so UDP is the usual default where it works.
Where do the real security differences sit?
Mostly in configuration and key handling, not in the protocol name.
For IPsec, NIST SP 800-77 Rev. 1 is the practical guide. Its focus is how to use IPsec and IKE to protect sensitive traffic in different circumstances, and it also describes alternatives and when each one fits. The common failures are weak pre-shared keys reused across many peers, outdated algorithm suites left enabled for compatibility, and tunnels that were never reviewed after a staff change.
For OpenVPN, the weak points are similar. Certificates that never expire, a shared static key copied to many laptops, and a server left on defaults all cause trouble. The manual describes a tls-crypt option that wraps the control channel in an extra key, which hides the handshake from scanners and reduces exposure to unauthenticated traffic. It needs a key shared in advance, so plan how it is distributed.
A constructed example
Take a 40-person firm with two offices and 15 remote staff. The office routers already support IPsec, so the two sites are joined with an IKEv2 tunnel using certificates, not a shared password. For the remote staff, the team picks OpenVPN with per-user certificates, because it can run over TCP on port 443 from hotel networks, and each certificate can be revoked when someone leaves. Two protocols, each used where it fits.
Whichever you pick, a flat tunnel that drops every user onto the whole network is the larger risk. NIST SP 800-207 describes zero trust as moving defenses from network perimeters to users, assets and resources, so scope access per application where you can.
How to check or apply this
- List your peers: gateways, cloud networks, laptops, phones. Note which have a native client.
- Use IPsec for gateway to gateway links and OpenVPN (or IPsec with a native client) for people. Do not force one answer on both.
- Use certificates or per-peer keys. Never one shared secret for every site.
- Disable legacy algorithm suites and test that peers still connect.
- Restrict each tunnel to the subnets and services it needs.
- Review tunnels and certificates on a schedule, and remove any with no owner.
Quick check
Is IPsec more secure than OpenVPN?
Not by default. Both can be configured well or badly. Key management, algorithm choices and how much network access a tunnel grants matter more than the protocol name.
Which ports does IKE use?
RFC 7296 specifies UDP port 500, and UDP port 4500 for traffic that needs NAT traversal.
Sources
- RFC 4301, Security Architecture for the Internet Protocol
- RFC 7296, Internet Key Exchange Protocol Version 2
- NIST SP 800-77 Rev. 1, Guide to IPsec VPNs
- OpenVPN 2.6 reference manual
- NIST SP 800-207, Zero Trust Architecture
Last reviewed: 18 October 2026.