Skip to main content

C.5 ping Command


C.5 ping Command
The ping command sends the ICMP ECHO_REQUEST packet to network hosts.
In certain configurations of the ping command, the command output allows you to identify a network link or a node that has experienced a problem. The destination host is specified by the variable: hostname.
Table C-5 lists the operands/options of the ping command and how they are useful for troubleshooting.
Table C-5  ping Command Options
Operand/Option Description Application
hostname When you send a probe packet to hostname, a message is returned. Allows you to confirm that a host is active on the network.
-g hostname
Forces the probe packet to go through the specified gateway. Allows you to test the quality of individual routes by sending packets to the target host via the various specified routes.
-i interface
Specifies the interface to be used for sending and receiving a probe packet. Allows you to easily check the secondary network interface.
-n
Converts a host name into an IP address and displays it. Allows you to check the IP address instead of the host name.
-s
ping is repeated at an interval of 1 second.
Pressing the [Ctrl] + [C] keys stops ping, and then displays the statistics.
Allows you to check intermittent or long-term network events. You can view nighttime network events at a glance by piping the ping output to a file.
-svR
Displays the routes that probe packets have passed through at an interval of 1 second. Displays the routes and hop counts of probe packets, allowing you to compare multiple routes to identify any bottleneck.
The following example shows the output from the ping command.
# ping -s 10.24.187.50
PING 10.24.187.50: 56 data bytes
64 bytes from 10.24.187.50: icmp_seq=0. time=0.555 ms

64 bytes from 10.24.187.50: icmp_seq=1. time=0.400 ms

64 bytes from 10.24.187.50: icmp_seq=2. time=0.447 ms

^C
----10.24.187.50 PING Statistics----

3 packets transmitted, 3 packets received, 0% packet loss

round-trip (ms) min/avg/max/stddev = 0.400/0.467/0.555/0.079
#