Let us ping!
The ping
command is a basic network command, supported on all major operating systems. Ping is used to verify connectivity between hosts on a network and identify accessible machines.
How to do it...
The ping command uses Internet Control Message Protocol (ICMP) packets to check the connectivity of two hosts on a network. When these echo packets are sent to a target, the target responds with a reply if the connection is complete. A ping request can fail if there is no route to the target or if there is no known route from the target back to the requester.
Pinging an address will check whether a host is reachable:
$ ping ADDRESS
The ADDRESS
can be a hostname, domain name, or an IP address itself.
By default, ping
will continuously send packets and the reply information is printed on the terminal. Stop the pinging process by pressing Ctrl + C.
Consider the following example:
- When a host is reachable, the output will be similar to the following:
$ ping 192.168.0.1 PING...