Using Ping
Posted: June 7th, 2008 | Author: TnT Admin | Filed under: How-Tos | Tags: network, Ping | 1 Comment »To isolate network problems with ping, follow the steps listed which actually starts from the loopback interface, IP address, name resolution, router connectivity, traceroute to remote machines. You will need to run the ping command repeatedly, changing your destination address so that you work your way through each intermediate device to your destination. Loopback Interface
You should begin with your loopback interface. Use either localhost or 127.0.0.1. Next, ping your interface by IP number. (Run ifconfig –a or ipconfig /all if in doubt.) If either of these fails, you know that you have a problem with the host.
IP Address (local machine)
Next, try a host on a local network that you know is operational. Use its IP address rather than its hostname. If this fails, there are several possibilities. If other hosts are able to communicate on the local network, then you likely have problems with your connection to the network. This could be your interface, the cable to your machine, or your connection to a hub or switch. Of course, you can’t rule out configuration errors such as media type on the adapter or a bad IP address or mask.
Hostname (local machine)
Next, try to reach the same host by name rather than number. This is to determine if the DNS and name resolution is the cause of the problem. If this fails, you almost certain to have problems with name resolution.
Router Connectivity
Try reaching the near and far interfaces of the router. This will turn up any basic routing problems you may have on your host or connectivity problems getting to your router.
Traceroute Remote Machines
If all goes well here, you are ready to ping remote computers. (You will need to know the IP address of the intermediate devices to do this test. If in doubt, use traceroute to determine the machines.) Realize, of course, that if you start having failures at this point, the problem will likely lie beyond your router. For example, your ICMP ECHO_REQUEST packets may reach the remote machine, but it may not have a route to your machine to use for the ICMP ECHO_REPLY packets.
When faced with failure at this point, your response will depend on who is responsible for the machines beyond your router. If this is still part of your network, you will want to shift your tests to machines on the other side of the router and try to work in both directions.
Before you seek help… If these machines are outside your responsibility or control, you will need to enlist the help of the appropriate person. Before you contact this person, you should collect as much as information as you can. There are three things you may want to do. First, go back to using IP numbers if you have been using names. As said before, if things start working, you have a name resolution problem.
Second, if you were trying to ping a device several hops beyond your router, go back to closer machines and try to zero in on exactly where you first encountered the problem.
Finally, be sure to probe form more than one machine. While you may have a great deal of confidence in your local machine at this point, your discussion with the remote administrator may go much more smoothly if you can definitely say that you are seeing this problem from multiple machines instead of just one.
(Source: Network Troubleshooting Tools” by Joseph D. Sloan)
use ping -a nnn.nnn.nnn.nnn to determine if the DNS is resolving (if you know the IP)