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

Can not access Linux networking apps from Windows with localhost when use IPv6 for port binding #4436

Closed
honking opened this issue Aug 22, 2019 · 5 comments

Comments

@honking
Copy link

honking commented Aug 22, 2019

  • Windows build number:
    Microsoft Windows [版本 10.0.18963.1000]

  • I can connect to the wsl2 with localhost when use ipv6 for port binding

In wsl2

root@DESKTOP-H57S2QH:~# netstat -nlpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:89              0.0.0.0:*               LISTEN      1664/php
tcp6       0      0 :::3306                 :::*                    LISTEN      1134/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      1146/docker-proxy
tcp6       0      0 :::59878                :::*                    LISTEN      1158/docker-proxy

root@DESKTOP-H57S2QH:~# curl -I http://localhost:89/
HTTP/1.1 404 Not Found
Host: localhost:89
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 533

root@DESKTOP-H57S2QH:~# curl -I http://localhost/
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Thu, 22 Aug 2019 09:18:48 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive

In Windows

C:\Users\honking>curl -I http://localhost:89/
HTTP/1.1 404 Not Found
Host: localhost:89
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 533


C:\Users\honking>curl -I http://localhost/
curl: (56) Recv failure: Connection was aborted

C:\Users\honking>netstat -ant | find "LISTEN"
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:1080           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:2179           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:5040           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:7680           0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49664          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49665          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49666          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49667          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49668          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49671          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:49674          0.0.0.0:0              LISTENING       InHost
  TCP    0.0.0.0:55947          0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:89           0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4012         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4013         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4300         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:4301         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:27015        0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:49350        0.0.0.0:0              LISTENING       InHost
  TCP    127.0.0.1:49351        0.0.0.0:0              LISTENING       InHost
  TCP    172.22.160.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    172.24.32.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.25.16.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.28.224.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    172.29.48.1:139        0.0.0.0:0              LISTENING       InHost
  TCP    172.29.176.1:139       0.0.0.0:0              LISTENING       InHost
  TCP    192.168.0.42:139       0.0.0.0:0              LISTENING       InHost
  TCP    [::]:135               [::]:0                 LISTENING       InHost
  TCP    [::]:445               [::]:0                 LISTENING       InHost
  TCP    [::]:2179              [::]:0                 LISTENING       InHost
  TCP    [::]:7680              [::]:0                 LISTENING       InHost
  TCP    [::]:49664             [::]:0                 LISTENING       InHost
  TCP    [::]:49665             [::]:0                 LISTENING       InHost
  TCP    [::]:49666             [::]:0                 LISTENING       InHost
  TCP    [::]:49667             [::]:0                 LISTENING       InHost
  TCP    [::]:49668             [::]:0                 LISTENING       InHost
  TCP    [::]:49671             [::]:0                 LISTENING       InHost
  TCP    [::]:49674             [::]:0                 LISTENING       InHost
  TCP    [::1]:80               [::]:0                 LISTENING       InHost
  TCP    [::1]:3306             [::]:0                 LISTENING       InHost
  TCP    [::1]:59878            [::]:0                 LISTENING       InHost
  • I can connect the ports listen on tcp both on wsl2 and windows , but the ports listen on tcp6 can't
@craigloewen-msft craigloewen-msft added network wsl2 Issue/feature applies to WSL 2 labels Aug 22, 2019
@craigloewen-msft
Copy link
Member

craigloewen-msft commented Aug 29, 2019

Could you please take some networking logs for this issue? It will help us diagnose what's going on.

You can find instructions on how to do so here!

EDIT: I'm also unable to repro your issue. This means it may be related to some config other than WSL.

P.S: I also hope you don't mind that I used your issue as an example for the networking log collection process!

@honking
Copy link
Author

honking commented Aug 30, 2019

Could you please take some networking logs for this issue? It will help us diagnose what's going on.

You can find instructions on how to do so here!

EDIT: I'm also unable to repro your issue. This means it may be related to some config other than WSL.

P.S: I also hope you don't mind that I used your issue as an example for the networking log collection process!

I can not submit the logs by the instructions. The Feedback hub keeps showing "数据尚在收集中。这可能需要一点时间".

After waiting for about 15 minutes, I had to submit it directly.
It seems that only the screenshot was submitted but there is no log.

@craigloewen-msft
Copy link
Member

@honking seems to have worked! I have access to the logs. Thank you!

@therealkenc
Copy link
Collaborator

/dupe #4851

I had glossed this one last August because no repro steps were presented in the OP, but it is clear from the netstat(1) output what is going on. The ngix server is listening on tcp6 [::1]:80 only, so from the Windows side, curl.exe -I http://localhost/ is not going to take.

@ghost
Copy link

ghost commented Sep 3, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Sep 3, 2020
@ghost ghost added the duplicate label Sep 3, 2020
@therealkenc therealkenc added duplicate and removed duplicate network wsl2 Issue/feature applies to WSL 2 labels Sep 3, 2020
@github-actions github-actions bot mentioned this issue May 23, 2024
2 tasks
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants