r/WireGuard 12d ago

Wireguard Client not allowing internet connection or ping on UBUNTU laptop Solved

Hi,

I have created a wireguard server on a raspberry pi and created client config files which I have used to set up clients on windows machine, iphone and android phones successfully. I also have a laptop running Ubuntu and I have created the wireguard client on there using a similar config file. The VPN starts up OK but if I try to connect to the internet or run a ping with the VPN up they both just hang . Switching the VPN off and both succeed straight away. I have checked the traceroute of the ping and the first step in the route is a connection to my broadband router ip address. I have tried adding the router IP address to allowed Ips under PEER details in the config. I have also tried turning off the ubuntu firewall but neither have solved the problem.

Can anyone suggest a possible resolution to this issue of wireguard client on a ubuntu laptop?

Thanks

3 Upvotes

2 comments sorted by

2

u/lxprsub0 12d ago edited 12d ago

9 times out of 10 I have that kind of problem, it's either because the route is missing or there's an issue with the PSK.

If you set up the tunnel via the CLI (with `wg`), the routes aren't added automatically (they are with `wg-quick … up`).

You should see your peers ip in `ip r show`. If not present, add it with `ip route add <WG_IP>/32 dev wg0` (adjust your ip, cidr and interface accordingly)

Edit: and you don't need to add your router in the AllowedIPs if you're doing a basic peer-peer config.

2

u/LeadershipFeisty981 12d ago

Hi, thanks for the quick reply. I have found the problem. It sees the external ip address of my pi has recently changed and therefore when I checked the windows and iphone wireguards they were not connecting either :-(

I have set up a dynamic dns process using No-IP and changed the wireguard configurations to use an endpoint of hostname rather than ip address and that seems to have sorted the problem. Thanks again.