Skip to content
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 not taking external connections #10919

Closed
1 of 2 tasks
ning-bao opened this issue Dec 14, 2023 · 7 comments
Closed
1 of 2 tasks

WSL not taking external connections #10919

ning-bao opened this issue Dec 14, 2023 · 7 comments

Comments

@ning-bao
Copy link

Windows Version

Microsoft Windows [Version 10.0.22631.2715]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1

Distro Version

Ubuntu 22.04

Other Software

WSLAttachSwitch
Nginx

Repro Steps

I used WSLAttachSwitch to attach a hyper-v switch to my WSL and it is now accessible from LAN, but the problem is that, whenever I tried to port forward to my WSL(In my router), it would just have no response at all.
image


Expected Behavior

All the ports should've been exposed to LAN and WAN and should be able to be accessed from the internet.

Actual Behavior

I also tried disabling/adding firewall rules but it just didn't work.
image

Diagnostic Logs

No response

Copy link

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:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ning-bao
Copy link
Author

ning-bao commented Dec 14, 2023

To be more specific I did test port forwarding to my other laptop and it was working with no issues so I assume it's not a router fault...

@davea38
Copy link

davea38 commented Dec 14, 2023

I have the same issue. I'm on Windows 10 and I suspect we need the new mirrored networking mode for this. WSL 1 works fine.

Does anyone know when that will be released to the general population rather than being Windows 11 preview specific?

@craigloewen-msft
Copy link
Member

@davea38 this feature is now released to Windows 11 22H2, and so is no longer preview specific!

Please enabled mirrored networking mode, and ensure you have set the right firewall rule to allow connections and this scenario should work. See this doc page for full info.

If you still see an issue after doing so, please reopen or refile this issue. I'll close this one out for bookkeeping purposes. Thank you!

@ning-bao
Copy link
Author

In the case of mirroring, I won't get a real LAN IP address right? I'll need to port forward to my WSL. Are there any ways it could be exposed to LAN directly? As I do have two physical network cables connecting to my computer, and in the meanwhile I do get 2 IP addresses.... For which one is for my Windows distro and I want to use the other one dedicated for WSL. Is it possible?
The situation is I do get internet connection after using WSLAttachSwitch and the WSL is able to be accessed from LAN, using that IP address, but it is inaccessible from WAN, as described... Looks like mirrored networking mode only do port forwarding from Windows to WSL?
Checked this Post but seems not solving my concern... Should I be switching to WSL1?

@ning-bao
Copy link
Author

Very weird the issue has been resolved like magic...? In this case I exposed WSL successfully to LAN and WAN after a blackout... omg

@davormilutinovic
Copy link

davormilutinovic commented Feb 1, 2024

It seems there is a magic repo that has solved, at least problem WSL2 No External Connectivity for me, https://github.com/sakai135/wsl-vpnkit?tab=readme-ov-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants