Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot ping both from Windows host and WSL #8462

Closed
1 of 2 tasks
dtbpkmte opened this issue May 31, 2022 · 3 comments
Closed
1 of 2 tasks

Cannot ping both from Windows host and WSL #8462

dtbpkmte opened this issue May 31, 2022 · 3 comments
Labels

Comments

@dtbpkmte
Copy link

Version

Microsoft Windows [Version 10.0.22000.675]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

IP addresses of Windows host:

>> ipconfig

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::e4ba:b3f1:d4a4:eeee%14
   IPv4 Address. . . . . . . . . . . : 192.168.68.113
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::62a4:b7ff:fe14:43d8%14
                                       192.168.68.1

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::69be:2c73:10e9:fe5e%28
   IPv4 Address. . . . . . . . . . . : 172.31.48.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::adcf:28aa:575d:a7ef%72
   IPv4 Address. . . . . . . . . . . : 172.21.64.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

IP address of WSL:

>> ip addr show eth0

6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:b4:b8:96 brd ff:ff:ff:ff:ff:ff
    inet 172.21.76.160/20 brd 172.21.79.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:feb4:b896/64 scope link
       valid_lft forever preferred_lft forever

Use ping from Windows host to WSL and vice versa.

Expected Behavior

Ping successful.

Actual Behavior

Pinging from Windows host:

>> ping 172.21.76.160

Pinging 172.21.76.160 with 32 bytes of data:
General failure.
General failure.
General failure.
General failure.

Pinging from WSL:

>> ping 172.21.64.1

PING 172.21.64.1 (172.21.64.1) 56(84) bytes of data.
^C
--- 172.21.64.1 ping statistics ---
97 packets transmitted, 0 received, 100% packet loss, time 99839ms

WSL can connect to the Internet (pinging 8.8.8.8, google.com, apt update,...all good)
/etc/resolv.conf:

nameserver 8.8.8.8
nameserver 8.8.4.4

Diagnostic Logs

No response

@ghost ghost added the network label May 31, 2022
@vedran-brnjetic
Copy link

I just ran into the same issue, the problem was I had my VPN on.

@tonywhittam
Copy link

I've found this to be the root of the DNS issues on my system too. The system ...

  • Windows 10.0.19044
  • ZScaler 3.7.2.18 VPN connected to company network
  • WSL2, Ubuntu 22.04 kernel version 5.10.102.1

Here is the complete set of symptoms.

  • DNS is not working from Ubuntu in WSL2. git fetch fails to find github.com
  • DNS is working on Windows.
  • On Ubuntu host github.com fails but host github.com 8.8.8.8 succeeds.
  • On Ubuntu /etc/resolv.conf has nameserver 172.20.0.1 - the Windows WSL IP address.
  • Ubuntu: ping 172.20.0.1 fails, host github.com 172.20.0.1 fails
  • Windows: ping 172.20.0.1 succeeds, host github.com 172.20.0.1 succeeds

If I disconnect the ZScaler from the company network (Private Access - Turn Off) then all the pings and resolving hostnames work correctly. However, this is a workaround that is very is not workable in practise as I, and all the people I'm responsible to create dev systems for (100 scaling to 1000), have to be able to work with the company VPN connected.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants