Remove IPsec and related code from the system.
[dragonfly.git] / sbin / ping6 / ping6.8
1 .\"     $KAME: ping6.8,v 1.43 2001/06/28 06:54:29 suz Exp $
2 .\"
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the project nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     $FreeBSD: src/sbin/ping6/ping6.8,v 1.3.2.12 2003/02/24 00:56:42 trhodes Exp $
31 .\"
32 .Dd April 21, 2018
33 .Dt PING6 8
34 .Os
35 .Sh NAME
36 .Nm ping6
37 .Nd send
38 .Tn ICMPv6 ECHO_REQUEST
39 packets to network hosts
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl dfHnNqRtvwW
43 .Bk -words
44 .Op Fl a Ar addrtype
45 .Ek
46 .Bk -words
47 .Op Fl b Ar bufsiz
48 .Ek
49 .Bk -words
50 .Op Fl c Ar count
51 .Ek
52 .Bk -words
53 .Op Fl h Ar hoplimit
54 .Ek
55 .Bk -words
56 .Op Fl I Ar interface
57 .Ek
58 .Bk -words
59 .Op Fl i Ar wait
60 .Ek
61 .Bk -words
62 .Op Fl l Ar preload
63 .Ek
64 .Bk -words
65 .Op Fl p Ar pattern
66 .Ek
67 .Bk -words
68 .Op Fl S Ar sourceaddr
69 .Ek
70 .Bk -words
71 .Op Fl s Ar packetsize
72 .Ek
73 .Bk -words
74 .Op Ar hops...\&
75 .Ek
76 .Bk -words
77 .Ar host
78 .Ek
79 .Sh DESCRIPTION
80 The
81 .Nm
82 utility uses the
83 .Tn ICMPv6
84 protocol's mandatory
85 .Tn ICMP6_ECHO_REQUEST
86 datagram to elicit an
87 .Tn ICMP6_ECHO_REPLY
88 from a host or gateway.
89 .Tn ICMP6_ECHO_REQUEST
90 datagrams (``pings'') have an IPv6 header,
91 and
92 .Tn ICMPv6
93 header formatted as documented in RFC 2463.
94 The options are as follows:
95 .Bl -tag -width Ds
96 .It Fl a Ar addrtype
97 Generate ICMPv6 Node Information Node Addresses query, rather than echo-request.
98 .Ar addrtype
99 must be a string constructed of the following characters.
100 .Bl -tag -width Ds -compact
101 .It Ic a
102 requests all the responder's unicast addresses.
103 If the character is omitted,
104 only those addresses which belong to the interface which has the
105 responder's address are requests.
106 .It Ic c
107 requests responder's IPv4-compatible and IPv4-mapped addresses.
108 .It Ic g
109 requests responder's global-scope addresses.
110 .It Ic s
111 requests responder's site-local addresses.
112 .It Ic l
113 requests responder's link-local addresses.
114 .It Ic A
115 requests responder's anycast addresses.
116 Without this character, the responder will return unicast addresses only.
117 With this character, the responder will return anycast addresses only.
118 Note that the specification does not specify how to get responder's
119 anycast addresses.
120 This is an experimental option.
121 .El
122 .It Fl b Ar bufsiz
123 Set socket buffer size.
124 .It Fl c Ar count
125 Stop after sending
126 (and receiving)
127 .Ar count
128 .Tn ECHO_RESPONSE
129 packets.
130 .It Fl d
131 Set the
132 .Dv SO_DEBUG
133 option on the socket being used.
134 .It Fl f
135 Flood ping.
136 Outputs packets as fast as they come back or one hundred times per second,
137 whichever is more.
138 For every
139 .Tn ECHO_REQUEST
140 sent a period
141 .Dq .\&
142 is printed, while for every
143 .Tn ECHO_REPLY
144 received a backspace is printed.
145 This provides a rapid display of how many packets are being dropped.
146 Only the super-user may use this option.
147 .Bf -emphasis
148 This can be very hard on a network and should be used with caution.
149 .Ef
150 .It Fl H
151 Specifies to try reverse-lookup of IPv6 addresses.
152 The
153 .Nm
154 utility does not try reverse-lookup unless the option is specified.
155 .It Fl h Ar hoplimit
156 Set the IPv6 hoplimit.
157 .It Fl I Ar interface
158 Source packets with the given interface address.
159 This flag applies if the ping destination is a multicast address,
160 or link-local/site-local unicast address.
161 .It Fl i Ar wait
162 Wait
163 .Ar wait
164 seconds
165 .Em between sending each packet .
166 The default is to wait for one second between each packet.
167 This option is incompatible with the
168 .Fl f
169 option.
170 .It Fl l Ar preload
171 If
172 .Ar preload
173 is specified,
174 .Nm
175 sends that many packets as fast as possible before falling into its normal
176 mode of behavior.
177 Only the super-user may use this option.
178 .It Fl n
179 Numeric output only.
180 No attempt will be made to lookup symbolic names from addresses in the reply.
181 .It Fl N
182 Probe node information multicast group
183 .Pq Li ff02::2:xxxx:xxxx .
184 .Ar host
185 must be string hostname of the target
186 (must not be a numeric IPv6 address).
187 Node information multicast group will be computed based on given
188 .Ar host ,
189 and will be used as the final destination.
190 Since node information multicast group is a link-local multicast group,
191 destination link needs to be specified by
192 .Fl I
193 option.
194 .It Fl p Ar pattern
195 You may specify up to 16
196 .Dq pad
197 bytes to fill out the packet you send.
198 This is useful for diagnosing data-dependent problems in a network.
199 For example,
200 .Dq Li \-p ff
201 will cause the sent packet to be filled with all
202 ones.
203 .It Fl q
204 Quiet output.
205 Nothing is displayed except the summary lines at startup time and
206 when finished.
207 .It Fl R
208 Make the kernel believe that the target
209 .Ar host
210 (or the first
211 .Ar hop
212 if you specify
213 .Ar hops )
214 is reachable, by injecting upper-layer reachability confirmation hint.
215 The option is meaningful only if the target
216 .Ar host
217 (or the first hop)
218 is a neighbor.
219 .It Fl S Ar sourceaddr
220 Specifies the source address of request packets.
221 The source address must be one of the unicast addresses of the sending node.
222 If the outgoing interface is specified by the
223 .Fl I
224 option as well,
225 .Ar sourceaddr
226 needs to be an address assigned to the specified interface.
227 .It Fl s Ar packetsize
228 Specifies the number of data bytes to be sent.
229 The default is 56, which translates into 64
230 .Tn ICMP
231 data bytes when combined
232 with the 8 bytes of
233 .Tn ICMP
234 header data.
235 You may need to specify
236 .Fl b
237 as well to extend socket buffer size.
238 .It Fl t
239 Generate ICMPv6 Node Information supported query types query,
240 rather than echo-request.
241 .Fl s
242 has no effect if
243 .Fl t
244 is specified.
245 .It Fl v
246 Verbose output.
247 .Tn ICMP
248 packets other than
249 .Tn ECHO_RESPONSE
250 that are received are listed.
251 .It Fl w
252 Generate ICMPv6 Node Information DNS Name query, rather than echo-request.
253 .Fl s
254 has no effect if
255 .Fl w
256 is specified.
257 .It Fl W
258 Same as
259 .Fl w ,
260 but with old packet format based on 03 draft.
261 This option is present for backward compatibility.
262 .Fl s
263 has no effect if
264 .Fl w
265 is specified.
266 .It Ar hops
267 IPv6 addresses for intermediate nodes,
268 which will be put into type 0 routing header.
269 .It Ar host
270 IPv6 address of the final destination node.
271 .El
272 .Pp
273 When using
274 .Nm
275 for fault isolation, it should first be run on the local host, to verify
276 that the local network interface is up and running.
277 Then, hosts and gateways further and further away should be
278 .Dq pinged .
279 Round-trip times and packet loss statistics are computed.
280 If duplicate packets are received, they are not included in the packet
281 loss calculation, although the round trip time of these packets is used
282 in calculating the round-trip time statistics.
283 When the specified number of packets have been sent
284 (and received)
285 or if the program is terminated with a
286 .Dv SIGINT ,
287 a brief summary is displayed, showing the number of packets sent and
288 received, and the minimum, mean, maximum, and standard deviation of
289 the round-trip times.
290 .Pp
291 If
292 .Nm
293 receives a
294 .Dv SIGINFO
295 (see the
296 .Cm status
297 argument for
298 .Xr stty 1 )
299 signal, the current number of packets sent and received, and the
300 minimum, mean, maximum, and standard deviation of the round-trip times
301 will be written to the standard output in the same format as the
302 standard completion message.
303 .Pp
304 This program is intended for use in network testing, measurement and
305 management.
306 Because of the load it can impose on the network, it is unwise to use
307 .Nm
308 during normal operations or from automated scripts.
309 .\" .Sh ICMP PACKET DETAILS
310 .\" An IP header without options is 20 bytes.
311 .\" An
312 .\" .Tn ICMP
313 .\" .Tn ECHO_REQUEST
314 .\" packet contains an additional 8 bytes worth of
315 .\" .Tn ICMP
316 .\" header followed by an arbitrary amount of data.
317 .\" When a
318 .\" .Ar packetsize
319 .\" is given, this indicated the size of this extra piece of data
320 .\" (the default is 56).
321 .\" Thus the amount of data received inside of an IP packet of type
322 .\" .Tn ICMP
323 .\" .Tn ECHO_REPLY
324 .\" will always be 8 bytes more than the requested data space
325 .\" (the
326 .\" .Tn ICMP
327 .\" header).
328 .\" .Pp
329 .\" If the data space is at least eight bytes large,
330 .\" .Nm
331 .\" uses the first eight bytes of this space to include a timestamp which
332 .\" it uses in the computation of round trip times.
333 .\" If less than eight bytes of pad are specified, no round trip times are
334 .\" given.
335 .Sh DUPLICATE AND DAMAGED PACKETS
336 The
337 .Nm
338 utility will report duplicate and damaged packets.
339 Duplicate packets should never occur when pinging a unicast address,
340 and seem to be caused by
341 inappropriate link-level retransmissions.
342 Duplicates may occur in many situations and are rarely
343 (if ever)
344 a good sign, although the presence of low levels of duplicates may not
345 always be cause for alarm.
346 Duplicates are expected when pinging a broadcast or multicast address,
347 since they are not really duplicates but replies from different hosts
348 to the same request.
349 .Pp
350 Damaged packets are obviously serious cause for alarm and often
351 indicate broken hardware somewhere in the
352 .Nm
353 packet's path
354 (in the network or in the hosts).
355 .Sh TRYING DIFFERENT DATA PATTERNS
356 The
357 (inter)network
358 layer should never treat packets differently depending on the data
359 contained in the data portion.
360 Unfortunately, data-dependent problems have been known to sneak into
361 networks and remain undetected for long periods of time.
362 In many cases the particular pattern that will have problems is something
363 that does not have sufficient
364 .Dq transitions ,
365 such as all ones or all zeros, or a pattern right at the edge, such as
366 almost all zeros.
367 It is not
368 necessarily enough to specify a data pattern of all zeros (for example)
369 on the command line because the pattern that is of interest is
370 at the data link level, and the relationship between what you type and
371 what the controllers transmit can be complicated.
372 .Pp
373 This means that if you have a data-dependent problem you will probably
374 have to do a lot of testing to find it.
375 If you are lucky, you may manage to find a file that either
376 cannot
377 be sent across your network or that takes much longer to transfer than
378 other similar length files.
379 You can then examine this file for repeated patterns that you can test
380 using the
381 .Fl p
382 option of
383 .Nm .
384 .Sh EXIT STATUS
385 The
386 .Nm
387 utility returns 0 on success (the host is alive),
388 and non-zero if the arguments are incorrect or the host is not responding.
389 .Sh EXAMPLES
390 Normally,
391 .Nm
392 works just like
393 .Xr ping 8
394 would work; the following will send ICMPv6 echo request to
395 .Li dst.foo.com .
396 .Bd -literal -offset indent
397 ping6 -n dst.foo.com
398 .Ed
399 .Pp
400 The following will probe hostnames for all nodes on the network link attached to
401 .Li wi0
402 interface.
403 The address
404 .Li ff02::1
405 is named the link-local all-node multicast address, and the packet would
406 reach every node on the network link.
407 .Bd -literal -offset indent
408 ping6 -w ff02::1%wi0
409 .Ed
410 .Pp
411 The following will probe addresses assigned to the destination node,
412 .Li dst.foo.com .
413 .Bd -literal -offset indent
414 ping6 -a agl dst.foo.com
415 .Ed
416 .Sh SEE ALSO
417 .Xr netstat 1 ,
418 .Xr icmp6 4 ,
419 .Xr inet6 4 ,
420 .Xr ip6 4 ,
421 .Xr ifconfig 8 ,
422 .Xr ping 8 ,
423 .Xr routed 8 ,
424 .Xr traceroute 8 ,
425 .Xr traceroute6 8
426 .Rs
427 .%A A. Conta
428 .%A S. Deering
429 .%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"
430 .%N RFC 2463
431 .%D December 1998
432 .Re
433 .Rs
434 .%A Matt Crawford
435 .%T "IPv6 Node Information Queries"
436 .%N draft-ietf-ipngwg-icmp-name-lookups-07.txt
437 .%D August 2000
438 .%O work in progress material
439 .Re
440 .Sh HISTORY
441 The
442 .Xr ping 8
443 command appeared in
444 .Bx 4.3 .
445 The
446 .Nm
447 utility with IPv6 support first appeared in WIDE Hydrangea IPv6 protocol stack
448 kit.
449 .Pp
450 IPv6 support based on the KAME Project
451 .Pa ( http://www.kame.net/ )
452 stack was initially integrated into
453 .Fx 4.0
454 .Sh BUGS
455 There have been many discussions on why we separate
456 .Nm
457 and
458 .Xr ping 8 .
459 Some people argued that it would be more convenient to uniform the
460 ping command for both IPv4 and IPv6.
461 The followings are an answer to the request.
462 .Pp
463 From a developer's point of view:
464 since the underling raw sockets API is totally different between IPv4
465 and IPv6, we would end up having two types of code base.
466 There would actually be less benefit to uniform the two commands
467 into a single command from the developer's standpoint.
468 .Pp
469 From an operator's point of view: unlike ordinary network applications
470 like remote login tools, we are usually aware of address family when using
471 network management tools.
472 We do not just want to know the reachability to the host, but want to know the
473 reachability to the host via a particular network protocol such as
474 IPv6.
475 Thus, even if we had a unified
476 .Xr ping 8
477 command for both IPv4 and IPv6, we would usually type a
478 .Fl 6
479 or
480 .Fl 4
481 option (or something like those) to specify the particular address family.
482 This essentially means that we have two different commands.