English
简体中文繁體中文EnglishРусскийفارسی

Home › Blog › Compare

Two letters on the scale

WireGuard and OpenVPN compared: speed, encryption, setup, TCP support, authentication, the official benchmark and its limits, and who each suits.

Compiled on

A letter balance more than a century old
A letter balance more than a century old Auckland War Memorial Museum, CC BY 4.0

In short: for your own setup, speed and battery, take WireGuard. For TCP 443, passwords or certificates, take OpenVPN.

Both are open source and widely used. OpenVPN wants to cover every case with hundreds of options; WireGuard does one thing and does not even let you choose the cipher. The rest follows from that.

Speed

  • WireGuard1011
  • IPsec AES-GCM881
  • IPsec ChaCha20825
  • OpenVPN258
Published on the official site (Mbps, Linux 4.6, gigabit cards)

The same page warns that these figures are old and not well conducted: WireGuard and IPsec have both become faster and OpenVPN remains far slower. OpenVPN has since gained a kernel module that narrows the gap.

Postal scales: decide what you are weighing before comparing
Postal scales: decide what you are weighing before comparing Hannes Grobe 19:04, 3 September 2006 (UTC), CC BY-SA 2.5

Other differences

WireGuardOpenVPN
TransportUDP onlyUDP, TCP
EncryptionOne fixed setMany to choose
AuthenticationPublic keysCertificates, passwords
Changing networkRoams by itselfUsually reconnects
When idleSilentRegular pings
Client addressesWritten in the configHanded out by the server
DisguiseNoneTCP 443 resembles HTTPS

Who each suits

  1. Home or a small teamWireGuard
  2. Always on, on a phoneWireGuard, for the battery
  3. A company with accountsOpenVPN, or a management layer on WireGuard
  4. Only TCP 443 gets outOpenVPN
Find your case
An old envelope: OpenVPN configs are longer and have more options
An old envelope: OpenVPN configs are longer and have more options Harrison, John Scott, 1804-1878, Public domain

The same task in two files

For one phone the WireGuard server needs only:

WireGuard
[Interface]
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = server-private-key

[Peer]
PublicKey = phone-public-key
AllowedIPs = 10.8.0.2/32

OpenVPN needs a certificate authority, two certificates, a shared key and twenty lines. In return you can revoke certificates, join a company directory and push different routes to different people. Useless for a few of your own devices, valuable for dozens of employees.

What little code means

The kernel code is about four thousand lines, readable in days. OpenVPN with its crypto library is several hundred thousand. Less code is not zero bugs, but easier to audit; that is one reason Linux has included WireGuard since 5.6.

Changing networks

From Wi-Fi to mobile data WireGuard does not reconnect: the server sees a valid packet from a new address and goes on; a call may survive. OpenVPN over UDP can float too in new versions, over TCP it needs a new handshake.

Battery

Without traffic WireGuard sends nothing, unless keepalive is set. OpenVPN usually has a heartbeat every ten seconds, which shows overnight.

A privacy difference

WireGuard gives each client a fixed internal address and the server remembers the last source address in memory. No problem on your own server; commercial VPNs add their own mechanisms. OpenVPN releases it on disconnect.

Being recognised

Neither hides seriously. WireGuard's first packet has a fixed length and start; OpenVPN's handshake is known as well, though TCP 443 passes networks that only filter ports.

Should I move

SituationAdvice
All fine, few peopleNo hurry; OpenVPN 2.6 has kernel acceleration
Slow, CPU fullMove
Many phonesMove
Old router without WireGuardLook for firmware first
Rights by certificates and accountsStay, or find another way to manage

Both can run on one server with different ports and subnets; move people one by one.

Is a fixed cipher set less safe?

It is deliberate. If something breaks, the protocol version changes as a whole and nobody can be pushed down to a weak cipher.

Both on one server?

Yes, with different ports and networks; do not send all traffic to both.

Is the speed chart on the website right?

Roughly. It is old and says itself that it is not rigorous. Measure with iperf3 inside and outside.

Which is safer?

Both when configured well. OpenVPN's risk is old ciphers left in the file; WireGuard offers nothing to choose wrongly.

For games?

WireGuard adds less latency, but the line matters more than the protocol.

Next letter

On the same round

Postcodes: WireGuard vs OpenVPN, WireGuard speed, OpenVPN alternative