-
Notifications
You must be signed in to change notification settings - Fork 836
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
No Internet when winnat stop/started #9418
Comments
Thanks for reporting this @foremtehan. WSL uses HNS for NAT networking, which relies on winnat. I'm guessing that restarting winnat will drop all the port reservations which will effectively break any running WSL2 distribution. |
Ok how do i solve Every solution on internet require restarting pc or restarting winnat |
I am having the same problem which is also talked about in this thread. |
Any solution to this? This seems to permanently break the WSL because rebooting and restarting wsl.exe doesn't work. |
FYI, this solution in #3438 worked for me. For whatever reason, you have to make sure to actually restart instead of shutting down and powering back on |
What @Ai-Yukino wrote above leads to instructions to reset your entire network configuration. This doesn't work, and especially is no solution to WSL network connectivity issues (typically of the type, DNS works, but ICMP, TCP and UDP don't) after restarting the WinNAT service, which is a common solution for freeing a listen port that it is hogging for some reason, so that a Windows application may use it. Since I find it beyond annoying to have to go hunt for solutions and a non-solution (generic nuclear option of "just reinstall" or "just reset to default settings") being offered in all the popular internet search results, here's the correct solution. Requires no reboot or reconfiguring all of your network settings, either: After restarting WinNAT with You're welcome. |
Thanks for providing correct solution @dori4n ! I appreciate it |
Version
Microsoft Windows [Version 10.0.19044.2364]
WSL Version
Kernel Version
5.10.16
Distro Version
Ubuntu 22.04
Other Software
Docker Desktop (Engine) v20.10.17
Repro Steps
I was on the stackoverflaw for solving this problem:
bind: An attempt was made to access a socket in a way forbidden by its access permissions
I ran:
The issue will go away but the WSL's internet interrupted and i have to reboot the pc
First, Can you tell me why the first error happens? It occur when the windows restarted, The second one cause by the 1st solution :(
Expected Behavior
Having Internet on WSL after stop/start winnat
Actual Behavior
No Internet After:
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: