Skip to content
ALB Wiki

WireGuard

WireGuard is the VPN that proved cryptography's complexity was a choice, not a law: a complete virtual private network in roughly four thousand lines of kernel code, with one fixed cipher suite, public keys instead of certificates, and an interface so small a single page of configuration stands up an encrypted tunnel. Where OpenVPN and IPsec grew into hundred-thousand-line negotiation machines — cipher menus, handshake options, certificate hierarchies — WireGuard deleted the menus. It was merged into the Linux kernel at version 5.6 in March 2020, with Linus Torvalds calling it a work of art next to the horrors of the older VPN stacks.

The design: delete the negotiation

Classic VPNs are negotiation engines. IPsec and OpenVPN offer dozens of cipher, hash, key-exchange, and mode combinations — each a configuration choice, each a downgrade path, each a place for implementations to disagree. WireGuard's designer Jason Donenfeld chose the opposite path: one suite, no menus. WireGuard speaks Curve25519 for key exchange, ChaCha20-Poly1305 for authenticated encryption, BLAKE2s for hashing, SipHash24 for hashtable keys — all modern, all fast in software (ChaCha20 was chosen precisely because it doesn't need AES-NI hardware), and all non-negotiable. There is nothing to misconfigure at the crypto layer because there is nothing to configure.

Underneath, the handshake is built on the Noise protocol framework — the same family of authenticated key-exchange patterns that secure Signal and WhatsApp. Identity is a Curve25519 public key: no certificate authorities, no expiry dates, no PKI bureaucracy. You generate a keypair, share the public half, and that key is the identity.

Cryptokey routing — the clever part

WireGuard's signature idea is cryptokey routing: a peer's public key is bound to a set of allowed IP addresses (AllowedIPs). When the interface sees a packet destined for an address in a peer's range, it encrypts and sends it to that peer; a packet decrypted from a peer is only accepted if its source IP matches what that peer is allowed to claim. Routing table is the access control list — the simplest possible mental model, and the property that makes WireGuard topologies easy to reason about.

The interface itself is an ordinary kernel network device — wg0 — configured with the tiny wg tool or the wg-quick wrapper. It runs over UDP only (no TCP-over-TCP meltdown), conventionally on port 51820, and it's silent: unauthenticated or malformed packets get no reply at all. A port scan of a WireGuard host sees a closed port even when the tunnel is alive.

Roaming and persistence

Both peers can change IP addresses freely — the association follows the cryptographic handshake, not the socket. A laptop moving from Wi-Fi to LTE keeps the tunnel; the server learns the new source address from the next valid packet. Rekeying happens continuously (~every two minutes of traffic) without connection disruption.

Configuration, entire

A full tunnel endpoint fits in a screenful:

# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = <this host's private key>
Address = 10.0.0.1/24
ListenPort = 51820

[Peer]
PublicKey = <peer's public key>
AllowedIPs = 10.0.0.2/32
Endpoint = 203.0.113.10:51820
PersistentKeepalive = 25

wg-quick up wg0 creates the interface, sets routes, and brings the tunnel alive. Mobile clients scan a QR code of the same file.

Adoption

Beyond Linux 5.6, WireGuard shipped for Windows, macOS, Android, iOS, FreeBSD, and OpenBSD — as kernel modules or the wireguard-go/wireguard-rs userspace implementations. (The initial FreeBSD kernel port was rushed by its sponsor and had to be rewritten after Donenfeld's public review — a rare visible example of how hard "just port it" is.) Commercial VPN providers adopted it broadly; Tailscale built its entire mesh-network product on WireGuard's data plane.

What it deliberately doesn't do

  • No TCP transport — can't traverse TCP-only proxies; it's UDP or nothing
  • No dynamic key distribution UI — keys are exchanged out-of-band; that's the operator's job (or a control plane like Tailscale's)
  • No logging of users — the kernel module keeps almost no state; privacy by minimalism
  • Optional pre-shared key — a symmetric PSK can be layered on per-peer as a hedge against future quantum attacks on Curve25519

In the handbook

WireGuard is the modern endpoint of the Tunneling story — a tun-style interface carrying IP packets inside authenticated UDP, with the encapsulation overhead (~60 bytes) and MTU considerations all tunnels share. On an LFS-built system it's a kernel config plus userspace tools — no daemons, no state files.

Timeline

~2015Donenfeld begins development
2016Public announcement + whitepaper
2018–19Android/iOS apps, wider distro packaging
Mar 2020Merged into Linux kernel 5.6
2020+Windows/macOS/BSD ports; Tailscale era

See also

  • Tunneling — encapsulation: the larger idea WireGuard executes
  • Linux — the kernel it lives inside
Categories: Cryptography · Linux · Networking · Software
This page was last edited 2026-10-25 14:39:01 UTC by ALB Team. What links here