Open andyli opened 5 years ago
Could you please take some networking logs for us? Instructions on how to do so are here!
And then post the link to your feedback in this issue so we can easily find it. :) Thanks!
Also for reference for myself and the team this may be a similar issue to https://github.com/microsoft/WSL/issues/4436, however it's different enough since this is accessing an external site.
Here you are: https://aka.ms/AA63cvl
I have same issue. In wsl2, I have a docker of oracle bind to tcp6. From inside wsl2, I can connect with ::1 or 127.0.0.1, which means it is dual-stack. root@cnjiezhou01:/etc# netstat -an | grep 1521 | grep -i liste tcp6 0 0 :::1521 :::* LISTEN root@cnjiezhou01:/etc# telnet 127.0.0.1 1521 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. ^] telnet> quit Connection closed. root@cnjiezhou01:/etc# telnet ::1 1521 Trying ::1... Connected to ::1. Escape character is '^]'. ^] telnet> quit Connection closed.
From the host windows:
C:>netstat -an | findstr 1521 | findstr /i list TCP [::1]:1521 [::]:0 LISTENING
C:>telnet 127.0.0.1 1521 Connecting To 127.0.0.1...Could not open connection to the host, on port 1521: Connect failed
As of right now the Host Network service does not support ipv6 only websites. We've filed this as a feature request with them and we will post any updates on this thread as they become available! Thank you for filing this.
@craigloewen-msft any progress with this? Also I noticed the kernel doesn't have IPv6 enabled. Could you get the kernel bits done first if we're still waiting for underlying platform support?
I don't have any updates for this feature request.
@WSLUser what kernel modules would you like added to the kernel? And what workflows would it enable for you?
Basically anything that lights up usage of IPv6. I'm thinking more of a network pen test perspective using Kali tools but I'm sure there are some more enterprise-y workflows that would benefit as well if hosted on Windows Server 2019. Something that comes to mind is mostly being able to serve up DHCPv6 and DNS from WSL2 for multiple hosts.
@craigloewen-msft could the wsl2 upgrade docs be updated to explicit mention breaking IPv6? I would have probably waited a little longer had I know. Thanks.
@hcooper Yes! I'll add that in, thank you for the suggestion. :)
... Wow... we're in February (nearly 6 months) and this is still an issue? That's disappointing.
In 2020 I would expect "IPv6 first, IPv4 second". Apparently not so at Microsoft. But good to know, so I will not update to WSL 2.
Thanks for this thread - I spent about 45 minutes trying to figure out how to get IPv6 working (I have an IPv6 only site I'm trying to connect to) from WSL 2. Looking forward to seeing the protocol added!
@craigloewen-msft Any update? WSL 2 is coming close to being widely available
We're working on it! This feature won't be available in the initial general release of WSL2. Thanks for your patience here, this is something that we are actively looking into improving.
WSL2 has no ipv6, and mapping to the external network requires port forwarding.
Is there any kind of work around for this? We recently went completely remote at our organization and all access is being handled using Direct Access. Direct Access is completely IP6, which means WSL2 does not have any access to our internal network. I manage several dozen Linux based servers behind the firewall and my workflow has been completely stopped in its tracks. Ansible can't access any of the servers etc... Can I run WSL concurrently with WSL2? Any thoughts or ideas?
Can I run WSL concurrently with WSL2? Any thoughts or ideas?
If you have multiple distros, you can pick and choose which of them uses WSL1 and which uses WSL2. Just do wsl --set-version "Distro name" 2
or wsl --set-version "Distro name" 1
, and wait for the conversion process which can take a while and shows no progress bar (it takes longer or shorter dependent on the amount of data you already have in your distro)
What is worse is that if you are on an IPv6-only network (NAT64 for IPv4 access), WSLv2 has no internet access whatsoever. Is there a timeline on the fix? Microsoft said they are working on it (good) but working on it could mean "will deliver in May 2021 update or even later".
IPv6 is actually a difficult mess, I think Hyper-V needs to learn prefix delegation like VMware and the ISP must provide that (my setup with TunnelBroker didn't). I had managed to make a manual setup, configure router advertisements on the "vEthernet (WSL)" interface and gave the VM an IP address in a /64 I had allocated (and also manually added a route in my Raspberry Pi so packets returning to WSL will reach it)
@paulstelian97 Can you describe more? As I see, in my case host adapter and eth0 in wsl has different ipv6 prefixes. But I didn't manage to setup routing
upd: found your question here https://superuser.com/questions/1545629/how-can-i-give-ipv6-to-wsl2
Is there any ETA for a fix for this? At Facebook, our internal network is mostly IPv6-only (see https://www.internetsociety.org/blog/2014/06/facebook-moving-to-an-ipv6-only-internal-network/) so this issue limits the usefulness of WSL2 in this environment.
@paulstelian97 Can you describe more? As I see, in my case host adapter and eth0 in wsl has different ipv6 prefixes. But I didn't manage to setup routing
upd: found your question here https://superuser.com/questions/1545629/how-can-i-give-ipv6-to-wsl2
I managed to setup routing because the WSL network is part of a /48 that is allocated for my tunnel. That's probably what went wrong in your case.
Unless WSL2 can either use prefix delegation or a bridged adapter you'll have issues (IPv6 doesn't have NAT)
Broken IPv6 is a serious deal breaker for me. I am sitting behind a DS-lite setup, with rather painfull v4. Are there any technical issues that prevent a feature/configuration for bridging the WSL system to the host IF (or rather the bridge over that IF i have anyway for my hyperv VMs)?
Guys, come on! I've updated to w10 2004 only because of WSL2 and I can't connect to most of my intranet? How is it still not solved since first insider builds?? Looks more like a serious bug to me, since almost everybody now uses IPv6 primarily
Guys, come on! I've updated to w10 2004 only because of WSL2 and I can't connect to most of my intranet? How is it still not solved since first insider builds?? Looks more like a serious bug to me, since almost everybody now uses IPv6 primarily
IPv6 is actually hard to do. Hyper-V only has IPv4 NAT support, for IPv6 NAT to be supported you need something else.
I have managed to do a workaround at home for this but what is supported (without the workaround) is IPv6 servers hosted in WSL. That does work just fine via the "automatic port forwarding" that is done for IPv4 as well.
While it is surprisingly difficult to deploy IPv6 to virtual machines (including WSL2) because NAT isn't exactly Kosher in the IPv6 world (and that may be the reason Hyper-V won't support it), it can be done after a lot of work. But I wouldn't be surprised if 20H2 didn't have it; maybe 21H1? It would be nice if DHCP prefix delegation were a thing.
Well, technically i'd argue that there should not be NAT, but the hyper-v host should actually do rfc4389 (https://tools.ietf.org/html/rfc4389) style proxy nd. This is v6 after all...
Well, technically i'd argue that there should not be NAT, but the hyper-v host should actually do rfc4389 (https://tools.ietf.org/html/rfc4389) style proxy nd. This is v6 after all...
Wasn't aware that existed, it's definitely the better path. This would allow it to work in any IPv6 network, including those that only have autoconfig (and router advertisements), like my old mock network via TunnelBroker (my ISP doesn't provide me IPv6, although I'm also in an interesting conundrum in this sense)
I found that WSL2 also does not support dual-stack listeners.
nginx site:
listen [::]:443 default_server ipv6only=off ssl http2;
This creates one listening socket, and it should be reachable on both IPv4 and IPv6. However, in WSL2 this socket is not reachable via IPv4.
I have to use a separate IPv4 socket for the website to be accessible on IPv4:
listen 0.0.0.0:443 default_server ssl http2;
listen [::]:443 default_server ipv6only=on ssl http2;
How does Node support IPv6 automatically when I listen on IPv4? Does it manually create both IPv4 and IPv6 sockets?
Why should listening on [::] include listening on 0.0.0.0? There are systems without IPv4-stack out there (rare, but they do exist). Also, this is the expected case for nginx. Especially since you use ipv6only=on
. It's in the documentation.
And, this doesn't really belong into this discussion.
Why should listening on [::] include listening on 0.0.0.0? Especially since you use
ipv6only=on
. It's in the documentation.
I usually use ipv6only=off
, which works on normal Linux but breaks in WSL2.
This is a deal breaker for me as well... spent countless hours to setup a test laptop to later find out that IPv6 does not work.. Do we have an ETA on this?
Different dynamic IP addresses got by the host Windows, hosted WSL VM and Mobile devices produce a very unpleasant "mixed IP" situation in the home network. In my home network, all laptops are IP6+4, Mobile devices IPV6+4 with "private" Google DNS onfigured,, smart TV IPV4, and Docker IPV6 enabled. and Ubuntu WSL is IPV4 only interconnected. In some places, support IPV6 by 1st customer request is the legal requirement.
Different dynamic IP addresses got by the host Windows, hosted WSL VM and Mobile devices produce a very unpleasant "mixed IP" situation in the home network. In my home network, all laptops are IP6+4, Mobile devices IPV6+4 with "private" Google DNS onfigured,, smart TV IPV4, and Docker IPV6 enabled. and Ubuntu WSL is IPV4 only interconnected. In some places, support IPV6 by 1st customer request is the legal requirement.
Again until it is officially supported (it's WIP) you can always apply a workaround (I have a question on Stack Exchange whose answer contains info on how you can manually work with this; you just need to assign a subnet that is routed to you to the WSL network; or you can install TunnelBroker on WSL if you want to, though that would be a little bit weird)
@craigloewen-msft just wondering if there is a rough ETA or timeline you can provide? Is v6 support something like a month or two out or something to hope for with the 20H2 release, or even further out than that?
Since most systems using WSL 2 probably will be configured using IPv6-SLAAC the easiest solution for IPv6 would be if WSL 2 supports bridging network adapters. And the second option some style of NDP-Proxy. I believe this is similar to what Android/iOS do when using tethering on an IPv6-only network?
WSL2 works like a charm already in bridge mode in my IPv4/IPv6 local network, unfortunately the bridge configuration must be done manually right now, I hope it will be automatic in the future.
@lapo-luchini would you mind pointing out what was necessary? Install the whole HyperV-package?
You can find it here: https://github.com/microsoft/WSL/issues/4150#issuecomment-647704617.
That doesn't give you IPv6 connectivity, does it?
It does, since my router is sending Router Advertisements packets, which get properly received for auto-configuration.
% ping -nc 5 google.it
PING google.it(2a00:1450:400a:800::2003) 56 data bytes
64 bytes from 2a00:1450:400a:800::2003: icmp_seq=1 ttl=120 time=8.50 ms
64 bytes from 2a00:1450:400a:800::2003: icmp_seq=2 ttl=120 time=8.48 ms
64 bytes from 2a00:1450:400a:800::2003: icmp_seq=3 ttl=120 time=8.48 ms
64 bytes from 2a00:1450:400a:800::2003: icmp_seq=4 ttl=120 time=7.54 ms
64 bytes from 2a00:1450:400a:800::2003: icmp_seq=5 ttl=120 time=8.87 ms
--- google.it ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 7.544/8.378/8.877/0.458 ms
And how did you set up your host?
That was (a bit sparse) in the link of my previous comment, but let me recap:
First executing this in admin powershell first in order to configure thw "wsl" virtual switch to bridged mode ("LAN" is how I renamed by ethernet card):
set-vmswitch -name wsl -NetAdapterName LAN
then this in sudo bash:
rm /etc/resolv.conf
cat <<EOF > /etc/resolv.conf
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 2001:4860:4860::8888
EOF
ip addr add 192.168.1.8/24 dev eth0
route add default gw 192.168.1.1
route del default gw 172.23.160.1
(where 192.168.1.8/24 is but the static IP I chose for my WSL2, but YMMV)
Right so, but as pointed out by https://github.com/microsoft/WSL/issues/4150#issuecomment-652174491 this requires a whole lot of other Hyper-V stuff to be installed. Yes, in the end it works. But it's not nice.
However, good seeing how this thread was able to pinpoint the actual issue...which is not that IPv6 isn't supported at all, but how the Hyper-V manages network interfaces (and some stuff that needs to be considered by network setups...too many still live in a NAT-solves-everything-world).
I'm not expert about HyperV (myself, I prefer VirtualBox as being opensource)… but AFAICT WSL2 is always using HyperV and HyperV vSwitches… what is missing to enable bridging is simply the GUI to configure it. So I guess the "important 80%" of HyperV was required already by WSL2.
Anyways… yes, it's a dirty hack. I hope WSL2 offers something like wsl /net:bridge ubuntu
or similar, in the future.
We don't yet have a rough ETA on this item, so please stay tuned. I read the responses on this thread, so thank you for commenting to let us know about the details for why you need IPV6 support. Once we do have a concrete update I'll be sure to post here. :)
let us know about the details for why you need IPV6 support.
Today I upgraded to build 2004 and subsequently updated Docker Desktop to use WSL2 as I've been looking forward to the performance increases: I installed Ubuntu from the Microsoft Store, set it up and then ran sudo apt update
: only for it to fail with fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
.
So why do I need IPv6 support? Just for the basic updating and install Linux software packages as otherwise it's broken on our dual-stack network. [edit: I can confirm I am able to connect to archive.ubuntu.com from a browser on the same host machine ]
@rbairwell Can you try curl -4 http://archive.ubuntu.com/
? I wouldn't expect it to resolve to an IPv6 address if IPv4 is available. Of course it's using the host resolver.
Can you also try the same command on the Windows host? Both with -4 and -6. If on the host the -4 variant doesn't work then you have IPv6-only connectivity on the host, for some reason.
For me it works fine, connects via IPv4.
Hi, @craigloewen-msft , is there any schedule for ipv6 support?
@paulstelian97
I wouldn't expect it to resolve to an IPv6 address if IPv4 is available.
The default in a lot of distributions is to prefer public IP addresses over private. 99% of the time IPv6 is provisioned using public IPs, while 99% of the time IPv4 is provisioned using private. Furthermore, it is also common to prefer IPv6 over IPv4 wholesale when both are public.
In summary: you shouldn't be surprised to see Linux prefer IPv6. :-)
Source: man gai.conf(5) and RFC 3484
As for why WSL should add IPv6? There are homes and offices that are IPv6 only, using centralised NAT64 to get to IPv4. This means that the physical machine will never see or talk IPv4. For all these people WSL 2 is useless.
Your Windows build number: 10.0.18980.1
What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)
I tried to access a ipv6 only website and failed. My commands run in Debian Buster with WSL 2:
The curl command should succeed. Here is the result if I run it in Windows (outside of WSL):
FYI, here is my network interface info: