-
Notifications
You must be signed in to change notification settings - Fork 822
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
Networking mirrored, WSL2 and the host machine are unable to access each other's services bidirectionally. #11600
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease 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! Open similar issues:
Closed similar issues:
|
Here are the collected logsHere are the collected logs. I have reviewed the above-mentioned issues, and they do not match my problem. Additionally, I just tested on another computer on the LAN, and it can access both 10.0.0.140:6000 and 10.0.0.140:47990 simultaneously. |
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running. Diagnostic information
|
Sorry, this is new logs |
Diagnostic information
|
I changed the network mode to NAT, but it failed to start with the error When I switched the network mode back to mirrored, something even stranger happened: computers on the LAN can no longer access port 6000 either. Additionally, the ifconfig command fails to retrieve the host machine's IP 10.0.0.140. WslLogs-2024-05-19_18-43-38.zip # ifconfig
br-9154cb03c575: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:03:3c:9f:34 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a2:1c:04:f5 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1580 (1.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1580 (1.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth421c985: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ce:9d:61:e0:0b:48 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vethaa81b74: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ee:05:7d:59:f8:eb txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 180 (180.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# echo "LOOPBACK: " $(ip r list table 127)
Error: ipv4: FIB table does not exist.
Dump terminated
LOOPBACK: |
An HNS error seems to be causing WSL2 to fail to start. Adding network tag Diagnostic information
|
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease 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! Open similar issues:
Closed similar issues:
|
/question |
Diagnostic information
|
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease 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! Open similar issues:
Closed similar issues:
|
if fix this by #11389 |
An HNS error seems to be causing WSL2 to fail to start. Adding network tag Diagnostic information
|
Hi. Can you please collect networking logs by following the instructions below? |
of course, this is logs I investigated and found a temporary solution. After turning on the system's mobile hotspot on Windows, there was no problem with the communication between WSL and the host, and I repeated this solution at the end of collecting the logs. But I don't know the specific reason, I hope I can give you some clues |
Diagnostic information
|
this may have somthing to do with switching the primary network stack around. the issue started for me when I had to disconnect my cabled eithernet and switch to wifi/hotspot when my interenet was down. When the internet came back up and I changed the network back to wired eithernet I was no longer able to connect from windows to any wsl instance. The really weird part is WSL can still get to the internet, other WSL instances and external systems can still connect to WSL. networkmode=mirrored both ufw and windows firewall were down. If I switch WSL to NAT I can get from windows to wsl but remote system can no longer connect to wsl. and wsl can not connect to WSL. |
I had the same problem, and the workaround I found was to turn on the hotspot on my computer in mirror mode, and everything worked fine. you can try it |
I found I was able to "fix it" with npcap from wireshark. I'm guessing there is something screwed up in the bowels of the tcp/ip stack for local loop back ... for now I built myself a tool I can leave in the system tray and can activate when I need wsl/docker to work locally (I could also switch from mirrored to nat... but then I can't access it remotely.) It would be nice to get an actual fix but yet another workaround is as good as anything else I guess (I've tried several of the other workarounds but they didn't work for me.) |
I encountered the same problem, turning on the mobile hotspot or using wireshark to capture the local loopback port can work |
@KingOfGitH thanks for attaching logs, sorry for the delay following up on this could you please collect WslNetworkingLogs, using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 ? please refer to the instructions at https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues |
I have collected the logs, but unfortunately, there doesn't seem to be any useful content. The only thing I can do is use curl on WSL to access the following existing services on Windows and wait for a timeout. Then, I repeated the operation after turning on the mobile hotspot, proving that access is possible. |
Diagnostic information
|
@KingOfGitH thanks for following up. It looks like you collected logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1 instead we need logs using https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1 could you please collect logs using the second script? thanks |
No problem! Here’s the translation: I apologize for previously missing this part of the log collection. The collected logs are quite large,. I initially planned to send the logs as an email attachment. However, during the process, the file was uploaded to OneDrive and couldn't be converted into an attachment. Please check if you can access the logs using this link. If not, I will consider how to convert the link into an attachment. Thank you. https://1drv.ms/u/c/cbedb7e1d4315f17/EYBGk57fS4pFgq01gX4fQ20B3UagrzgBYv-zsewSj8-c8A The main operations were as follows: First, I used the Windows Then, I used the WSL Finally, after turning on the mobile hotspot, I used the WSL |
I have the exact same issue. The workaround of turning on the hotspot works for me, but I am curious why is this happening? |
Windows Version
Microsoft Windows [版本 10.0.22631.3527]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
NONE.
This network issue is not related to Docker. I am using python3 -m http.server 6000 to set up a simple service, and the Python version is 3.10.12.
Repro Steps
Set .wslconfig:
Turn off the WSL2 firewall.
Turn off the Hyper-V firewall.
Open port 6000 on the Windows Firewall.
I even tried turning off the entire firewall and restarting the computer.
Run
A service is running on the same host machine with port 47990, and WSL2 tries to access this service.
Expected Behavior
Actual Behavior
Diagnostic Logs
To be honest, I can't even determine the IP or other handles of Win11 and WSL2, which renders my network troubleshooting experience useless. I will try to troubleshoot further and send an email later.
The text was updated successfully, but these errors were encountered: