-
Notifications
You must be signed in to change notification settings - Fork 826
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
mirrored networking mode doesn't allow host to use IP to reach the service in WSL #11034
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:
|
I believe mirrored has changed to only mirror binds on loopback addresses by default? @keith-horton to clarify here |
That's correct. In order to work around some Docker and namespace issues, by default WSL will only route loopback address traffic to the host (only 127.0.0.1). If you would also like to use the IP address assigned to the host, you can enable that option: hostAddressLoopback. Please see the experimental settings: https://learn.microsoft.com/en-us/windows/wsl/wsl-config#experimental-settings Thanks! |
it's enabled and no go.
|
Sorry, it looks like our documentation is incorrect. I just double-checked the code: hostAddressLoopback must be under [experimental]. I'll look to get our docs fixed. |
I think it's the same problem
I set up this configuration, but I still can't access the docker service mapped port on windows through the local Intranet ip
|
@linG5821 - right:
Thanks! |
But I set hostAddressLoopback to true, I would like to know how to make Windows able to access ports mapped by Docker containers through the Intranet IP, otherwise my colleague will not be able to access the service I started. Thanks! |
Thanks. did you add a Hyper-V Firewall rule to allow port 8888 inbound - to allow non-loopback traffic inbound to the container over that port? |
Sorry ! My firewall is off, but when I tested it today, the problem didn't exist. Last test: The differences between this test and the last one:
I'm confused right now, and it seems like the reboot fixed the problem, but I'm 100% sure I didn't hallucinate the last test |
Thanks for the follow-up. Yes, you must run wsl --shutdown before new settings take effect. Glad it's working now! |
@linG5821 hi, I have a question, how do you resolve the issue? p/s: it pending exactly 30 seconds to resolve, I belive it try to resolve ipv6 first, but I have no idea to disable it, must be a feature in WSL which is trying to support ipv6 |
Windows Version
Microsoft Windows [Version 10.0.22635.3061]
WSL Version
2.1.0.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.137.3-1
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
host: route -4 print
wsl$ ip route
host c:\ipconfig
wsl $ ip addr
Expected Behavior
nc -zv 192.168.1.173 8000 from host to WSL should work when WSL runs the service.
nc -zv 192.168.1.173 8000 from WSL to host should work when host runs the service.
Actual Behavior
doesn't work in either case
Diagnostic Logs
see above.
The text was updated successfully, but these errors were encountered: