Skip to content

Lesson 3 of 9 · 27m

Routing, MTU, NAT Traversal, and the Failure Modes Nobody Mentions

Debug the practical transport issues — route selection, MTU blackholes, NAT state, roaming endpoints, and asymmetric return paths — before they become outage mysteries.

Most WireGuard problems are not cryptographic. They are packet plumbing problems wearing a cryptographic costume. The tunnel handshakes, the interface is up, and then SSH stalls after the banner, HTTPS loads halfway, or a route disappears when the laptop switches from Wi-Fi to tethering. This is normal network engineering. Treat it with packet captures and route tables, not vibes.

Check the route before checking the tunnel

wg show tells you whether peers handshake and move bytes:

sudo wg show wg0
ip route get 10.20.4.13
ip -6 route get fd44:20::13

If there is no recent handshake, focus on UDP reachability, endpoint correctness, and firewall state. If the handshake exists but traffic fails, focus on AllowedIPs, local routes, forwarding, reverse-path filtering, and return routes.

MTU blackholes are the classic trap

WireGuard encapsulates packets inside UDP, so the inner MTU is smaller than the underlying path. A starting MTU of 1420 is common, but PPPoE, cloud overlays, and nested tunnels can require less. Symptoms include TCP connections that establish and then freeze during large transfers.

Test path behavior instead of guessing forever:

ping -M do -s 1372 10.44.0.1
ping -M do -s 1400 10.44.0.1
ip link set dev wg0 mtu 1380

The right fix may be interface MTU, TCP MSS clamping, or correcting the underlying path. If you clamp MSS, write down why. Future engineers will otherwise inherit a magical firewall rule.

NAT traversal is state management

A client behind NAT usually initiates outbound, so the gateway sees a public source IP and port. PersistentKeepalive = 25 keeps that mapping warm:

[Peer]
PublicKey = gateway-public-key
Endpoint = vpn-gw1.sudosecurity.org:51820
AllowedIPs = 10.20.0.0/16
PersistentKeepalive = 25

Do not enable keepalives globally without reason. They create battery drain, noisy state, and steady traffic on every peer. Use them where NAT or firewall state requires it.

Roaming is a feature with edge cases

WireGuard accepts authenticated packets from changed source addresses, which makes roaming excellent. But cloud security groups, UDP timeout behavior, carrier-grade NAT, and asymmetric routing can still break return traffic. If both sides roam behind NAT without a reachable rendezvous, neither has a stable endpoint. You need a relay, a public peer, or an identity-aware control plane to coordinate endpoints.

Firewalls have two directions and two layers

The host firewall must permit UDP 51820 to the interface, then permit or forward the decapsulated inner traffic according to policy. Cloud network ACLs, security groups, router ACLs, and endpoint firewalls are separate layers. Pass at one layer and deny at another is the normal state of the universe.

Field notes

  • AllowedIPs affects both outbound routing and inbound acceptance; misreading either direction causes hours of confusion.
  • Reverse-path filtering can silently drop traffic on multi-homed gateways.
  • Capture on both the outer interface and wg0; encapsulation can hide where loss begins.
  • A successful handshake only proves recent cryptographic communication, not correct application routing.

Was this lesson helpful?

Sign in to rate