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

WSL2 IPv6 services not exposed on IPv4 #6387

Closed
timriker opened this issue Dec 30, 2020 · 5 comments
Closed

WSL2 IPv6 services not exposed on IPv4 #6387

timriker opened this issue Dec 30, 2020 · 5 comments

Comments

@timriker
Copy link

I could not find this issue open anywhere else. There are a lot of localhost services that beat around this issue, but I didn't find one that deals with it directly. I suspect a few of the other tickets would be resolved if this underlying issue were resolved.

Environment

Windows Microsoft Windows [Version 10.0.19041.685]
Ubuntu 20.04 under WSL2
$ cat /proc/version
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020```

Steps to reproduce

Apache and other services that listen on :: for IPv4 and IPv6 support are not reflected in windows localhost under both IPv6 and IPv4.

Apache normal config of
Listen 80

results in netstat output of:
tcp6 0 0 :::80 :::* LISTEN -

NOTICE THAT THERE IS NO IPv4 LISTEN entry.

Then curl.exe under windows:

$ curl.exe -svI -m 2 http://127.0.0.1/
*   Trying 127.0.0.1:80...
* TCP_NODELAY set
* Connection timed out after 2008 milliseconds
* Closing connection 0

However this works:

$ curl.exe -svI -m 2 http://[::1]:80/
*   Trying ::1:80...
* TCP_NODELAY set
* Connected to ::1 (::1) port 80 (#0)
> HEAD / HTTP/1.1
> Host: [::1]
> User-Agent: curl/7.65.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Wed, 30 Dec 2020 22:37:10 GMT
Date: Wed, 30 Dec 2020 22:37:10 GMT
< Server: Apache/2.4.41 (Ubuntu)
Server: Apache/2.4.41 (Ubuntu)
...

Changing the Apache config to include:

Listen 127.0.0.1:80
Listen [::1]:80

Means that apache unnecessarily listens on both IPv4 and IPv6 localhost and both ports get forwarded to windows correctly.

I have NOT been able to find an Apache syntax that forces Apache to listen on both IPv4 ANY (0.0.0.0) and IPv6 ANY (::) at the same time.

curl inside the windows instance is able to connect on IPv4 and IPv6 using the default "Listen 80" configuration.

Note: Only port 80 is shown here, but this same issue affects port 443 listeners.

WSL2 should connect IPv4 AND IPv6 forwarding for any WSL2 IPv6 listeners.

@therealkenc
Copy link
Collaborator

therealkenc commented Jan 5, 2021

dupe #4851

@ghost
Copy link

ghost commented Jan 5, 2021

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 Jan 5, 2021
@ghost ghost added the duplicate label Jan 5, 2021
@timriker
Copy link
Author

timriker commented Jan 6, 2021

@therealkenc
Both of the listed "duplicates" are referencing outbound IPv6 requests. This ticket is dealing with listening services inside the WSL2 instance.
These are not duplicates of this issue. Please reopen this ticket.

@therealkenc
Copy link
Collaborator

#4851 (nc :: 8080 -l inside WSL) is inbound. Will edit out the other.

@timriker
Copy link
Author

Yes, this does appear to be a dupe of #4851. Thank you for the pointer.

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

2 participants