WireGuard handshake and Linux route investigation cheat sheet
Compare WireGuard peer handshake and transfer counters with Linux routing when a tunnel cannot reach its destination.
Linux with wireguard-tools and iproute2; commands require appropriate permissions and an existing authorized interface.
Updated · WireGuard · 6 min read
| Command | What it does |
|---|---|
sudo wg show wg0 | Inspect peer handshake and counters |
ip -brief address show dev wg0 | Inspect the tunnel interface address |
ip route get 10.20.0.10 | Inspect the Linux route decision |
ping -c 3 10.20.0.10 | Generate an authorized connectivity test |
sudo wg show wg0 transfer | Compare peer counters after testing |
Walkthrough
Replace wg0 and 10.20.0.10 with the approved interface and remote address. Diagnostic traffic reaches the destination; do not share private keys or full configuration files.
Step 1: Inspect peer handshake and counters
sudo wg show wg0
Record the peer endpoint, latest handshake, allowed IPs and transfer counters. A recent handshake establishes key exchange but does not prove that application traffic is routed successfully.
Step 2: Inspect the tunnel interface address
ip -brief address show dev wg0
Confirm that the named interface exists and compare its assigned addresses and state with the approved design. Interface state alone does not prove remote reachability.
Step 3: Inspect the Linux route decision
ip route get 10.20.0.10
Replace the address with the authorized target and check the selected interface and source. Policy routing and the application network namespace can produce different decisions.
Step 4: Generate an authorized connectivity test
ping -c 3 10.20.0.10
Send a small test to the approved destination and record the results. ICMP can be filtered, so a failed ping does not conclusively prove that all application traffic fails.
Step 5: Compare peer counters after testing
sudo wg show wg0 transfer
Recheck peer byte counters after the test. Changes support that some encrypted traffic was exchanged but do not establish that the intended application received it.
WORKED INCIDENT
Practical case: A tunnel handshakes but a service is unreachable
Fictional teaching scenario; observations are examples, not captured production output.
Situation
A Linux client reports a recent handshake but cannot reach a remote internal service.
Investigation sequence
1. Inspect peer handshake and counters
sudo wg show wg0Record the current handshake and transfer counters for the relevant peer.
2. Inspect the tunnel interface address
ip -brief address show dev wg0Confirm the expected tunnel interface and assigned address are present.
3. Inspect the Linux route decision
ip route get 10.20.0.10Check the route selected for the specific remote service address.
4. Generate an authorized connectivity test
ping -c 3 10.20.0.10Send authorized test traffic and compare the resulting WireGuard counters.
Example findings
Illustrative findings: the peer has a recent handshake, but the target route selects the ordinary LAN interface instead of the tunnel.
Interpret the findings
The observed route mismatch is a concrete lead. Handshake success confirms neither the selected application route nor the return path.
Verify the outcome
After the network owner corrects the approved routing configuration, repeat the route lookup and test the actual service.
Escalation handoff
Share sanitized route output, timestamps and handshake and counter observations with the VPN and network owners.
Primary references
Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.