Trouble with UDP and Wireguard


I recently installed OpenWRT on a GL.iNet GL-B1300 and it has been working great. The only glitch I've been hitting is with tunneling through it via Wireguard.

My laptop is running the client, connecting to a remote wireguard server. To make sure I'm keeping the connection alive, I have the wireguard keepalive set to 10 seconds. Most of the time it works GREAT, excellent throughput, 0% packets dropped.

But then, sometimes, and with no cause that I can see, traffic stops. Doing a tcpdump on the openwrt external interface (ppoe-wan) I see that the router is sending ICMP "udp port 51821 unreachable" messages back to the wireguard server. Port 51821 is the listening port for my client.

I don't know why it suddenly stops passing this traffic. Tearing down and bringing the tunnel back up doesn't fix it. I have to reboot the OpenWRT server. Rebooting the router reliably fixes it.

Is there additional troubleshooting I can do to determine why it stops passing traffic after doing so perfectly all day long? Is there a setting I can tweak (firewall? elsewhere?) that would guarantee this traffic is always passed back to my laptop?

Active Connections (on the Luci summary page) shows 10-11%. Load is is low. Disk space usage is low.

Thank you so much for any pointers or suggestions.

This is openwrt-22.03


Is your wan ip (on the ‘server’ side) changing when the problem starts? This is a common problem and your description suggests that could be the cause (although there may be other things).

I assume you mean the IP I have from my ISP? No, this never changes because 1) my connection has not gone down, and 2) I actually have a static IP from my ISP, so I know it never changes.

Thanks for the suggestion, though!

I don't think you need to configure it on the client.

1 Like

@AndrewZ You can specify it, but you can also leave it blank. I've removed it and allowed wireguard to set it itself. I'll see if that improves anything.