PING(8) | Maintenance Commands and Procedures | PING(8) |
/usr/sbin/ping host [timeout]
/usr/sbin/ping -s [-l | -U] [-abdDLnrRv] [-A addr_family] [-c traffic_class] [-g gateway [-g gateway...]] [-N next_hop_router] [-F flow_label] [-I interval] [-i interface] [-P tos] [-p port] [-t ttl] host [data_size] [npackets]
host is alive
on the standard output and exit. Otherwise, after timeout seconds, it will write:
no answer from host
The default value of timeout is 20 seconds.
When you specify the s flag, sends one datagram per second (adjust with -I) and prints one line of output for every ECHO_RESPONSE that it receives. ping produces no output if there is no response. In this second form, ping computes round trip times and packet loss statistics; it displays a summary of this information upon termination or timeout. The default data_size is 56 bytes, or you can specify a size with the data_size command-line argument. If you specify the optional npackets, ping sends ping requests until it either sends npackets requests or receives npackets replies.
When using ping for fault isolation, first ping the local host to verify that the local network interface is running.
-A addr_family
By default, if the name of a host is provided, not the literal IP address, and a valid IPv6 address exists in the name service database, ping will use this address. Otherwise, if the name service database contains an IPv4 address, it will try the IPv4 address.
Specify the address family inet or inet6 to override the default behavior. If the argument specified is inet, ping will use the IPv4 address associated with the host name. If none exists, ping will state that the host is unknown and exit. It does not try to determine if an IPv6 address exists in the name service database.
If the specified argument is inet6, ping uses the IPv6 address that is associated with the host name. If none exists, ping states that the host is unknown and exits.
-D
-F flow_label
-I interval
-L
-N next_hop_router
-P tos
-R
-U
-a
-b
-c traffic_class
-d
-g gateway
-i interface_address
-l
-n
-p port
-r
-s
-t ttl
-v
This example shows ping sending probe packets to all the IPv6 addresses of the host xyz, one at a time. It sends an ICMP6 ECHO_REQUEST every second until the user interrupts it.
istanbul% ping -s -A inet6 -a xyz PING xyz: 56 data bytes 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=0. time=0.479 ms 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=1. time=0.843 ms 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=2. time=0.516 ms 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=3. time=4.943 ms 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=4. time=0.485 ms 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=5. time=2.201 ms ^C ----xyz PING Statistics---- 6 packets transmitted, 6 packets received, 0% packet loss round-trip (ms) min/avg/stddev = 0.479/1.583/4.943/1.823
Example 2 Using ndd to Set the icmp_ipv6_hoplimit
This example shows the ndd module, /dev/icmp, used to set the icmp_ipv6_hoplimit.
# ndd -set /dev/icmp icmp_ipv6_hoplimit 100
0
non-zero
ping: warning: timing accuracy diminished -- setsockopt SO_TIMESTAMP failed
May 21, 2015 | OmniOS |