Ok, this one is huge: Windows Subsystem for Linux (WSL) 2 now has native support for IPv6! Almost exactly a year ago I asked about when we'd get IPv6 support in WSL2 on Twitter X, and now we have it.

Last year I really needed IPv6 support in WSL 2 to streamline my virt-manager workflow. You can read about my workaround to connect to a KVM host through an ssh tunnel and arbitrary port in Windows 11 and WSL 2. Now that workaround shouldn't be necessary anymore.

The news was announced by Craig Loewen (Program Manager II, Windows Developer Platform) on the Windows Command Line blog in the Windows Subsystem for Linux September 2023 update and is called "mirrored networking mode".

IPv6 support in WSL2 networkingMode

Please note this feature is currently only available to Windows Insiders (across all Insider Channels) including the Release Preview Channel with the latest Windows 11, version 22H2 update here. You can get access now by joining the Windows Insider Program and choosing to opt in your device into the Release Preview Channel.

If you are on the Insider Program, you can enable this in your .wslconfig file:

[experimental]
networkingMode=mirrored

Shutdown and restart WSL (wsl.exe --shutdown). When enabled, you can get your IPv6 address using ip -6 a, and ping google.com using IPv6:

$ ping -6 -c 5 google.com
PING google.com(ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e)) 56 data bytes
64 bytes from ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e): icmp_seq=1 ttl=118 time=21.7 ms
64 bytes from ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e): icmp_seq=2 ttl=118 time=25.9 ms
64 bytes from ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e): icmp_seq=3 ttl=118 time=25.9 ms
64 bytes from ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e): icmp_seq=4 ttl=118 time=26.2 ms
64 bytes from ams15s44-in-x0e.1e100.net (2a00:1450:400e:80f::200e): icmp_seq=5 ttl=118 time=26.8 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4009ms
rtt min/avg/max/mdev = 21.711/25.289/26.823/1.822 ms

2 Comments

  1. Pan

    So cool! Good news! Can’t wait this feature to be released.

    • Yeah me too, Pan. I used to have to hop around a lot from an IPv4 only host to an IPv4/IPv6 dual stack host as my stepping stone to the IPv6 only endpoint. That’s all in the past then :-) .

Comments are closed