Using the Ping command to test your home network

Using the Ping command to test your home network

Among the most common tools used for troubleshooting network problems is ping.

Ping is used to determine if a network device (usually a computer) is available.

An echo is returned to you (the ping) when you send a ping to a device.

If the device responds, then it is working properly.

  • The device is not working, it is disconnected, switched off, or incorrectly configured
  • and is not working properly.

Note: In this tutorial, we will use the ping command on Windows, but it also works on Linux

Ping Command Prompt

To use the ping command you go to the command line.

On Windows (XP,7) – Start Menu>Run and enter cmd to open a command prompt.

On Windows 10 type cmd into the search box and select the cmd prompt from the displayed programs.


Ping can be used with either an IP address or computer/host name.

Enter the following command at a command prompt to ping an IP address:

Ping an IP address, for example 192.169.0.1, or ping a computer name:

ping Computer1 or ping 192.169.0.1

Below is an example of using the command with an IP address.


I have also included a successful ping (192.168.1.1), as well as a failed ping (192.168.0.1).

In case of a failed ping, you will receive a request timed out response, and in case of a successful ping, you will receive the reply from message with the round trip delay in milliseconds.


Using the ping command with the computer name is shown in the screenshot below.

It is easier to use a computer name than an IP address, but only if it works.

In the event that it fails, it is not conclusive since there is an extra step called name resolution, and that can be the issue.

To watch the video, click here.

Troubleshooting Home Network Problems Using Ping

Typically, the ping command is used to troubleshoot and locate network connectivity problems.

In general, you should ping each network interface between your machine and the destination machine.

Pinging that segment of the network fails indicates a problem.

As an example, I've drawn a simple home network with a workstation and server separated by a router (home router/hub).

If the workstation (WS1) could not connect to the server, the general procedure would be:


Ping loop back address 127.0.0.1 — tests own protocol stack.

  • Ping IP2
  • Ping IP3
  • Ping IP4

All pings work except for the IP4 ping, which means there is an issue on the network between the router and server.

Advanced Options for the Ping Command

With the ping command, you can see a variety of options (switches)

for pinging. Using the command prompt


So for a continuous ping we type

ping IP address or name -t

e.g.

ping google.com -t


Here is the result

IPv6 Addresses

If your system has IPv6 configured, you can also ping ipv6 addresses

You must use ping -6 on Windows networks

example — ping -6 hostname or IP address

and on Linux systems use ping6

example — ping6 -c 4 -I eth0 hostname or IP address

or

ping6 -c 4 IP address%eth0

Note: not using the Interface option may result in an Invalid Argument error

Here is a screenshot of a Linux IP4 and IP6 ping


FAQ

Q- What is the localhost?

A- Localhost is the name given to your local machine on all operating systems, and it corresponds to the IP address 127.0.0.1.

Q- What does 127.0.0.1 stand for?

A- This is your loopback address, also known as your network interface address.

Summary

An IP network can be troubleshooted by using the ping command on any Operating System.