
WireGuard always says it is active after you start it and never reports a failed connection. Only the latest handshake tells you.
Unlike other VPNs, WireGuard has no "connection failed". Activating only builds the adapter and the routes; the real conversation starts with the first packet that has to go out. So a green dot is not proof, and neither is the key icon on a phone. Look at "latest handshake" in the client and in sudo wg show on the server.
In this order
- TCP opened insteadSecurity group, router and ufw all need UDP
- Keys swappedYour [Peer] holds the other side's public key
- Wrong EndpointIP changed, a digit missing, the name points to an old address
- Nobody speaks firstThe side behind NAT needs Endpoint and PersistentKeepalive
- Clock is wrongIf time jumped back, handshakes are refused as replays
- UDP blockedIf a phone hotspot works, it is the line
- One key, two devicesThey steal the connection from each other

Do packets arrive?
sudo tcpdump -ni any udp port 51820| You see | Meaning |
|---|---|
| Nothing | It never arrived: security group, port mapping, carrier |
| Only incoming 148 bytes | The server does not know you: public or preshared key |
| 148 in, 92 out | Handshake done; look at routing and forwarding |
The first handshake packet is always 148 bytes and the reply 92, so lengths show how far you got.
The clock is easy to miss
A Raspberry Pi without a battery goes back in time after a power cut. Handshakes carry a timestamp and the server refuses anything older than it has seen. Sync the time before starting the tunnel.

One complete search
A new server; the phone scanned the code, pages do not open, received 0 B. First see whether the server listens:
sudo wg show
sudo ss -lunp | grep 51820listening port: 51820 and 0.0.0.0:51820 mean it is ready. No output at all: the interface never came up, read journalctl -u wg-quick@wg0 -n 30.
Second, capture packets while switching the phone off and on. It retries every five seconds:
IP 203.0.113.50.38211 > 10.0.0.4.51820: UDP, length 148
IP 203.0.113.50.38211 > 10.0.0.4.51820: UDP, length 148Only incoming: the network is fine and the server refuses to answer. Leave the firewall alone and compare keys. The public key shown on the phone must stand in the server's [Peer]; sudo wg show wg0 public-key must stand in the phone's. A lost equals sign is enough to fail. PresharedKey must be identical on both sides or absent on both.
sudo wg syncconf wg0 <(sudo wg-quick strip wg0)Three things missed on cloud servers
- The security group and the system firewall are two doors; both must be open.
- The rule was made for TCP, which many consoles choose by default.
- The public IP is not on the adapter. Endpoint needs the public one; nothing else cares.
A server at home
Check that the port forward still points to the right internal address; give the machine a fixed one. And test from outside: many routers cannot loop back to your own public address. Use the phone on mobile data. How to see whether you have a public address is in no public IP.
It worked, then stopped
Handshakes renew about every two minutes, and only with traffic. "An hour ago" just means nothing was sent; ping the other end and the time changes. If it does not, the public IP changed, the router forgot the connection, or the interface did not start after a reboot:
sudo systemctl enable wg-quick@wg0All firewalls are off and it still fails.
Go back to the capture. If nothing reaches the server, its firewall is not the cause.
Does another port help?
Sometimes. Some networks only pass well-known ports; try UDP 443.
The log repeats "Handshake did not complete after 5 seconds"?
One packet every five seconds and no answer. The log cannot say why; capture on the server.
The same profile works on another phone?
Is that one still connected with the same key? And is this phone's clock right?
WireGuard in Docker, where do I capture?
On the host. If it arrives there and the container is silent, check that the mapping says 51820:51820/udp.


