Skip to content

WSL2 Can't access ports via localhost when using VPN #8905

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

Closed
1 of 2 tasks
scruel opened this issue Sep 28, 2022 · 1 comment
Closed
1 of 2 tasks

WSL2 Can't access ports via localhost when using VPN #8905

scruel opened this issue Sep 28, 2022 · 1 comment

Comments

@scruel
Copy link

scruel commented Sep 28, 2022

Version

10.0.22000.978

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

WSL static IP address: <wsl_ip>

Execute commands in WSL:

  1. Install nodejs and npm
  2. npm i -g docsify-cli
  3. docsify init ./docs
  4. docsify serve docs

Got unexcepted behaviour:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       Timer
tcp6       0      0 :::35729                :::*                    LISTEN      off (0.00/0/0)
tcp6       0      0 :::3000                 :::*                    LISTEN      off (0.00/0/0)

On Windows, open browser, then visit:
<wsl_ip>:3000 => Can load the site
localhost:3000 => Can't load the site

Execute commands in WSL:
python -m http.server 3000

Got excepted behaviour:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       Timer
tcp        0      0 0.0.0.0:3000          0.0.0.0:*               LISTEN      off (0.00/0/0)

On Windows, open browser, then visit:
<wsl_ip>:8000 => Can load the site
localhost:8000 => Can load the site

python3 -m http.server 3000 --bind 127.0.0.1

Got excepted behaviour:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       Timer
tcp        0      0 127.0.0.1:3000          0.0.0.0:*               LISTEN      off (0.00/0/0)

On Windows, open browser, then visit:
<wsl_ip>:8000 => Can't load the site
localhost:8000 => Can load the site

Expected Behavior

.

Actual Behavior

.

Diagnostic Logs

WslLogs-2022-09-28_15-29-59.zip

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

1 participant