-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL version 2 has no network connectivity, version 1 works alright #11061
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
If you add /logs and version information I will re-open and forward to the networking folks. |
WslLogs-2024-01-24_14-58-34.zip |
And just now I did add a WSL Version info. Please open the issue. |
Looks like you're using inbox WSL2. Do you get the same result if using WSL2 from the store? |
@pmartincic it's the same issue:
|
Hi. Can you please collect networking logs by following the instructions below? |
WslNetworkingLogs-2024-01-30_09-59-55.zip |
@pmartincic I'm having the same issue WSL version: 2.0.14.0 |
Copying in my comment from #4731 to add context, a workaround and suggested solution. I am experiencing the same issue on Windows 11 build 22000.3296 with WSL version 10.0.22621.2860 (WinBuild.160101.0800) and kernel version 5.10.102.1. I have isloated the problem and found a (bad) workaround. The issue is that the Hyper-V Default Switch used for WSL2 NAT networking selects/uses the wrong uplink interface, consistently. In addition to a few different VPN interfaces (not relevant), I primarily use the on-board Ethernet interface for networking. I also have a PCIe-connected Wi-Fi card installed, which WSL2 consistently uses as the uplink interface (even when it is not connected to a Wi-Fi network) for reasons unknown to me. List of things I have attempted which made no difference at all and did not solve the issue:
Workaround:
It is surprising to me that there is no option to select desired uplink network interface for the Hyper-V Default Switch or NAT solution. This would solve the issue. |
thanks for reporting the issue and attaching logs. sorry for the delay following up on this the issue is caused by the WinNat driver that WSL uses when networkingMode is NAT - in this case WinNat selected an incorrect source IP address when NAT-ing traffic from WSL. It selected as source IP 10.100.100.248 from the interface with alias "Ethernet", while it should have picked an IP address that is onlink with the default gateway of this interface (an IP address starting with "192.168") the source IP that is selected by WinNat may be impacted by the order in which IP addresses were added - one possible mitigation you can try would be to delete one of the 192.168* IP addresses from the "Ethernet" interface, then re-add it. using mirrored networking mode will also avoid this issue - but currently this is only available on Windows 11 |
Got this issue recently on:
WSL Config:
The issue is: The configurations I tried:
Tried about a dozen different threads from stackoverflow, github (mostly this repo), etc. - nothing helped This is my personal device, no special networking configurations ever made (I'm not a networking guy tbh) Using mirrored networking mode fixed the issue for me. Attaching two networking logs while in NAT mode:
WslNetworkingLogs-2024-11-10_20-27-45.zip |
Windows Version
Microsoft Windows 22H2 (19045.3930)
WSL Version
10.0.19041.3636 (WinBuild.160101.0800)
Are you using WSL 1 or WSL 2?
Kernel Version
5.10.102.1
Distro Version
Ubuntu 22.04.3 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64)
Other Software
Docker Desktop (Windows)
Repro Steps
Install fresh Ubuntu from Windows Store after setting default wsl version to 2.
Expected Behavior
I was expecting networking to function normally.
Actual Behavior
No internet connection on any WSL version 2 ubuntu distribution. When falling back to version 1- everything works fine. I tried to change nameserver to 8.8.8.8 as read in some bug reports but that doesn't work.
Diagnostic Logs
No logs needed. Just no network connectivity. When using command "ping 8.8.8.8" it shows --- 8.8.8.8 ping statistics ---
380 packets transmitted, 0 received, 100% packet loss, time 394155ms
The text was updated successfully, but these errors were encountered: