Adding IPV6 support to WSL 2 distros #5855
Replies: 39 comments 109 replies
-
Maybe 3 most important and desperate features are ipv6 full support, fixed ip support (WSL adapter can be fixed and not recreated) and bridged networking (the same ip or under the same router with host) in wsl2. |
Beta Was this translation helpful? Give feedback.
-
Are there any workarounds, however crude, out there? It's become impossible for me to ssh into my home network, as that is only exposed via IPv6... :( |
Beta Was this translation helpful? Give feedback.
-
This is getting beyond a joke. It is 2021 and this issue has been known since 2019. It also means that the Microsoft Defender Application Guard for Microsoft Edge is completely broken for modern networks (IPv6-only). |
Beta Was this translation helpful? Give feedback.
-
I think it's wrong to push WSL2 to end-users while it's still lacking some basic functions like this, which are regressions from WSL1. I was pushed to switch to WSL2 by VS Code and now cannot connect to a lot of my machines.. This is a terrible user experience. |
Beta Was this translation helpful? Give feedback.
-
It was easy to test using Podman run option --network=host, i.e. UDP echo server running as Podman container uses Host WSL VM network stack directly without any bridge. It is beneficial for Podman that the container runs as a slice of the WSL VM instead of process under Docker server. When the echo server is tested using by CURL inside WSL the response is precise as expected from the UDP echo server:
Hostname: MSI-wsl Request Information:
|
Beta Was this translation helpful? Give feedback.
-
Here's an idea. WSL2: ubuntu Run this script on WSL2 instance.
|
Beta Was this translation helpful? Give feedback.
-
Bad news for Microsoft: I finally got end-to-end IPV6 connectivity over WiFi (Technicolor router). After upgrading to Windows 11, the picture became absolutely inconsistent: Microsoft 365 is resolved both as IPV4 and IPV6 addresses. From Windows CMD, I got ping 2620:1ec:21::16 Average 13 ms and from WSL I got "ping: connect: Network is unreachable". On one hand, Microsoft offers new services reachable via IPV6. On the other hands' blocks access to Cloud services due to a lack of IPV6 support. WSL VM itself has an IPV6 address on Eth0. So, why NIC blocks it? |
Beta Was this translation helpful? Give feedback.
-
All the workarounds seem complex, so I ended up switching to WSL1 to get IPv6 support:
Not ideal, but it seems like the best approach for now 😕 |
Beta Was this translation helpful? Give feedback.
-
I attempted a workaround by setting up a wireguard server on the host and in wsl, routing Windows side: [Interface]
PrivateKey = REDACTED
ListenPort = 51000
Address = 10.9.0.2/24
[Peer]
PublicKey = pWFAj6c7ZZ1tdQH1ZizHIMDbzQFRak0ysvhHKo0sAC4= WSL2: [Interface]
Address = 10.9.0.1/24, 2001:8b0:2c1:4b50::2/128
PrivateKey = REDACTED
[Peer]
PublicKey = ihfrkKZKwTWPTnfss1Jgeb/YfeKlAtrRIJkKFVYTX20=
AllowedIPs = ::0/0
Endpoint = 192.168.1.22:51000
PersistentKeepalive = 10 However, it appears the kernel isn't even compiled with routing for IPV6 (not compiled with |
Beta Was this translation helpful? Give feedback.
-
I want to set my servers' sshd to IPv6-only, but since I manage them via Ansible from WSL, this is blocking me, because Ansible connects via SSH. Please fix this regression. |
Beta Was this translation helpful? Give feedback.
-
Need IPV6 support. I'm unable to use curl to install laravel at this point. |
Beta Was this translation helpful? Give feedback.
-
I need IPv6 too, would be great if that would be possible |
Beta Was this translation helpful? Give feedback.
-
flowchart TD
A[network/windows can use ipv6]
A -- no --> B[wsl2 cannot use ipv6]
A -- Yes --> C[network provide dhcpv6-pd?]
C -- no --> D[windows is pro or above?*]
C -- yes --> E[get prefix with dhcpcd in wsl1 and use powershell to provide ra to vethernet_wsl]
D -- no --> B
D -- yes --> F[use bridge** in wsl2]
E --> G[wsl2 can use ipv6]
F --> G
*please proceed to 'yes', if you can use hyper-v on windows home.(is that ok, license-wise?) |
Beta Was this translation helpful? Give feedback.
-
Protip for anyone following this issue: invert it. Ditch WSL, put Linux on bare metal, and put your Windows in a KVM+libvirt VM. Bridged networking for IPv4+IPv6 is straightforward to set up that way. That is, unless Microsoft commits to bridged mode as a supported feature. |
Beta Was this translation helpful? Give feedback.
-
Anything new here? This is actually really important. |
Beta Was this translation helpful? Give feedback.
-
I came to this thread after trying to run sudo apt-get update and a docker package was trying to connect with IP6. I tried disabling IP6 on windows then restarting everything, but as I watch the update it seems like the IP4 from docker gets redirected to an IP6 address. What ended up working for me was altering my networking settings in Windows and changing the DNS servers for IP6 over to the Cloudflare IP6 servers - 2606:4700:4700::1111 and 2606:4700:4700::1001. Now after restarting WSL, the apt-get update works and downloads from the docker repo. Not sure why this works if others in here are saying that IP6 doesn't work - I would guess that somehow Cloudflare is spotting that IP6 is failing and it's redirecting the request back to IP4?? Here is an image of it failing: https://i.imgur.com/NN11nc4.png Here is an image of it working after changing IP6 DNS on Windows: https://i.imgur.com/NUdWETg.png Although looking at the images, the docker update just says 'hit' and not 'get' so maybe it's just failing silently now? Although this page says that this should mean it succeeded in checking against the remote repo: https://askubuntu.com/questions/960575/what-do-hit-and-get-mean-in-the-output-of-apt-get-update |
Beta Was this translation helpful? Give feedback.
-
WSL2 is useless in my team's development workflow since we leverage several cloud providers like fly that use IPV6 only subnets How has this been ignored for 3+ years??? WSL2 is great because of many things like
but falls flat on its face with networking in general, stuff like DNS randomly breaking, no native ipv6 support, and other various quirks It honestly feels like the senior team behind this is just ignoring this and letting the tech debt accumulate until enough complaints build up or a new hire does it for them |
Beta Was this translation helpful? Give feedback.
-
Even NAT66 is better than nothing at all. It has been 3 years, please implement native IPv6 support. |
Beta Was this translation helpful? Give feedback.
-
I am adding my vote to the pile here: WSL2 needs IPv6 support ASAP. |
Beta Was this translation helpful? Give feedback.
-
In the last couple of days, I managed to get ipv6 working by manually injecting some packets. Here's the tool to do it automatically if you want to give it a go: https://github.com/withinboredom/ipv6-wsl/tree/v0.1.0.5 |
Beta Was this translation helpful? Give feedback.
-
Seemingly there is no hope to get a native IPv6 support for wsl2. As far as I know, VMware's vEth has built-in NAT66 support. Is there any way to bridge WSL2 traffic to VMware's vEth (VMNet8) to enable IPv6 support? |
Beta Was this translation helpful? Give feedback.
-
mac address of actual network adapter: AA:AA:AA:AA:AA:AA So .wslconfig is thus:
I can test ipv6 with: It's not the end of the world... but it might be useful for some. |
Beta Was this translation helpful? Give feedback.
-
So does anyone know what is the plan for adding IPv6 support to wsl/wsl2? The IPv6 train is finally starting to take off and it seems MS is left at the station. |
Beta Was this translation helpful? Give feedback.
-
Yeah IPV6 support is more needed. We have started to look into cloud flare zero-trust to connect to our cloud VPCs and the most sensible thing to do is expose things over IPV6 to avoid IP range clashes with all the different VPC. Yes cloudflare has things to help with this but it not seamless. Once you have lots off k8s clusters running IPV4 private space starts becoming a bit limited and planning becomes a nightmare |
Beta Was this translation helpful? Give feedback.
-
I created a hyper-v virtual machine running openwrt x86, wsl2 uses wireguard to connect to openwrt, and set up port forwarding. Now I can access wsl2 using openwrt's ip. |
Beta Was this translation helpful? Give feedback.
-
I edit my .wslconfig and added the lines: networkingMode=bridged Created a External vSwitch connect to my physical lan. If vmware vctl was usefull with my dev workflow (i use testcontainers which required a docker daemon) I whould try it, but wsl2 + docker is the best integrated approach. I would like to have ipv6 support in hyper-v consequently wsl2 as well |
Beta Was this translation helpful? Give feedback.
-
I moved to new place and here isp gives ipv6 address ,windows cmd works but not wsl2 network |
Beta Was this translation helpful? Give feedback.
-
For someone who has mobility needs, so both NAT66 and Bridging (WiFi+Ethernet) mode are required: Someone has created a project WSLAttachSwitch and I've modified it to add the ability to add NICs with static MAC addresses: you can get my modified version here, if the author hasn't merged it yet Then, set up three switches:
Now, you can get native IPv6 address if either wifi or ethernet provides it for free, or use VMWare's NAT66 if not. |
Beta Was this translation helpful? Give feedback.
-
Finally! Microsoft just released WSL 2.0 (in preview), which adds a "mirrored" networking mode.
And that's it, IPv6 now works in WSL! (while WSL 2.0 is still in preview, first run |
Beta Was this translation helpful? Give feedback.
-
You can now set https://learn.microsoft.com/en-us/windows/wsl/wsl-config#main-wsl-settings |
Beta Was this translation helpful? Give feedback.
-
This discussion thread is an offshoot of this issue thread: #4518 for any folks who want to continue sharing work arounds / ideas for this space.
Any updates on the progress for this feature will be posted back in the main issue on the 'Issues' board.
Beta Was this translation helpful? Give feedback.
All reactions