A failed ping means that either:
- A ping request is not making it to the target host
- A ping response is not making it to the host that sent the request
There are many reasons why either of these things may happen, the majority of these reasons can be split into either physical or software issues.
When debuging I start with the physical component of the transmission path, that is NICs, network cables and intermediary devices.
Physical Checks
- Network cable connects the two hosts. If the two hosts are not directly connected by a cable, make sure that the sending and recieving NICs are connected to the correct router and/or switch port as these can be configured to route traffic differently
Software Checks
- Make sure the NICs in each machine are recognized by the operating system. [1]
- Make sure both machines have a valid IP address, subnet mask, gateway and nameserver configuration. [2]
- Make sure the sending and receiving hosts have valid MAC addresses (yes, i've had this issue before) [3]
- Make sure the sending and receiving hosts have correct ARP cache information for their gateways [4]
- There is a possibility that the sending host will have an ARP cache entry for the recieving host or vice versa. If such entries exist, make sure these entries are correct by verifying that the IP address maps to the correct MAC address. If there are inconsistancies, remove those entries from the ARP cache
- Verify that ping packets (ICMP Echo Requests and ICMP Echo Responses) are not blocked by filters on local software firewalls, or filters running on devices between the sending and recieving host.
- If you are using a hostname to identify the receiving host, try using the IP address directly as this will remove issues that stem from the name resolution process.
The error message returned by the ping command should also be considered when troubleshooting, Error messages that I see commonly include:
Request Timed Out
This is a very generic message that indicates that a response was not recieved within the timeout period. This may occur because the host could not respond due to workload and time constraints, or because of connectivity or routing issues discussed above.
Reply from {host}: Destination network unreachable
Often {host}
will be the NIC on the local machine, or the machines gateway. The message means that it couldn't find a route between {host}
and receiving host (I may be wrong here)
This is by no means an exhaustive list of reasons why ping may fail, however it does cover many common issues. I hope that it can help someone the next time their network breaks
The footnotes below apply to Windows NT based systems as this is where I have experience,
[1] You can verify that the operating system has a valid driver for your network card by checking for the presence of any Network Controller items under the Unknown Devices node in Device Manager. If there is one you need to find a compatible driver for your card.
Check under the Network Adapter node for your card, assuming your card is listed double click it and check for any known errors listed under Device Status
[2] The TCP/IP configuration dialog can be accessed on Vista / Win 7 by opening Network and Sharing Centere -> Change adapter settings (left hand pane) -> right click the adapter you are interested in and choosing Properties (requires elevation) and then double clicking either TCP/IP Protocol Version 4 or 6 depending on what you use (most likely v4)
[3] running the ipconfig /all
command will display the MAC address as well as the IP address, subnet mask, gateway and nameservers. The MAC address is labelled Physical Address in the output
[4] TheARP -a
command displays the current ARP table for the host.
This should have been a comment to the answer and not a separate answer. Please note answers on Super User is not chronologically sorted by default. – BinaryMisfit – 2010-10-07T07:56:07.190
@Diago : It should read "the answer [http link]..." instead of "the answer above", but otherwise it is certainly a valid answer adding additional value. – Martin – 2010-10-07T08:20:32.503
@Martin. Not quite. Since the idea behind SE is to have one canonical answer, this should be a comment which is then incorporated into the above answer. The sole reason the moderators don't make these edits is to allow users to learn what is correct and what isn't. – BinaryMisfit – 2010-10-07T11:23:01.020
@Diago : Seems we disagree on what constitutes a valid separate answer on SE. So be it. – Martin – 2010-10-07T11:43:10.137