Hello, I am struggling to understand why I do not have internet connectivity on my ubuntu laptop using wireguard VPN client. I have connected the laptop to OpenWrt router which gets its internet connection from a 4g modem. If I disable the VPN client on the laptop, I do get internet connectivity, if I use OpenVPN on the laptop I still get connectivity. Bear in mind I have not set VPN on the router at all, I am only using VPN clients on the end device.
I have noticed that using WG I still connect to the selected VPN server, but pinging google.com returns results very slowly, once every 5 seconds (interestingly, ping still shows as 50ish ms, though it is definitely more like 5000ms).
I tried connecting to a VPN server using a Windows PC - I get the same issue - connected to the server, but endless browser loading etc. basically no connection.
I then connected to a VPN server using the Android phone wirelessly connected to the same router with the 4G modem - this time WG worked and I had connection.
I am completely baffled what might be causing this and most of all why would the android device work while the others won't.
Connecting the laptop to the same OpenWrt router with wan port connected through a cable and running WG works just fine. It is only when I try to enable WG while the router gets its connection through wwan.
Many cellular ISPs do not provide a public IPv4 address. This is a requirement if you are attempting to connect via IPv4...
To find out if you have a public IP, take a look at the "IPv4 upstream" section of the LuCI main status page. Compare that against the result when you google "What's my IP"
If they do not match, you don't have a public IP. If in doubt, please post the first to octets of the IPv4 upstream (in bold: aaa.bbb.ccc.ddd).
I am using a VPN provider (NordVPN), so I try to connect to said provider's servers. Indeed the IP4 I get from cellular network provider is not public.
Also, NordVPN are using nordlynx which is wireguard in essence but I do not know how to find the configuration on ubuntu, as it is not in the wg folder.
It should however be routing the traffic through VPN as I can connect normally to the VPN server when connected to the OpenWrt non-4G network (ie when disabling the wwan and plugging the wan cable back in).
But I do not think that the problem is the IP4 - I have used the same sim card on my android phone and when switching the hotspot on and connecting to it using the same laptop, I can enable WG and have connection. I believe it must be something I am missing on the router that is interfering somehow but then again the android simless phone connected by wifi to the router has WG connection.
Ok... my apologies for the incorrect interpretation of your situation, a public IP is not required (@VA1DER was correct).
Let's take a look at the router's configuration
Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
Without that configuration, it's really hard for us to do much to diagnose the issue. I will say it doesn't sound like an OpenWrt issue.
If we could tweak the configuration, we could set it up to exclude certain IP addresses from being routed through the VPN so we could compare pings out through the VPN with pings direct to their destination while the VPN was connected. We can't do that, though. I'm sorry, I really think you'll have to take this to NordVPN for resolution. Or find out if it's possible to tweak their configuration, or use a vanilla Wireguard client.
I'd agree but then again, I have just transferred the SIM card back to my android phone, switched mobile hotspot on, connected to the phone on my laptop, then turned the VPN client with WG ON, and there is connectivity. That is why this problem is so bizarre. Maybe the problem lies with the 4g modem?
By the way, before switching to modemmanager, I tried connecting using qmi protocol, overall I could get online and WG worked on qmi, but I had some other issues with the modem that I could not resolve (basically if I had to change a setting I had to completely unplug the entire system from the plug before changes could be saved), there is a separate topic on that, though I do not think I will be going back to qmi.
You were right all along, though for the wrong reasons - it is the IP address that caused this issue. It turns out NordVPN does not support IPv6, hence by switching the modem to IPv4 only, I managed to stay online while connected via Wireguard.
I feel so stupid, it should be one of the first things I checked. Oh well. I guess troubleshooting is always a pain and I never seem to be able to start with the obvious things, I just like getting deeper down a rabbit hole that does not even exist.