OpenVPN is an open-source virtual private network protocol and software suite that creates encrypted tunnels between hosts by using TLS for key exchange and a custom record format for data transport. In network security, it is one of the most widely deployed solutions for remote access and site-to-site connectivity, valued for running in user space on almost any operating system.
First released in 2001, OpenVPN predates WireGuard by more than a decade and differs from IPsec in that it does not depend on kernel-level protocol support. It can run over UDP or TCP on a single configurable port, which makes it easy to pass through firewalls and NAT devices that block other VPN protocols.
How OpenVPN builds an encrypted tunnel
OpenVPN separates its traffic into a control channel and a data channel that are multiplexed over the same transport connection. The control channel runs a full TLS handshake to authenticate both peers and negotiate session keys, while the data channel carries the encapsulated IP packets or Ethernet frames.
On each host, OpenVPN attaches to a virtual network interface. A TUN device carries routed IP packets at layer 3, and a TAP device carries full Ethernet frames at layer 2, which allows bridging. Packets written to the virtual interface are read by the OpenVPN process, encrypted, wrapped in UDP or TCP, and sent to the peer, which reverses the process.
Because the entire stack runs in user space, every packet crosses the boundary between kernel and process twice. This design gives portability and flexibility, but it is also the main reason OpenVPN is slower than kernel-based alternatives. The DCO kernel module (data channel offload), available in recent versions, moves data-channel encryption into the kernel to reduce this cost.
The table below lists the main building blocks of a typical deployment.
| Component | Role | Typical choice |
|---|---|---|
| Control channel | Authenticates peers and negotiates keys | TLS 1.2 or TLS 1.3 |
| Data channel cipher | Encrypts tunneled traffic | AES-256-GCM or ChaCha20-Poly1305 |
| Virtual interface | Connects the tunnel to the operating system | TUN for routing, TAP for bridging |
| Transport | Carries encrypted packets | UDP port 1194 by default |
| tls-crypt key | Wraps control packets with a shared key | Hides and protects the handshake |
Authentication and key management in OpenVPN
OpenVPN supports several authentication models, and the choice determines both security and administrative effort. The strongest common setup relies on a private certificate authority (PKI) that issues a certificate to every server and client, often combined with a username and password or one-time codes checked through a plugin or a RADIUS server.
Revocation is handled through a certificate revocation list (CRL) that the server checks on each connection. Many breaches of OpenVPN deployments stem not from the protocol but from poorly protected CA keys or stale client certificates that were never revoked after an employee left.
| Method | Security level | Administrative effort | Suitable for |
|---|---|---|---|
| Static pre-shared key | Low, no forward secrecy | Minimal | Legacy tests only, removed in recent versions |
| Certificates only | High | Moderate, requires a PKI | Site-to-site links |
| Certificates plus credentials | Very high | Higher | Employee remote access |
| Certificates plus MFA | Very high | Highest | Privileged or regulated access |
Adding tls-crypt or tls-auth places a shared key in front of the TLS handshake. The server silently drops unauthenticated packets, which reduces exposure to port scanning and denial-of-service attempts against the TLS stack.
OpenVPN compared with WireGuard and IPsec
OpenVPN, WireGuard and IPsec solve the same problem with very different philosophies. OpenVPN favors configurability and firewall traversal, WireGuard favors minimal code and speed, and IPsec favors standardization and native support in network equipment.
| Property | OpenVPN | WireGuard | IPsec with IKEv2 |
|---|---|---|---|
| Code base size | Large, tens of thousands of lines | About 4,000 lines in the kernel | Large, varies by vendor |
| Cryptographic agility | Negotiable ciphers | Fixed modern primitives | Negotiable suites |
| Transport | UDP or TCP, any port | UDP only | UDP 500 and 4500, ESP |
| Typical throughput | Moderate, higher with DCO | High | High with hardware offload |
| Firewall traversal | Excellent over TCP 443 | Good | Often blocked or filtered |
| Native router support | Common in open firmware | Growing | Nearly universal |
The ability to run over TCP port 443 lets OpenVPN blend with ordinary HTTPS traffic on restrictive networks. However, tunneling TCP inside TCP can cause TCP meltdown, where retransmissions at both layers amplify each other under packet loss, so UDP remains the recommended default.
Configuring OpenVPN for practical deployments
A sound OpenVPN configuration depends on a few decisions that matter more than any individual option. Administrators must choose between full tunneling, which routes all client traffic through the VPN, and split tunneling, which sends only traffic for internal networks through it.
- Use AEAD ciphers such as AES-256-GCM and let peers negotiate them through the data-ciphers option.
- Require TLS 1.2 or higher and enable tls-crypt or tls-crypt-v2 for per-client control keys.
- Push routes and DNS servers explicitly so clients do not leak name queries outside the tunnel.
- Run the daemon as an unprivileged user after startup to limit the impact of a compromise.
- Keep the CA private key offline and maintain an up-to-date revocation list.
Commercial distributions such as OpenVPN Access Server and firewall platforms such as pfSense provide web interfaces on top of the same engine. They simplify client profile generation but do not remove the need to understand the underlying options.
Limitations and frequent mistakes
OpenVPN is mature and well audited, yet its flexibility creates room for misconfiguration. The most frequent problems in production fall into a few recognizable patterns.
| Symptom | Likely cause | Fix |
|---|---|---|
| Low throughput on fast links | Single-threaded user-space processing | Enable DCO or consider WireGuard |
| Stalls under packet loss | TCP transport causing meltdown | Switch to UDP where permitted |
| Large packets dropped | MTU mismatch inside the tunnel | Tune tun-mtu or mssfix |
| DNS leaks on clients | DNS servers not pushed or enforced | Push DNS and block outside DNS |
| Former staff still connect | Certificates never revoked | Maintain and enforce the CRL |
The idea in brief
OpenVPN builds a private, locked tunnel through the public internet. Anything sent through that tunnel is scrambled, so people on the same café network or along the route cannot read it.
Both ends must prove who they are before the tunnel opens, usually with digital certificates that work like signed ID cards. Its main strength is that it works almost everywhere, even on networks that block other VPN types, although it is often slower than newer options.
A practical scenario
A regional engineering firm with 60 employees needed remote access to its file servers and licensing servers. Several staff traveled to client sites whose guest networks blocked everything except web traffic, which ruled out its existing IPsec setup for those users.
The administrator deployed OpenVPN on the firm’s firewall with a primary profile on UDP 1194 and a fallback profile on TCP 443. Each employee received a certificate from an offline CA plus multi-factor authentication through the firm’s RADIUS server, and split tunneling sent only the office subnets through the VPN.
Over the following quarter, traveling staff connected successfully from every client site, and when two contractors finished their projects, revoking their certificates removed their access within minutes.