3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
[unleashed.git] / usr / src / man / man1m / ping.1m
blob6aa5ecc604c3fb63488364c97063c887e46cd8ae
1 '\" te
2 .\" Copyright (C) 2006, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PING 1M "Sep 7, 2006"
8 .SH NAME
9 ping \- send ICMP (ICMP6) ECHO_REQUEST packets to network hosts
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/ping\fR \fIhost\fR [\fItimeout\fR]
14 .fi
16 .LP
17 .nf
18 \fB/usr/sbin/ping\fR \fB-s\fR [\fB-l\fR | \fB-U\fR] [\fB-abdlLnrRv\fR] [\fB-A\fR \fIaddr_family\fR]
19      [\fB-c\fR \fItraffic_class\fR] [\fB-g\fR \fIgateway\fR [\fB-g\fR \fIgateway\fR...]]
20      [\fB-N\fR \fInext_hop_router\fR] [\fB-F\fR \fIflow_label\fR] [\fB-I\fR \fIinterval\fR]
21      [\fB-i\fR \fIinterface\fR] [\fB-P\fR \fItos\fR] [\fB-p\fR \fIport\fR] [\fB-t\fR \fIttl\fR] \fIhost\fR
22      [\fIdata_size\fR] [\fInpackets\fR]
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 The utility \fBping\fR utilizes the \fBICMP\fR (\fBICMP6\fR in IPv6) protocol's
29 \fBECHO_REQUEST\fR datagram to elicit an \fBICMP\fR (\fBICMP6\fR)
30 \fBECHO_RESPONSE\fR from the specified \fIhost\fR or network \fIgateway\fR. If
31 \fIhost\fR responds, \fBping\fR will print:
32 .sp
33 .in +2
34 .nf
35 \fIhost\fR is alive
36 .fi
37 .in -2
38 .sp
40 .sp
41 .LP
42 on the standard output and exit. Otherwise, after \fItimeout\fR seconds, it
43 will write:
44 .sp
45 .in +2
46 .nf
47 no answer from \fIhost\fR
48 .fi
49 .in -2
50 .sp
52 .sp
53 .LP
54 The default value of \fItimeout\fR is \fB20\fR seconds.
55 .sp
56 .LP
57 When you specify the s flag, sends one datagram per second (adjust with
58 \fB-I\fR) and prints one line of output for every \fBECHO_RESPONSE\fR that it
59 receives. \fBping\fR produces no output if there is no response. In this second
60 form, \fBping\fR computes round trip times and packet loss statistics; it
61 displays a summary of this information upon termination or timeout. The default
62 \fIdata_size\fR is \fB56\fR bytes, or you can specify a size with the
63 \fIdata_size\fR command-line argument. If you specify the optional
64 \fInpackets\fR, \fBping\fR sends \fBping\fR requests until it either sends
65 \fInpackets\fR requests or receives \fInpackets\fR replies.
66 .sp
67 .LP
68 When using \fBping\fR for fault isolation, first \fBping\fR the local host to
69 verify that the local network interface is running.
70 .SH OPTIONS
71 .sp
72 .LP
73 The following options are supported:
74 .sp
75 .ne 2
76 .na
77 \fB\fB-A\fR\ \fIaddr_family\fR\fR
78 .ad
79 .RS 24n
80 Specify the address family of the target host. \fIaddr_family\fR can be either
81 \fBinet\fR or \fBinet6\fR. Address family determines which protocol to use. For
82 an argument of \fBinet\fR, IPv4 is used. For \fBinet6\fR, IPv6 is used.
83 .sp
84 By default, if the name of a host is provided, not the literal \fBIP\fR
85 address, and a valid IPv6 address exists in the name service database,
86 \fBping\fR will use this address. Otherwise, if the name service database
87 contains an IPv4 address, it will try the IPv4 address.
88 .sp
89 Specify the address family \fBinet\fR or \fBinet6\fR to override the default
90 behavior. If the argument specified is \fBinet\fR, \fBping\fR will use the IPv4
91 address associated with the host name. If none exists, \fBping\fR will state
92 that the host is unknown and exit. It does not try to determine if an IPv6
93 address exists in the name service database.
94 .sp
95 If the specified argument is \fBinet6\fR, \fBping\fR uses the IPv6 address that
96 is associated with the host name. If none exists, \fBping\fR states that the
97 host is unknown and exits.
98 .RE
101 .ne 2
103 \fB\fB-F\fR\ \fIflow_label\fR\fR
105 .RS 24n
106 Specify the flow label of probe packets. The value must be an integer in the
107 range from 0 to 1048575. This option is valid only on IPv6.
111 .ne 2
113 \fB\fB-I\fR \fIinterval\fR\fR
115 .RS 24n
116 Turn on the statistics mode and specify the interval between successive
117 transmissions. The default is one second. See the discussion of the \fB-s\fR
118 option.
122 .ne 2
124 \fB\fB-L\fR\fR
126 .RS 24n
127 Turn off loopback of multicast packets. Normally, members are in the host group
128 on the outgoing interface, a copy of the multicast packets will be delivered to
129 the local machine.
133 .ne 2
135 \fB\fB-N\fR \fInext_hop_router\fR\fR
137 .RS 24n
138 Specify a next-hop router so that the probe packet goes through the specified
139 router along its path to the target host. This option essentially bypasses the
140 system routing table and leaves the probe packet header unmodified. Only one
141 next-hop router can be specified.
145 .ne 2
147 \fB\fB-P\fR\ \fItos\fR\fR
149 .RS 24n
150 Set the type of service (\fItos\fR) in probe packets to the specified value.
151 The default is zero. The value must be an integer in the range from 0 to 255.
152 Gateways also in the path can route the probe packet differently, depending
153 upon the value of \fItos\fR that is set in the probe packet. This option is
154 valid only on IPv4.
158 .ne 2
160 \fB\fB-R\fR\fR
162 .RS 24n
163 Record route. Sets the IPv4 record route option, which stores the route of the
164 packet inside the IPv4 header. The contents of the record route are only
165 printed if the \fB-v\fR and \fB-s\fR options are given. They are only set on
166 return packets if the target host preserves the record route option across
167 echos, or the \fB-l\fR option is given. This option is valid only on IPv4.
171 .ne 2
173 \fB\fB-U\fR\fR
175 .RS 24n
176 Send \fBUDP\fR packets instead of \fBICMP\fR (\fBICMP6\fR) packets. \fBping\fR
177 sends \fBUDP\fR packets to consecutive ports expecting to receive back
178 \fBICMP\fR (\fBICMP6\fR) \fBPORT_UNREACHABLE\fR from the target host.
182 .ne 2
184 \fB\fB-a\fR\fR
186 .RS 24n
187 \fBping\fR all addresses, both IPv4 and IPv6, of the multihomed destination.
188 The output appears as if \fBping\fR has been run once for each \fBIP\fR address
189 of the destination. If this option is used together with \fB-A\fR, \fBping\fR
190 probes only the addresses that are of the specified address family. When used
191 with the \fB-s\fR option and \fInpackets\fR is not specified, \fBping\fR
192 continuously probes the destination addresses in a round robin fashion. If
193 \fInpackets\fR is specified, \fBping\fR sends \fInpackets\fR number of probes
194 to each \fBIP\fR address of the destination and then exits.
198 .ne 2
200 \fB\fB-b\fR\fR
202 .RS 24n
203 Bypass the global IPsec policy and send and receive packets in the clear for
204 this connection only. This option can be used to troubleshoot network
205 connectivity independent of IPsec. Because this option bypasses system-wide
206 policy for this connection, it can only be used by superuser or a user granted
207 the sys_net_config privilege.
211 .ne 2
213 \fB\fB-c\fR\ \fItraffic_class\fR\fR
215 .RS 24n
216 Specify the traffic class of probe packets. The value must be an integer in the
217 range from 0 to 255. Gateways along the path can route the probe packet
218 differently, depending upon the value of \fItraffic_class\fR set in the probe
219 packet. This option is valid only on IPv6.
223 .ne 2
225 \fB\fB-d\fR\fR
227 .RS 24n
228 Set the \fBSO_DEBUG\fR socket option.
232 .ne 2
234 \fB\fB-g\fR\ \fIgateway\fR\fR
236 .RS 24n
237 Specify a loose source route gateway so that the probe packet goes through the
238 specified host along the path to the target host. The maximum number of
239 gateways is 8 for IPv4 and 127 for IPv6. Note that some factors such as the
240 link \fBMTU\fR can further limit the number of gateways for IPv6.
244 .ne 2
246 \fB\fB-i\fR \fIinterface_address\fR\fR
248 .RS 24n
249 Specify the outgoing interface address to use for multicast packets for IPv4
250 and both multicast and unicast packets for IPv6. The default interface address
251 for multicast packets is determined from the (unicast) routing tables.
252 \fIinterface_address\fR can be a literal \fBIP\fR address, for example,
253 \fB10.123.100.99\fR, or an interface name, for example, \fBeri0\fR, or an
254 interface index, for example \fB2\fR.
258 .ne 2
260 \fB\fB-l\fR\fR
262 .RS 24n
263 Use to send the probe packet to the given host and back again using loose
264 source routing. Usually specified with the \fB-R\fR option. If any gateways are
265 specified using \fB-g\fR, they are visited twice, both to and from the
266 destination. This option is ignored if the \fB-U\fR option is used.
270 .ne 2
272 \fB\fB-n\fR\fR
274 .RS 24n
275 Show network addresses as numbers. \fBping\fR normally does a reverse name
276 lookup on the IP addresses it extracts from the packets received. The \fB-n\fR
277 option blocks the reverse lookup, so \fBping\fR prints IP addresses instead of
278 host names.
282 .ne 2
284 \fB\fB-p\fR\ \fIport\fR\fR
286 .RS 24n
287 Set the base \fBUDP\fR \fIport\fR number used in probes. This option is used
288 with the \fB-U\fR option. The default base \fIport\fR number is 33434. The
289 \fBping\fR utility starts setting the destination port number of \fBUDP\fR
290 packets to this base and increments it by one at each probe.
294 .ne 2
296 \fB\fB-r\fR\fR
298 .RS 24n
299 Bypass the normal routing tables and send directly to a host on an attached
300 network. If the host is not on a directly attached network, an error is
301 returned. This option can be used to \fBping\fR a local host through an
302 interface that has been dropped by the router daemon. See \fBin.routed\fR(1M).
306 .ne 2
308 \fB\fB-s\fR\fR
310 .RS 24n
311 Send one datagram per second and collect statistics.
315 .ne 2
317 \fB\fB-t\fR\ \fIttl\fR\fR
319 .RS 24n
320 Specify the IPv4 time to live, or IPv6 hop limit, for unicast and multicast
321 packets. The default time to live (hop limit) for unicast packets can be set
322 with the \fBndd\fR module, \fB/dev/icmp\fR, using the \fBicmp_ipv4_ttl\fR
323 variable for IPv4 and the \fBicmp_ipv6_hoplimit\fR variable for IPv6. The
324 default time to live (hop limit) for multicast is one hop. See \fBEXAMPLES\fR.
325 For further information, see\fBndd\fR(1M).
329 .ne 2
331 \fB\fB-v\fR\fR
333 .RS 24n
334 Verbose output. List any \fBICMP\fR (\fBICMP6\fR) packets, other than replies
335 from the target host.
338 .SH OPERANDS
340 .ne 2
342 \fB\fIhost\fR\fR
344 .RS 8n
345 The network host
348 .SH EXAMPLES
350 \fBExample 1 \fRUsing \fBping\fR With IPv6
353 This example shows \fBping\fR sending probe packets to all the IPv6 addresses
354 of the host \fBxyz\fR, one at a time. It sends an \fBICMP6\fR
355 \fBECHO_REQUEST\fR every second until the user interrupts it.
358 .in +2
360 istanbul% \fBping -s -A inet6 -a xyz\fR
361 PING xyz: 56 data bytes
362 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=0. time=0.479 ms
363 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=1. time=0.843 ms
364 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=2. time=0.516 ms
365 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=3. time=4.943 ms
366 64 bytes from xyz (4::114:a00:20ff:ab3d:83ed): icmp_seq=4. time=0.485 ms
367 64 bytes from xyz (fec0::114:a00:20ff:ab3d:83ed): icmp_seq=5. time=2.201 ms
369 ----xyz PING Statistics----
370 6 packets transmitted, 6 packets received, 0% packet loss
371 round-trip (ms)  min/avg/stddev = 0.479/1.583/4.943/1.823
373 .in -2
377 \fBExample 2 \fRUsing \fBndd\fR to Set the \fBicmp_ipv6_hoplimit\fR
380 This example shows the \fBndd\fR module, \fB/dev/icmp\fR, used to set the
381 \fBicmp_ipv6_hoplimit\fR.
384 .in +2
386 # ndd -set /dev/icmp icmp_ipv6_hoplimit 100
388 .in -2
391 .SH EXIT STATUS
394 The following exit values are returned:
396 .ne 2
398 \fB\fB0\fR\fR
400 .RS 12n
401 Successful operation; the machine is alive.
405 .ne 2
407 \fBnon-zero\fR
409 .RS 12n
410 An error has occurred. Either a malformed argument has been specified, or the
411 machine was not alive.
414 .SH SEE ALSO
417 \fBifconfig\fR(1M), \fBin.routed\fR(1M), \fBndd\fR(1M), \fBnetstat\fR(1M),
418 \fBrpcinfo\fR(1M), \fBtraceroute\fR(1M), \fBattributes\fR(5), \fBicmp\fR(7P),
419 \fBicmp6\fR(7P)