ping

Test network connectivity between hosts (ipv4)

Supplementary instructions

ping command is used to test the network connectivity between hosts. Executing the ping command will use the ICMP transport protocol to send a message requesting a response. If there is no problem with the network function of the remote host, it will respond to the message, thus knowing that the host is operating normally.

grammar

ping (options) (parameters)

Options

-d: Use the SO_DEBUG function of Socket;
-c <Number of completions>: Set the number of times to complete the request response;
-f: limit detection;
-i<interval seconds>: Specify the interval between sending and receiving information;
-I<network interface>: Use the specified network interface to send data packets;
-l<preload>: Set the data packet to be sent before sending the required information;
-n: Output only numerical values;
-p<template style>: Set the template style for filling data packets;
-q: Do not display the instruction execution process, except related information at the beginning and end;
-r: Ignore the ordinary Routing Table and send the data packet directly to the remote host;
-R: record the routing process;
-s<packet size>: Set the size of the data packet;
-t<survival value>: Set the size of the survival value TTL;
-v: Display the execution process of the command in detail.
-w <timeout seconds>: No matter how many packets have been sent or received before, as long as this number of seconds is exceeded, the program will exit;

Parameters

Destination host: Specify the destination host for sending ICMP messages.

Example

[root@AY1307311912260196fcZ ~]# ping www.jsdig.com
PING host.1.jsdig.com (100.42.212.8) 56(84) bytes of data.
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=1 ttl=50 time=177 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=2 ttl=50 time=178 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=3 ttl=50 time=174 ms
64 bytes from 100-42-212-8.static.webnx.com (100.42.212.8): icmp_seq=4 ttl=50 time=177 ms
...Press Ctrl+C to end

--- host.1.jsdig.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2998ms
rtt min/avg/max/mdev = 174.068/176.916/178.182/1.683 ms