The ping command tests whether network components can be reached.
The command uses the ICMP or ICMPv6 protocol. It sends echo requests packets to specific network components to determine whether or not they can be reached via the network. These network components reply by returning echo reply packets.
Syntax
ping [-nv] host [timeout] |
ping -s[nv] host [packetsize [packetcount]] |
ping -l host |
Specifies the network component using the (FQDN) name, IPv4 address or IPv6 address.
The host address is displayed instead of the host name.
Verbose mode; when certain errors occur, additional messages are output.
Statistics display (1 echo request per second); the following information is displayed:
Outputs all the host’s IPv4 and IPv6 addresses (lookup).
Size of the packet to be sent (default: 56 bytes, mnimum: 24 bytes, maximum: 1400 bytes); 8 bytes are added to the size for the header.
Number of packets to be sent; by default (packetcount = 0) as many bytes as necessary are sent until the ping command is interrupted by the
Defines how long ping is to send new queries or to wait for an answer (default: 20 seconds). |
Example 1
Successful ping call:
|
Example 2
Successful ping calls to an IPv4 address and to an IPv6 address with the -s option (packet size 72 bytes, 4 packets):
|
Example 3
ping call to a host which does not answer
|
Example 4
ping call to a host which does not exist
|
Example 5
ping call to a host which does not answer. If any exist, alternative IPv4/IPv6 addresses are displayed at which the host can possibly be reached:
|
Example 6
ping call to determine the IP addresses of a host
|