I am using the linux ping command from a linux machine to test connection to a windows machine:

I first find my windows machine IP address using ipconfig and then do this from the linux machine:

ping my.ip.add.ress

The command just hangs until I cancel with control-C.

Are there any obvious things that I should be doing first?

What should I see if the ping command works?

  • 2
    For whatever reason your linux machine is not seeing your Windows machine. Are you able to ping the linux box from Windows? Can you ping Google's DNS ( from the linux machine? Can you verify that both are connected to your network?
    – Callen L
    Sep 30 '13 at 13:49
  • 1
    What sort of network configuration do you have? You will be unable to ping your public ip address inside of a local network unless the network is configured a certain way ( no need to do this unless your hosting a server ). You should be pinging the intranet ip address of the computers.
    – Ramhound
    Sep 30 '13 at 13:56
  • @Callen L, yes both able to ping Also, I can ssh into linux box from windows. I think I may not be pinging the correct IP address as Ramhound suggests. But I'm unsure how to get this.
    – atomh33ls
    Sep 30 '13 at 14:02

IIRC, the default setting in Windows shifted to not responding to pings some time ago. You have to change that in either network or firewall/security settings. If you are using something other than Windows Defender (ie, Norton) you may have to look in more places to find where it's being blocked.

But. You should be getting notices from ping that packets have failed, unless you are killing it really quickly.

If you'd like to not have to kill it, use the -c option to specify a number of packets:

ping -c 5 my.ip.add.ress

and then wait - if no response, you should get 5 failure messages and a summary noting 0 of 5 packets, 100% loss, etc.

You could also try pinging the other direction (from windows to linux)

  • Pinging works from windows box to linux box.
    – atomh33ls
    Sep 30 '13 at 14:18
  • Then it's most likely the firewall settings on the Windows box. I don't have Win7box here on my desk, but somewhere in the network panel there's something like "properties" or "diagnostics" that will show you the current IP address - you should also see it in the logs on the linux box from when you ssh into it.
    – Ecnerwal
    Sep 30 '13 at 14:23
  • You are correct. I allowed echo response as per this
    – atomh33ls
    Sep 30 '13 at 14:25

Is your firewall getting in the way?

When the ping command works you should see something like this:

$ ping
PING 64 byte packets
64 bytes from icmp_seq=0. time=18. ms
64 bytes from icmp_seq=1. time=18. ms
64 bytes from icmp_seq=2. time=18. ms
64 bytes from icmp_seq=3. time=18. ms
  • If the firewall is getting in the way, you should eventually get timeouts.
    – user
    Sep 30 '13 at 13:54

To test if the ping command works, on the linux machine type ping localhost which should resolve to the linux machine's local IP. You should get a response. It could be that there is a local or remote firewall that is preventing the pings from going through, but I wouldnt expect it to lock up requiring you to use a break.


To verify the PC's address, use the command "IPCONFIG" from the command line. Then look for the adapter you are using, i.e. wired Ethernet (sometimes says "LAN0" or similar) or Wireless. Each adapter could have a separate address.

I agree with the posts that suggest that your firewall could be blocking the PING response. If so, in Windows 7 you would open the Network & Sharing Center, then click on "Windows Firewall" at the bottom left. The easiest thing for TESTING ONLY is to turn off the firewall completely. But then if you find it is the firewall, you can just enable a PING through it: In Windows Firewall, click Advanced Settings, Inbound Rules, New Rule and create a custom rule:

Protocol and ports: Protocol: ICMPv4 on the same panel go to customize, choose "Specific ICMP types", check the box "echo request", OK etc.


if the ping was successful you should see something like:

pinging your.ip.add.ress
reply from your.ip.add.ress bytes=** time=<1ms
reply from your.ip.add.ress bytes=** time=<1ms
reply from your.ip.add.ress bytes=** time=<1ms
reply from your.ip.add.ress bytes=** time=<1ms

Packets sent = 4, packets received = 4, packets lost = 0

and something to do with the time it took.

Try pinging in safe mode..and turn your firewall off for that short time.

it sounds like although you are cancelling it...if you were to leave it it would time out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.