microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.55k stars 823 forks source link

Internet connectivity lost when attempting to connect nordvpn #10834

Open ShakeyPlace opened 1 year ago

ShakeyPlace commented 1 year ago

Windows Version

Microsoft Windows 23H2 build 22631.2787

WSL Version

2.0.11.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.133.1

Distro Version

Ubuntu 20.04

Other Software

nordvpn 3.16.8

Repro Steps

I've tried numerous times Ubuntu 20.04, 22.04. Now i've been reduced to just minimal installations, just wireguard and nordvpn and issue has replicated itself every time. log out of wsl and restart wsl and connectivity returns until I attempt to connect to nordvpn. This behaviour does not occur in Hyper-V or actual installation of Ubuntu.

$ nordvpn connect Connecting to Canada #1569 (ca1569.nordvpn.com) The VPN connection has failed. Please check your internet connection and try connecting to the VPN again. If the issue persists, contact our customer support.

Expected Behavior

In Hyper-V client connects to nordvpn server as normal using Ubuntu. Can continue browsing internet, installing packages, etc.,

$ traceroute www.microsoft.com traceroute to e13678.dscb.akamaiedge.net (23.59.156.241), 64 hops max 1 172.30.128.1 0.289ms 0.344ms 0.306ms 2 192.168.1.254 3.415ms 4.330ms 3.690ms 3 10.145.226.1 4.022ms 5.552ms 4.578ms 4 154.11.11.115 19.660ms 19.163ms 19.956ms 5 154.11.2.185 18.390ms 17.663ms 17.719ms 6 23.203.146.129 38.742ms 62.859ms 26.948ms 7 8

Actual Behavior

VPN connection fails about the time in the process that the handshake should happen. Then no more connectivity until stop wsl Ubuntu client and restart Ubuntu

$ traceroute www.microsoft.com traceroute: unknown host

Diagnostic Logs

WslLogs-2023-11-27_16-25-08.zip

ShakeyPlace commented 1 year ago

Testing with Wireguard as it's a prerequiste for nordvpn. Pretty much same results except wireguard is able to recover ip configuration after connection fails so internet traffic isn't lost, but VPN doesn't connect in WSL2, but works fine in Hyper-V, etc.

ghost commented 1 year ago

I'm looking through your logs, since the logs don't include wsl startup I can't see what networking mode you're using. Did you specify a networking mode in your .wslconfig? Are you using mirrored mode?

Ideally collect the logs from either wsl startup, or before the problem starts.

ShakeyPlace commented 1 year ago

These are the logs for NordVPN

WslNetworkingLogs-2023-11-28_16-52-51.zip

ShakeyPlace commented 1 year ago

These are the logs from wireguard, also won't connect with wsl2 but recovers the connectivity

WslNetworkingLogs-2023-11-28_16-57-13.zip

ShakeyPlace commented 1 year ago

I'll attempt the mirrored mode right away and report back. I was looking at that yesterday evening but I don't believe I ever got around to it.

ShakeyPlace commented 1 year ago

This one should be mirrored mode for NordVPN as long as I set that up correctly.

WslNetworkingLogs-2023-11-28_17-11-52.zip

Is there any method to check if the mirrored mode is working?

ShakeyPlace commented 1 year ago

And this one should have mirrored mode on with dnsTunneling set to true

WslNetworkingLogs-2023-11-28_17-21-18.zip

ShakeyPlace commented 1 year ago

Upate.

This took me a bit to get this far, I'm a novice. but nmcli con up restore my internet connectivity. Unfortunately doesn't help me with why neither one of these VPN clients can connect though. Neither dnsTunneling nor mirrored mode helped but it seems the ethernet adapter (virtual) is just shut down.

Could it be that the clients can't connect because they are using UDP ports? I can't change that. I have been suspecting either the windows firewall or the wsl firewall, but I believe the wsl firewall is disabled and should be usung Windows firewall rules?

CatalinFetoiu commented 3 months ago

thanks for adding the logs - sorry for the delay following up on this

I looked at WslNetworkingLogs-2023-11-28_17-21-18.zip, which has mirrored mode and DNS tunneling enabled

the logs don't show traffic to www.microsoft.com I see traffic flowing back and forth between WSL and api.nordvpn.com

what is the URL or IP address that you are not able to access?