ping(1M) manual page
Table of Contents
ping - send ICMP ECHO_REQUEST packets to network hosts
/usr/sbin/ping
host [ timeout ]
/usr/sbin/ping [ -s ] [ -dlLnrRv ] [ -i interface ]
[ -I interval ] [ -t ttl ] host [ packetsize ] [ count ]
SUNWcsu
ping utilizes the ICMP
protocol’s ECHO_REQUEST datagram to
elicit an ICMP
ECHO_RESPONSE from the specified host or network gateway.
If host responds, ping will print 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 the -s flag is specified,
ping sends one datagram per second (adjustable with -I), and prints one
line of output for every ECHO_RESPONSE that it receives. No output is produced
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 datagram packet size is 64 bytes, or
you can specify a size with the packetsize command-line argument. If an
optional count is given, ping sends only that number of requests.
When using
ping for fault isolation, first ping the local host to verify that the
local network interface is running.
If ping is successful and the host
responds, the exist status is 0. If a host does not respond, or an error
was returned, the exit status is 1.
- -d
- Set the SO_DEBUG socket option.
- -l
- Loose source route. Use this option in the IP
header to send the packet
to the given host and back again. Usually specified with the -R option.
- -L
- Turn off loopback of multicast packets. Normally, if there are members in
the host group on the outgoing interface, a copy of the multicast packets
will be delivered to the local machine.
- -n
- Show network addresses as numbers.
ping normally displays addresses as host names.
- -r
- Bypass the normal routing
tables and send directly to a host on an attached network. If the host
is not on a directly-attached network, an error is returned. This option
can be used to ping a local host through an interface that has been dropped
by the router daemon (see in.routed(1M)
).
- -R
- Record route. Sets the IP
record
route option, which will store the route of the packet inside the IP
header.
The contents of the record route will only be printed if the -v option
is given, and only be set on return packets if the target host preserves
the record route option across echos, or the -l option is given.
- -v
- Verbose
output. List any ICMP
packets, other than ECHO_RESPONSE, that are received.
- -i interface
- Specify
the outgoing interface to use for multicast packets. The default interface
for multicast packets is determined from the (unicast) routing tables.
- -I interval
- Specify the interval between successive transmissions. The default
is one second.
- -t ttl
- Specify the IP
time to live for unicast and multicast
packets. The default time to live for unicast packets is set with ndd (using
the icmp_def_ttl variable). The default time to live for multicast is one
hop.
The following exit values are returned:
- Success -- the
machine is alive.
- non-zero
- An error has occurred -- either a malformed argument
has been specified, or the machine was not alive.
ifconfig(1M)
,
in.routed(1M)
, netstat(1M)
, ndd(1M)
, rpcinfo(1M)
, icmp(7P)
Table of Contents