WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Can't ping failing in both directions after updating to 10.0.20197.0

Open mwoodpatrick opened this issue 6 years ago • 36 comments

Environment

Windows build number: [Environment]:: Win32NT             10.0.20197.0 Microsoft Windows NT 10.0.20197.0
Your Distribution version: Release:        20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL2

Steps to reproduce

In WSL2->Win dir

On WSL2:

cat /etc/resolv.conf (gave 172.31.0.1) then 'ping 'gave:

PING 172.31.0.1 (172.31.0.1) 56(84) bytes of data. From 172.31.7.186 icmp_seq=1 Destination Host Unreachable From 172.31.7.186 icmp_seq=2 Destination Host Unreachable

strace log attached and reported a number of issues

In Win->WSL2 dir On WSL2 determine ip address using: "ip addr|grep eth0" on my system this gave 172.31.7.186 On PS7: ping <ip address determined in step 1>

I then get

ping 172.31.7.186 Pinging 172.31.7.186 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out.

I verified that sshd was running

strace_wsl_ubuntu_20.04.log

WSL logs:

Expected behavior

ping should complete normally in both directions

Actual behavior

ping failed in both directions

mwoodpatrick avatar Aug 25 '20 00:08 mwoodpatrick

I tried adding a new distribution Debian to see if it hit the same issues and it did. I also noticed that this distribution is missing strace & uuidgen is this expected?

mwoodpatrick avatar Aug 25 '20 11:08 mwoodpatrick

Check your windows defender firewall rules. Your probably getting icmp echo requests blocked due to default behavior on private networks.

ec-max avatar Aug 25 '20 16:08 ec-max

I'm using Norton for my firewall and verified the settings I also disabled the firewall to see if it would help, it didn't. Also this was working and my Norton settings/software have not changed. The issue with ping failing when run from WSL2 appears to be the missing files reported in the strace log

mwoodpatrick avatar Aug 25 '20 20:08 mwoodpatrick

I also have this problem. I've upgraded to latest insider build. If I restart, wsl2 can access to the internet and ping to host machine. but after awhile (30m-1h) the problem occurred, I can not access internet or ping to host machine, but I can still access wsl via localhost.

xquangdang avatar Aug 26 '20 07:08 xquangdang

Same. And when I inspect Adapter Settings, I can not find any Hyper-V adapters.

KiruyaMomochi avatar Aug 26 '20 10:08 KiruyaMomochi

The same problem, wsl network does not work when the system wakes up from sleep.

xiaoqidun avatar Aug 26 '20 14:08 xiaoqidun

Same problem happening consistently to me as well. Dell XPS 15 7590 running latest insider build, if laptop sleeps/hibernates, when it resumes WSL2 cannot access internet whatsoever. Rebooting machine completely (non-sleep) brings connectivity back properly.

dklawren avatar Aug 26 '20 16:08 dklawren

Confirmed I am also seeing ping work right after boot (on Ubuntu 20.04 & 18.04) but then failing a little later (maybe 30 minutes or so) in my case system had not gone to sleep. I had recently connected to a VPN before the failure (not sure if these events are related).

mwoodpatrick avatar Aug 26 '20 23:08 mwoodpatrick

Confirmed I am also seeing ping work right after boot (on Ubuntu 20.04 & 18.04) but then failing a little later (maybe 30 minutes or so) in my case system had not gone to sleep. I had recently connected to a VPN before the failure (not sure if these events are related).

I have Kerio VPN network. Yesterday I reset Windows and have everything reinstall but the problem still occurred

xquangdang avatar Aug 27 '20 03:08 xquangdang

Immediately after reboot when I run Get-NetAdapter in powershell I get:

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Ethernet 3                Cisco AnyConnect Secure Mobility Clien…      29 Not Present  00-05-9A-3C-7A-00          0 bps
Ethernet 4                TAP-NordVPN Windows Adapter V9               27 Disconnected 00-FF-C5-12-E8-37         1 Gbps
vEthernet (Default Switc… Hyper-V Virtual Ethernet Adapter             34 Disconnected 00-15-5D-CB-09-98          0 bps
Wi-Fi 2                   Intel(R) Dual Band Wireless-AC 8265 #2       24 Up           20-16-B9-F4-5D-1C        36 Mbps
Ethernet 5                Symantec TAP Driver                          20 Disconnected 00-FF-8D-26-88-25         1 Gbps
NordLynx                  NordLynx Tunnel                              13 Disconnected                         100 Gbps
Bluetooth Network Con...2 Bluetooth Device (Personal Area Ne...#2       6 Disconnected 20-16-B9-F4-5D-20         3 Mbps
vEthernet (WSL)           Hyper-V Virtual Ethernet Adapter #2          68 Up           00-15-5D-73-33-BC        10 Gbps

After I start VPN (Cisco AnyConnect in my case) I get:

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Ethernet 3                Cisco AnyConnect Secure Mobility Clien…      29 Up           00-05-9A-3C-7A-00      99.5 Mbps
Ethernet 4                TAP-NordVPN Windows Adapter V9               27 Disconnected 00-FF-C5-12-E8-37         1 Gbps
vEthernet (Default Switc… Hyper-V Virtual Ethernet Adapter             34 Disconnected 00-15-5D-CB-09-98        10 Gbps
Wi-Fi 2                   Intel(R) Dual Band Wireless-AC 8265 #2       24 Up           20-16-B9-F4-5D-1C        54 Mbps
Ethernet 5                Symantec TAP Driver                          20 Disconnected 00-FF-8D-26-88-25         1 Gbps
NordLynx                  NordLynx Tunnel                              13 Disconnected                         100 Gbps
Ethernet 2                Plugable Ethernet                            12 Up           8C-AE-4C-F6-F6-95       100 Mbps
Bluetooth Network Con...2 Bluetooth Device (Personal Area Ne...#2       6 Disconnected 20-16-B9-F4-5D-20         3 Mbps
vEthernet (WSL)           Hyper-V Virtual Ethernet Adapter #2          68 Disconnected 00-15-5D-73-33-BC          0 bps

So in the first listing vEthernet (WSL) is shown as "Up" and in the second is shown as "Disconnected" anyone know if such events are logged somewhere?

mwoodpatrick avatar Aug 27 '20 10:08 mwoodpatrick

I'm having the same issue on 20197. I do not use a VPN, but I have docker desktop with the WSL2 backend. Rebooting windows does not fix the issue for me, the Ethernet Adapter WSL shows as Media Disconnected immediately after a reboot.

A new build is available, There isn't anything mentioned in the release notes, but I'm gonna try it and see if it fixes anything.

Hebilicious avatar Aug 27 '20 10:08 Hebilicious

I ended up uninstalling Docker and it seemed to help. But the problem persist simply by connecting and switching my active network connection WSL2 disconnects.

vcjr avatar Aug 28 '20 15:08 vcjr

The problem still exists on Build 20201.

KiruyaMomochi avatar Aug 28 '20 15:08 KiruyaMomochi

I ended up uninstalling Docker and it seemed to help. But the problem persist simply by connecting and switching my active network connection WSL2 disconnects.

After playing trying out some other things, I seem to experience it more often now when I go from wireless to wired connections. At my desk I uses a docking station with ethernet and when I plug it in, WSL2 cannot access the network anymore unless I reboot.

dklawren avatar Aug 28 '20 15:08 dklawren

Yep, thats my exact problem. If I leave the cable connected and boot up. WSL2 is fine. As soon as I switch to a wifi or any other connection it creates the problem. If I boot up the laptop with no ethernet connection and no wireless connection WSL2 is automatically disconnected. Even if I was to add the ethernet connection after boot it will still not work.

vcjr avatar Aug 28 '20 16:08 vcjr

Same issue here on Windows 20206. I don't switch from ethernet to wifi. I have Docker installer but not running. I tried to set /etc/wsl.conf to

[network]
generateResolvConf = false

and /etc/resolv.conf to

nameserver 8.8.8.8

without success. Happen on fresh boot. Reboot might help.

danvy avatar Sep 03 '20 23:09 danvy

  • Looks like it's a Hyper-V issue. Windows Sandbox and other Hyper-V VMs also cannot access the internet.
  • It happens every time my network environment changed. (Change from wired to wireless network in detail.)
  • It's still not fixed on Build 20206.

KiruyaMomochi avatar Sep 04 '20 13:09 KiruyaMomochi

I've found a disable/enable cycle on every Hyper-V Virtual Switch Extension Adapter in your network stack, restores network connectivity and DNS resolution to WSL 2. YMMV, but see my brief How-To.

sc0ttwad3 avatar Sep 05 '20 18:09 sc0ttwad3

I am seeing this same behavior on 20211. After reboot, WSL2 and networking works fine. As soon as I start my OpenVPN client, WSL2 networking no longer works and WSL shows "Destination Host Unreachable" for all hosts. In addition to breaking WSL usage, it breaks vscode wsl integration and docker. I've had to uninstall docker in the interim.

Get-NetAdapter shows the WSL interface(s) in a Disconnected state.

The disable/enable cycling of the Hyper-V Virtual Switch Extension Adapters mentioned above does not work for me. Same behavior.

natronkeltner avatar Sep 14 '20 19:09 natronkeltner

With 20211 I continue to see the same disconnected "Hyper-V Virtual Ethernet Adapter" state occurring. The reset sequence does fix the state of the switch and sometimes I am then able to get network traffic in my Linux distributions but sometimes I have to reboot. I am able to use Cisco AnyConnect VPN and my Linux distributions still have a working network,

mwoodpatrick avatar Sep 14 '20 22:09 mwoodpatrick