LeoTun

Internet Freedom Alliance

2026-10 sing-box upgraded: old configs no longer work. Sign in and re-scan the code on the sing-box page, once per device.
2026-09 New router firmware is out — please update. OpenVPN is back: download a profile, import it, and connect in one tap.
2026-09 New Personal plan: 5 USD/month for 2 devices, routers included — everyone should have a VPN router.

Related guides

WireGuard explained: architecture, cryptography, and evolution

Updated

WireGuard is an open-source VPN protocol designed by Jason A. Donenfeld, introduced around 2015 and merged into the upstream Linux kernel in 2020. Its design philosophy centres on radical simplicity: small codebase (around 4,000 lines of core code compared to hundreds of thousands in IPsec or OpenVPN), zero cipher agility (one fixed, modern cryptographic suite), and minimal state (no complex negotiation sessions; packets are emitted when available and silent when idle). This simplicity yields unmatched speed, battery efficiency, and auditable security, alongside distinct trade-offs: UDP-only operation, no built-in camouflage, and no integrated key distribution. Below is an overview of how it works and how it became the foundation of modern VPN architectures.

Design philosophy: building a VPN that acts like a network interface

Before WireGuard, the dominant enterprise solutions were IPsec and OpenVPN. IPsec is an enormous family of standards with notoriously brittle cross-vendor interoperability; OpenVPN runs in userspace, relies on heavy OpenSSL libraries, and suffers performance bottlenecks from repeated context switching.

WireGuard took the opposite approach: do one thing and do it cleanly. To the operating system, it presents itself as a standard virtual network interface (such as wg0). You configure the interface with your private key and a list of peer public keys with their permitted IP prefixes. Sending packets to the interface encrypts and emits them over UDP; arriving packets are authenticated, decrypted, and delivered into the networking stack. All peripheral tasks—routing tables, firewall rules, and IP allocation—are delegated to standard OS networking utilities.

Cryptokey Routing: mapping public keys directly to IP addresses

WireGuard's core architectural concept is Cryptokey Routing: every peer is identified exclusively by its Curve25519 public key, and each public key is associated with a list of AllowedIPs.

Outbound routing: when a packet enters the wg0 interface with destination 10.0.0.5, WireGuard consults its internal table. If peer A's configuration includes 10.0.0.5 in AllowedIPs, the packet is encrypted with peer A's session key and sent to peer A's current endpoint.

Inbound verification: when an encrypted UDP packet arrives from the network, WireGuard decrypts it, inspects the inner source IP, and checks whether that source matches the AllowedIPs assigned to the peer whose key authenticated the packet. If it matches, the packet is accepted; if not, it is silently discarded.

This design eliminates complex packet filtering rules within the tunnel layer, acting like a cryptographic routing table where identity and addressing are inseparable.

The Noise protocol handshake and connectionless roaming

Handshake: based on the Noise Protocol Framework (Noise_IKpsk2), WireGuard completes a secure authenticated handshake in a single round trip (1-RTT: one initiation packet, one response packet). If pre-shared symmetric keys are configured, it adds post-quantum resistance.

Stateless appearance: WireGuard maintains no persistent connection state machine. If no traffic flows, the tunnel stays completely silent without sending keepalives (unless explicitly enabled). When data arrives, a handshake completes immediately.

Silent to unauthorised probes: WireGuard interfaces never respond to unauthenticated packets. Port scanners probing a WireGuard listening port receive zero response, appearing completely closed or non-existent.

Seamless roaming: the handshake binds to public keys rather than IP addresses. When a laptop moves from office Wi‑Fi to a mobile phone hotspot, WireGuard updates the peer's observed endpoint automatically from the first authenticated incoming packet, continuing the session without renegotiation.

Fixed cryptographic suite: eliminating cipher negotiation

Traditional protocols offer dozens of configurable encryption algorithms and hashing functions. Cipher negotiation adds round trips, code bloat, and the risk of downgrade attacks where adversaries force weaker algorithms.

WireGuard eliminates negotiation entirely by locking into a single, modern suite: Curve25519 for ECDH key exchange, ChaCha20 for symmetric encryption, Poly1305 for message authentication (AEAD), BLAKE2s for hashing, and SipHash24 for hashtables. If an algorithm is ever compromised in the future, the protocol will publish an updated version specification rather than introducing runtime negotiation flags.

From a solo project to the Linux kernel: evolution timeline

  • 2015–2016: Jason A. Donenfeld begins developing WireGuard, presenting academic papers detailing the architecture and formal protocol verification at NDSS 2017.
  • 2018: Linus Torvalds publicly praises the codebase on the Linux Kernel Mailing List, calling it a “work of art” compared to OpenVPN and IPsec.
  • March 2020: WireGuard is merged into the upstream Linux 5.6 kernel, releasing version 1.0.
  • 2020–2021: FreeBSD and OpenBSD add kernel-level implementations; Windows receives the high-performance WireGuardNT kernel driver.
  • Commercial adoption: Cloudflare adopts WireGuard for WARP; Tailscale builds its overlay mesh on top of WireGuard; mainstream VPN providers deploy it under proprietary branding (such as NordLynx).

Limitations and considerations on restricted networks

  • UDP dependency: strict corporate or hotel networks often throttle or block non-standard UDP traffic. When UDP is suppressed, WireGuard cannot connect.
  • Lack of obfuscation: WireGuard packet headers have distinct, static signatures. Deep packet inspection firewalls readily detect uncamouflaged WireGuard handshakes on cross-border links.
  • Privacy and static IP mappings: standard WireGuard servers retain client public keys and last-seen endpoints in memory, requiring additional automation for zero-log compliance.
  • Domestic vs cross-border: WireGuard excels for domestic device interconnectivity (such as home NAS access), while cross-border traversal in adversarial environments requires obfuscated protocols like Hysteria2 or AnyConnect over TLS.

Where WireGuard is used in LeoTun

LeoTun's Private Network method uses Tailscale, where WireGuard forms the entire data transport layer. Tunnels between your devices and regional exit nodes rely on WireGuard for end-to-end encryption. You never need to manage keys or write configuration files manually—the client orchestrates everything upon logging into your account. Installation steps are detailed in What the Private Network (Tailscale) Is, accessible on the Private Network page.

Alongside the Private Network, your single account includes alternative protocols independent of UDP: Cisco AnyConnect over TLS, OpenVPN over TCP, and Traffic Camouflage (Hysteria2) for lossy lines. When a network restricts UDP, simply switch to an alternative method as outlined in Which Connection Method Fits Your Needs.

FAQ

Is WireGuard better than OpenVPN?

On clean networks without UDP filtering, WireGuard is substantially faster, lighter on CPU/battery, and seamlessly survives network handoffs. OpenVPN remains preferable when TCP transport is required, when authenticating via username/password, or on legacy embedded systems. Both are mature, secure, open-source standards.

How secure is WireGuard?

WireGuard employs state-of-the-art cryptography with formal mathematical verification, and its compact codebase makes auditing straightforward. It has no known protocol vulnerabilities. Security relies on safeguarding your private keys and ensuring correct AllowedIPs mappings.

Why does WireGuard only support UDP?

Running TCP over TCP (TCP meltdown) causes severe performance collapse during packet loss as both layers retransmit simultaneously. UDP also enables stateless zero-response probing defenses and effortless roaming. The trade-off is vulnerability to networks that filter UDP.

Does WireGuard work in China?

For direct domestic peer-to-peer connections (such as reaching home equipment from your phone), it works well. For direct cross-border transit, uncamouflaged handshakes are vulnerable to detection and throttling. Cross-border use requires TLS-based or camouflaged alternatives.

Who created WireGuard and when did it join the Linux kernel?

WireGuard was designed by Jason A. Donenfeld, published around 2015, and officially integrated into the mainline Linux 5.6 kernel in March 2020.

Is Tailscale the same thing as WireGuard?

No. WireGuard is a point-to-point cryptographic tunnel protocol. Tailscale is a complete mesh networking architecture that uses WireGuard for data transport while handling SSO authentication, automatic key rotation, IP management, NAT traversal, and relays. See How Tailscale Works.

Do I have to generate keys myself to use WireGuard?

Raw WireGuard requires manual key generation and configuration editing. When using Tailscale or managed services, client applications handle key generation and exchange automatically upon account sign-in.

Related pages