Network Computing   «Prev  Next»
Lesson 3 Troubleshooting TCP/IP with ping
Objective Use the ping command to troubleshoot connectivity problems

Troubleshooting TCP/IP with Ping

The ping command sends and receives test packets between hosts. You can even ping the IP address reserved for the loopback interface, which is 127.0.0.1. Use ping to test connections for the following problems:
  1. Connecting to other computers
  2. Remote computers connecting to your site
  3. Resolving Domain names

Contacting remote Sites

When you have problems connecting to other computers, there are a number of connections you should check. First, verify that ping can contact other computers on the Internet. For example, let us say you decide to check the Web server IP address of internic.net, which is 198.41.0.6. To do this, you type the command line:
ping 198.41.0.6

Output of ping command

1) This is the prompt from which the ping command was issued.
1) This is the prompt from which the ping command was issued.

2) This line indicates that ping sent test data to 198.41.0.6 from 152.1.254.84.
2) This line indicates that ping sent test data to 198.41.0.6 from 152.1.254.84.

3) These lines give information about each test packet received from rs.internic.net (198.41.0.6).
3) These lines give information about each test packet received from rs.internic.net (198.41.0.6). On the right are times in milliseconds for the round-trip of the test packet.

4) Ping This section displays some statistics on the ping packets received before the user pressed Ctrl-C. In this case, 0 (zero) percent of  five packets were lost.
4) This section displays some statistics on the ping packets received before the user pressed Ctrl-C. In this case, 0 (zero) percent of five packets were lost. The minimum, average, and maximum round-trip packet times are listed in milliseconds.

  1. This is the prompt from which the ping command was issued.
  2. This line indicates that ping sent test data to 198.41.0.6 from 152.1.254.84.
  3. These lines give information about each test packet received from rs.internic.net (198.41.0.6).
  4. This section displays some statistics on the ping packets received before the user pressed Ctrl-C.

Ping Command Output
ping continues to check for a connection until you interrupt it by pressing Ctrl-C (simultaneously press the Ctrl and C keys). Click the View Slideshow link to see the output of a typical ping session over a good connection. If you find you cannot connect with this method, your gateway address is probably misconfigured.

Can other hosts connect?

You can also verify that your computer is visible over the network using ping. In fact, if you can receive a response to your ping, then the remote computer must have found a route back to your computer.
If you do not receive a response to the ping, your interface may be configured incorrectly. If checking your interface configuration does not reveal any errors, contact the network administrator. There may be a routing problem with the gateway. If you can connect with ping, you should be able to connect using any properly configured network application.