Unable to ping a Windows machine from Linux

I have Windows installed on my laptop, connected to the router wirelessly with IP 192.168.1.5. My desktop is running Linux, connected to the same router (wired) with IP 192.168.1.2. When I do a ping from Windows to Linux, I get a response, but it doesn't work in the other direction. What could be the problem?


Solution 1:

This sounds like your Windows firewall is blocking ICMP packets is what the command ping is using to solicit responses from other computers on the network.

I would try to ping the WI-FI router from both systems to confirm that outbound is working against a 3rd machine (which it likely is, since you're getting IP addresses from the router).

Your router is likely to have the IP address 192.168.1.1 so I'd try pinging that.

From windows:

$ ping 192.168.1.1

From Linux:

$ ping 192.168.1.1

If these work then it's highly likely that the Windows firewall is to blame here for blocking your ping attempts.

Solution 2:

Issue:

I had exactly this issue on Windows 10. I have my Windows 10 machine on 192.168.1.74 and the (Arch) Linux machine on 192.168.1.174. Pinging from windows to linux worked flawlessly, but otherwise it didn't.

Solution:

  • I tried Rafał Wądołowski's solution

    check the windows firewall, that it allows ICMP

    but it didn't work for me.

  • Then I recalled that when you first connect to network windows ask you if you want to be discoverable. And that was exactly my issue.

To fix the issue follow these steps:

  1. Go to Windows 10 settings
  2. Network & Internet
  3. Ethernet
  4. Click on connected adapter
  5. Finally check PC discoverable

Also you can select this option somehow globally in

  1. Control Panel
  2. Network and Internet
  3. Network and Sharing Center
  4. Advanced sharing settings

But it will not override settings for existing saved networks.