WireGuard: “sendto: Required key not available”
WireGuard troubleshooting
Updated
What you see
You ping or connect to an address through the tunnel and the command fails at once, without waiting for a timeout:
ping: sendto: Required key not available
What it means
WireGuard decides which peer gets a packet by looking at each peer's AllowedIPs list — its routing table and its access list in one. If the destination isn't in any peer's AllowedIPs, WireGuard has no key to encrypt the packet with and refuses to send it. The error comes from the machine doing the sending, before anything reaches the network.
Quick fix
Run sudo wg show and compare the AllowedIPs of the peer you want to reach with the address you're pinging. Add the missing address or subnet, then reload the interface.
Causes and how to fix them
1. The destination isn't in the peer's AllowedIPs
The most common cause. If a peer has AllowedIPs = 10.8.0.2/32, only that one address goes to it; pinging 10.8.0.3 fails with this error. To send everything through a peer, such as a VPN server, use 0.0.0.0/0. Look at what each peer allows:
sudo wg show
2. A /32 where you meant a whole subnet (or the reverse)
/32 means exactly one address and /24 means 256. Writing 10.8.0.1/32 and then trying to reach other machines behind that peer fails here. List the subnet you want reachable instead: AllowedIPs = 10.8.0.0/24.
3. The peer was never loaded
Editing wg0.conf doesn't change a running interface. Apply the file without disconnecting everyone:
sudo bash -c 'wg syncconf wg0 <(wg-quick strip wg0)'
Or restart the interface, which briefly drops all peers:
sudo wg-quick down wg0 && sudo wg-quick up wg0
4. Two peers claim the same address
An address can belong to only one peer. If two [Peer] blocks list the same AllowedIPs, WireGuard gives it to the one configured last, and the other silently loses it. Give every device its own tunnel address.
Using Nullsify?
Nullsify gives every device its own tunnel address and adds it to the server without restarting the interface, and its client configs route all traffic (AllowedIPs = 0.0.0.0/0), so you shouldn't meet this on a Nullsify server. If you do, the config was probably edited — get a fresh one with Get Config.
Free for 1 server. Bring your own VPS — Nullsify configures WireGuard, AmneziaWG or VLESS on it for you.
Related problems
- Handshake did not complete WireGuard
- Connected but no internet WireGuard
- My IP address doesn't change Leaks and blocking