Skip to content

Lesson 1 of 9 · 20m

The WireGuard Mental Model

WireGuard is not a tunnel daemon with a thousand knobs; it is a routed network interface where identity, reachability, and encryption are all derived from keys.

WireGuard feels strange the first time you operate it because it refuses to behave like a traditional VPN concentrator. There is no complex negotiation, no certificate authority requirement, no catalog of cipher suites, and no dynamic tunnel establishment dialog to debug. A WireGuard interface is simply a network interface with peers attached to it.

That simplicity is not marketing. It is the operational model.

The interface is the tunnel

On Linux, a WireGuard interface appears as wg0 beside eth0 and lo:

$ ip link add dev wg0 type wireguard
$ ip addr add 10.44.0.1/24 dev wg0
$ wg set wg0 private-key /etc/wireguard/private.key listen-port 51820
$ ip link set wg0 up

Traffic enters wg0 because routing says it should. WireGuard then decides which peer should receive the packet by matching the destination address against each peer's AllowedIPs. If no peer matches, the packet does not go out. This is the first mental shift: WireGuard is not “connect and then route”; peer selection itself is tied to routing policy.

Identity is a public key

A peer is not a username. It is a Curve25519 public key:

[Peer]
PublicKey = z8QXf4S0sP+F3U3N0N7m2C+v1kq2Fq9mFvZpY7rYy0Y=
AllowedIPs = 10.44.0.12/32
Endpoint = 198.51.100.24:51820
PersistentKeepalive = 25

The public key is the identity, the encryption endpoint, and the authorization boundary all in one. If a host presents the wrong private key, there is no authentication failure page and no cleartext fallback. It simply cannot complete handshakes.

Crypto opinionated by design

WireGuard uses a fixed modern construction: NoiseIK for the handshake, Curve25519 for key exchange, ChaCha20-Poly1305 for traffic, BLAKE2s for hashing, and HKDF for key derivation. You do not tune these. That removes an entire class of misconfiguration that plagued IPsec and TLS VPNs.

The tradeoff is equally important: if your compliance program requires legacy cipher selection or certificate machinery, WireGuard will not provide knobs just to satisfy the checklist. You solve that with architecture and compensating controls, not configuration sprawl.

Everything else is ordinary networking

Once the encrypted UDP packets leave the host, they are ordinary UDP packets. NAT, firewalls, ECMP, conntrack, MTU, and asymmetric routing still apply. WireGuard does not exempt you from networking; it removes VPN protocol complexity so you can focus on the network you meant to build.

Field notes

  • If wg show has no handshake, debug reachability and keys before touching routes.
  • AllowedIPs is both routing policy and anti-spoofing policy, not a convenience field.
  • WireGuard's silence is deliberate. No handshake means no useful traffic, even when routes look correct.
  • Treat wg0 as a real interface: firewall it, monitor it, and be deliberate about what routes point into it.

Was this lesson helpful?

Sign in to rate