Let us ping!
ping
is the most basic network command every user should first know and is available on all major Operating Systems. It is also a diagnostic tool used for verifying the connectivity between two hosts on a network. It can be used to find out which machines are alive on a network. Let us see how to use ping
.
How to do it...
In order to check the connectivity of two hosts on a network, the ping command uses Internet Control Message Protocol (ICMP) echo packets. When these echo packets are sent towards a host, the host responds back with a reply if it is reachable or alive.
Check whether a host is reachable as follows:
$ ping ADDRESS
The ADDRESS
can be a hostname, domain name, or an IP address itself.
ping
will continuously send packets and the reply information is printed on the terminal. Stop the pinging process by pressing Ctrl + C.
For example:
When a host is reachable, the output will be similar to the following:
$ ping 192.168.0.1 PING 192.168.0.1 (192.168.0.1) 56(84) bytes of...