Networking: Handshake for peer did not complete after 5 seconds, retrying (try 2) — WireGuard tunnel never establishes
The WireGuard peers can't complete the cryptographic handshake, so no traffic flows.
Handshake for peer did not complete after 5 seconds, retryingwireguard: Handshake did not completeWireGuard no handshakelatest handshake neverHandshake for peer 1 did not complete after 5 seconds Meaning
Verify both public keys, the peer's endpoint and UDP port, that the server's firewall/NAT allows UDP (default 51820), and that AllowedIPs and clocks are sane. latest handshake missing in wg show means the handshake never succeeded; also lower the MTU if only large packets fail.
Common causes
- Wrong public key or private key mismatch
- Endpoint IP/port wrong or UDP port blocked
- Firewall/security group missing the UDP rule
- NAT/CGNAT with no persistent keepalive
- Wrong or missing AllowedIPs
⚡ Quick fix
- Compare public keys on both sides
- Open UDP 51820 and set
PersistentKeepalive = 25behind NAT - Check
wg showfor "latest handshake"
Detailed fix by platform
Linux
- bash
sudo wg show sudo tcpdump -ni any udp port 51820
How to diagnose
- Keys — Matching?
- UDP port — Reachable?
- latest handshake — Present?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 4-way handshake timeout / Incorrect password Networking: wlan0: WPA: 4-way handshake failed - pre-shared key may be incorrect / WRONG_KEY
- Connections hang on large transfers (PMTU black hole) Networking: SSH/HTTPS connects but hangs on large data — path MTU discovery black hole
- Frag needed and DF set (ICMP type 3 code 4) Networking: ping: local error: message too long, mtu=1500 / Packet needs to be fragmented but DF set
Most viewed in Networking
- Native VLAN mismatch / wrong VLAN, no connectivity Networking: %CDP-4-NATIVE_VLAN_MISMATCH / device on the wrong VLAN can't reach the gateway
- Port err-disabled (psecure-violation) Networking: %PM-4-ERR_DISABLE: psecure-violation error detected on Gi0/5, putting Gi0/5 in err-disable state
- Rogue DHCP server hands out wrong gateway/DNS Networking: Clients receive the wrong default gateway or DNS server — a rogue DHCP server (often a home router) answers first
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026