microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.27k stars 812 forks source link

No IPv6 IP address or connectivity inside WSL2, yet host windows 10 machine has working IPv6 connectivity #9405

Closed luc-vocab closed 1 year ago

luc-vocab commented 1 year ago

Version

Windows version: 10.0.19045.2364, WSL version: 1.0.3.0

WSL Version

Kernel Version

5.15.79.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

I recently configured my asus wifi router to connect to a 6in4 tunnel, and the windows 10 host picked up an IPv6 address immediately without an issue.

yet, from within WSL2:

ping -6 google.com
ping: connect: Network is unreachable

Expected Behavior

I expect IPv6 connectivity within the WSL2 instance, because the host has working IPv6 connectivity.

Host IP configuration

Windows IP Configuration

Ethernet adapter vEthernet (External Switch Ethernet):

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:470:19:50f:61fc:e04c:fc23:f9c0
   Temporary IPv6 Address. . . . . . : 2001:470:19:50f:9dd2:a2e2:51b0:2f32
   Link-local IPv6 Address . . . . . : fe80::7fd3:9271:69c9:ef71%23
   IPv4 Address. . . . . . . . . . . : 192.168.30.5
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::ae9e:17ff:fe7d:8230%23
                                       192.168.30.1

Working IPv6 ping from host

C:\Users\lucwa>ping -6 google.com

Pinging google.com [2404:6800:4005:81a::200e] with 32 bytes of data:
Reply from 2404:6800:4005:81a::200e: time=2ms
Reply from 2404:6800:4005:81a::200e: time=2ms

Actual Behavior

inside WSL2 instance

luc@wsl2-ubuntu$ ping -6 google.com
ping: connect: Network is unreachable

no IPv6 address inside WSL2 instance

6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:7e:f9:77 brd ff:ff:ff:ff:ff:ff
    inet 172.23.2.234/20 brd 172.23.15.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe7e:f977/64 scope link
       valid_lft forever preferred_lft forever

Diagnostic Logs

Windows 10 IP configuration

Windows IP Configuration

Ethernet adapter vEthernet (External Switch Ethernet):

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:470:19:50f:61fc:e04c:fc23:f9c0
   Temporary IPv6 Address. . . . . . : 2001:470:19:50f:9dd2:a2e2:51b0:2f32
   Link-local IPv6 Address . . . . . : fe80::7fd3:9271:69c9:ef71%23
   IPv4 Address. . . . . . . . . . . : 192.168.30.5
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::ae9e:17ff:fe7d:8230%23
                                       192.168.30.1

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::3481:acd7:80ad:c400%48
   IPv4 Address. . . . . . . . . . . : 172.24.80.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::b50e:e4ff:72ac:1ad8%56
   IPv4 Address. . . . . . . . . . . : 172.23.0.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Working IPv6 ping from host machine

C:\Users\lucwa>ping -6 google.com

Pinging google.com [2404:6800:4005:81a::200e] with 32 bytes of data:
Reply from 2404:6800:4005:81a::200e: time=2ms
Reply from 2404:6800:4005:81a::200e: time=1ms

Ping statistics for 2404:6800:4005:81a::200e:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 2ms, Average = 1ms

IP configuration inside WSL2

notice eth0 has an IPv4 address, but no IPv6 address besides the link-local one

luc@wsl2-ubuntu$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 8a:9e:d3:ec:8e:f6 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5e:b5:ad:37:8a:2b brd ff:ff:ff:ff:ff:ff
4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1480 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:7e:f9:77 brd ff:ff:ff:ff:ff:ff
    inet 172.23.2.234/20 brd 172.23.15.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe7e:f977/64 scope link
       valid_lft forever preferred_lft forever
elsaco commented 1 year ago

@luc-languagetools if you run (Get-HnsNetwork).IPv6 on Windows side you'll get:

PS C:\> (Get-HnsNetwork).IPv6
False
False

IPv6 is not working for WSL at this time.

OneBlue commented 1 year ago

/dupe #4518

ghost commented 1 year ago

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!