-
Notifications
You must be signed in to change notification settings - Fork 821
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
[WSL2] Possible misconfigured IP address #4192
Comments
Did another shutdown of WSL, then restarted the machine:
(there is no default gateway configured - should there be one?)
But
|
@radu-matei Running Example if you are hosting a node.js service make sure it is available for any IP with the following: var app = connect().use(connect.static('public')).listen(3000, "0.0.0.0"); Source: Stackoverflow If you try accessing your WSL 2 ip on another system on your network it won't work due to issue #4150. Lastly I recommend rebooting your whole system completely, it seems WSL 2 will self heal any mis configured network setting when doing so. Example I messed with the "vEthernet (WSL)" ethernet adapter in "Control Panel\Network and Internet\Network Connections" and when rebooting my PC it restored the settings and my Ubuntu WSL 2 was working again. (It just give me a different IP but a working config at least) One last thing, I recommend trying to ping something from WSL 2. To make sure it can get a connection outbound, such as |
Windows and WSL2 will have two different IP addresses and are connected via the vSwitch named 'WSL'. Just like a full blown VM would be setup. My understanding is that this networking scheme is likely to change in the near future, so that Windows and WSL2 share the same "localhost". I haven't had any problems connecting to WSL2 port from Windows. Actually... you're probably being blocked by the Windows firewall, as WSL2 is considered to be on a "Public Network". You'll need to open these ports manually on the Windows firewall because they are not yet automatically configured upon installation in this early beta release. |
After several restarts and the new build, everything seems to be working fine. |
@radu-matei what do you mean by |
Cn anyone help? I'm new o wsl.... I turned it on and installed Debian command line - from the Windows App (bang up to date system) - I have a general script that installs stuff in BUSTER on Debian systems - so I put in Node-Red, nginx, Grafana etc. When done I could not figure out how to reboot WSL on its own so I rebooted the entire PC. If I go into WSL it looks like NGINX is in place on port 80, Node-Red etc. I cannot access any of this rom outside of WSL - and in Linux if I do NODE-RED-STOP - which should work (the setup for Node-Red usually works) I get: Use node-red-start to start Node-RED again Ideally wtat I'd like is for WSL to have it;s own IP address.. Currently "ip a" in WSL returns: 15: eth0: <> mtu 1500 group default qlen 1 and ifconfg returns: eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 1500 |
I encounter the same problem, did you solve it? |
@Calvin-Dong-007 Try to disable the Windows Defender Firewall for public network. See if it helps. |
Windows and Networking Question: I have Ubuntu 20 with WSL2 on my Windows 10 laptop, I have elasticsearch running on the Windows side, but in order for wsl to access it, I need to disable the Public firewall, I tried adding an exception and turning the firewall back on, but no go, my exception command ran in Powershell as admin was: New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow, but it didn't work. Any ideas? |
i run cmd: New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow result display like this: PS C:\WINDOWS\system32> New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow Name : {db312add-d3ec-4cea-8bee-a907b558292f} but ubuntu can't connet internet. |
This article was just posted by Microsoft a week ago: https://learn.microsoft.com/en-us/windows/wsl/networking Not sure if it helps. |
I initially configured WSL2 on this machine, and networking seemed to work fine (
ip addr | grep eth0
gave me the IP address of the WSL2 VM, and that worked fine for a while).Now,
ipconfig
on Windows returns172.17.178.49
as the IP address of the WSL2 machine:But
ip addr | grep eth0
on WSL 2 returns172.17.178.50
:Currently, I cannot access any ports of WSL from Windows (tried both the IP address returned by Windows, and the one returned by Linux), even though they are accessible on
localhost
from Linux:The text was updated successfully, but these errors were encountered: