]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/ping/ping.8
zfs: merge openzfs/zfs@59493b63c (master)
[FreeBSD/FreeBSD.git] / sbin / ping / ping.8
1 .\" Copyright (c) 1985, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)ping.8      8.2 (Berkeley) 12/11/93
29 .\" $FreeBSD$
30 .\"
31 .Dd November 26, 2020
32 .Dt PING 8
33 .Os
34 .Sh NAME
35 .Nm ping
36 .Nd send
37 .Tn ICMP
38 or
39 .Tn ICMPv6 ECHO_REQUEST
40 packets to network hosts
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl 4AaDdfHnoQqRrv
44 .Op Fl .\& Ns Ar chars
45 .Op Fl C Ar pcp
46 .Op Fl c Ar count
47 .Op Fl G Ar sweepmaxsize
48 .Op Fl g Ar sweepminsize
49 .Op Fl h Ar sweepincrsize
50 .Op Fl i Ar wait
51 .Op Fl l Ar preload
52 .Op Fl M Cm mask | time
53 .Op Fl m Ar ttl
54 .Op Fl P Ar policy
55 .Op Fl p Ar pattern
56 .Op Fl S Ar src_addr
57 .Op Fl s Ar packetsize
58 .Op Fl t Ar timeout
59 .Op Fl W Ar waittime
60 .Op Fl z Ar tos
61 .Ar IPv4-host
62 .Nm
63 .Op Fl 4AaDdfHLnoQqRrv
64 .Op Fl .\& Ns Ar chars
65 .Op Fl C Ar pcp
66 .Op Fl c Ar count
67 .Op Fl I Ar iface
68 .Op Fl i Ar wait
69 .Op Fl l Ar preload
70 .Op Fl M Cm mask | time
71 .Op Fl m Ar ttl
72 .Op Fl P Ar policy
73 .Op Fl p Ar pattern
74 .Op Fl S Ar src_addr
75 .Op Fl s Ar packetsize
76 .Op Fl T Ar ttl
77 .Op Fl t Ar timeout
78 .Op Fl W Ar waittime
79 .Op Fl z Ar tos
80 .Ar IPv4-mcast-group
81 .Nm
82 .Op Fl 6AaDdEfHNnOoquvYyZ
83 .Op Fl .\& Ns Ar chars
84 .Op Fl b Ar bufsiz
85 .Op Fl c Ar count
86 .Op Fl e Ar gateway
87 .Op Fl I Ar interface
88 .Op Fl i Ar wait
89 .Op Fl k Ar addrtype
90 .Op Fl l Ar preload
91 .Op Fl m Ar hoplimit
92 .Op Fl P Ar policy
93 .Op Fl p Ar pattern
94 .Op Fl S Ar sourceaddr
95 .Op Fl s Ar packetsize
96 .Op Fl t Ar timeout
97 .Op Fl W Ar waittime
98 .Op Ar IPv6-hops ...
99 .Ar IPv6-host
100 .Sh DESCRIPTION
101 The
102 .Nm
103 utility invoked with an IPv4 target
104 .Ns ( Ar IPv4-host No or Ar IPv4-mcast-group Ns )
105 uses the
106 .Tn ICMP
107 .No protocol Ap s mandatory
108 .Tn ECHO_REQUEST
109 datagram to elicit an
110 .Tn ICMP ECHO_RESPONSE
111 from a host or gateway.
112 .Tn ECHO_REQUEST
113 datagrams
114 .Pq Dq pings
115 have an IP and
116 .Tn ICMP
117 header, followed by a
118 .Dq struct timeval
119 and then an arbitrary number of
120 .Dq pad
121 bytes used to fill out the packet.
122 .Pp
123 When invoked with an IPv6 target
124 .Ns ( Ar IPv6-host Ns ) Ns ,
125 it uses the
126 .Tn ICMPv6
127 protocol's mandatory
128 .Tn ICMP6_ECHO_REQUEST
129 datagram to elicit an
130 .Tn ICMP6_ECHO_REPLY
131 .Ns .
132 .Tn ICMP6_ECHO_REQUEST
133 datagrams have an IPv6 header and
134 .Tn ICMPv6
135 header formatted as documented in RFC 2463.
136 .Pp
137 When invoked with a hostname, the version to which the target is resolved first is used.
138 In that case, the options and arguments used must be valid for the specific IP version, otherwise
139 .Nm
140 exits with an error.
141 If the target is resolved to both IPv4 and IPv6, the specific IP version can be requested by
142 .Fl 4
143 or
144 .Fl 6
145 options, respectively.
146 For backwards-compatibility, ICMPv6 can also be selected by invoking the binary
147 as
148 .Nm ping6 .
149 .Ss Options common to both IPv4 and IPv6 targets
150 .Bl -tag -width indent
151 .It Fl .\& Ns Ar chars
152 By default, for every
153 .Tn ECHO_REQUEST
154 sent, a period
155 .Dq .\&
156 is printed, while for every
157 .Tn ECHO_REPLY
158 received, a backspace is printed.
159 This option takes an optional string argument listing characters
160 that will be printed one by one in the provided order
161 instead of the default period.
162 .Pp
163 Example usage:
164 .Bd -literal -offset indent
165 ping -.0123456789 freebsd.org
166 .Ed
167 .It Fl A
168 Audible.
169 Output a bell
170 .Tn ( ASCII
171 0x07)
172 character when no packet is received before the next packet
173 is transmitted.
174 To cater for round-trip times that are longer than the interval
175 between transmissions, further missing packets cause a bell only
176 if the maximum number of unreceived packets has increased.
177 .It Fl a
178 Audible.
179 Include a bell
180 .Tn ( ASCII
181 0x07)
182 character in the output when any packet is received.
183 .It Fl C Ar pcp
184 Add an 802.1p Ethernet Priority Code Point when sending a packet.
185 0..7 uses that specific PCP, -1 uses the interface default PCP (or none).
186 .It Fl c Ar count
187 Stop after sending
188 (and receiving)
189 .Ar count
190 .Tn ECHO_RESPONSE
191 packets.
192 If this option is not specified,
193 .Nm
194 will operate until interrupted.
195 .Pp
196 For an IPv4 target, if this option is specified in conjunction with ping sweeps,
197 each sweep will consist of
198 .Ar count
199 packets.
200 .It Fl D
201 Disable fragmentation.
202 .It Fl d
203 Set the
204 .Dv SO_DEBUG
205 option on the socket being used.
206 .It Fl f
207 Flood ping.
208 Outputs packets as fast as they come back or one hundred times per second,
209 whichever is more.
210 Implies
211 .Fl .\&
212 to print a period for every
213 .Tn ECHO_REQUEST
214 sent and a backspace for every
215 .Tn ECHO_REPLY
216 received.
217 This provides a rapid display of how many packets are being dropped.
218 Only the super-user may use this option.
219 .Bf -emphasis
220 This can be very hard on a network and should be used with caution.
221 .Ef
222 .It Fl H
223 Hostname output.
224 Try to do a reverse DNS lookup when displaying addresses.
225 This is the opposite of the
226 .Fl n
227 option.
228 .It Fl I Ar iface
229 For an IPv4 target,
230 .Ar iface
231 is an IP address indentifying an interface from which the packets will be sent.
232 This flag applies only if the ping target is a multicast address.
233 .Pp
234 For an IPv6 target,
235 .Ar iface
236 is a name of an interface (e.g. `em0') from which the packets will be sent.
237 This flag applies if the ping target is a multicast address, or link-local/site-local
238 unicast address.
239 .It Fl i Ar wait
240 Wait
241 .Ar wait
242 seconds
243 .Em between sending each packet .
244 The default is to wait for one second between each packet.
245 The wait time may be fractional, but only the super-user may specify
246 values less than 1 second.
247 This option is incompatible with the
248 .Fl f
249 option.
250 .It Fl l Ar preload
251 If
252 .Ar preload
253 is specified,
254 .Nm
255 sends that many packets as fast as possible before falling into its normal
256 mode of behavior.
257 Only the super-user may use this option.
258 .It Fl m Ar ttl
259 For an IPv4 target, set the IP Time To Live for outgoing packets.
260 If not specified, the kernel uses the value of the
261 .Va net.inet.ip.ttl
262 MIB variable.
263 .Pp
264 For an IPv6 target, set the IPv6 hoplimit.
265 .It Fl n
266 Numeric output only.
267 No attempt will be made to lookup symbolic names for host addresses.
268 This is the opposite of
269 .Fl H ,
270 and it is the default behavior.
271 .It Fl o
272 Exit successfully after receiving one reply packet.
273 .It Fl P Ar policy
274 .Ar policy
275 specifies IPsec policy for the ping session.
276 For details please refer to
277 .Xr ipsec 4
278 and
279 .Xr ipsec_set_policy 3 .
280 .It Fl p Ar pattern
281 You may specify up to 16
282 .Dq pad
283 bytes to fill out the packet you send.
284 This is useful for diagnosing data-dependent problems in a network.
285 For example,
286 .Dq Li \-p ff
287 will cause the sent packet to be filled with all
288 ones.
289 .It Fl q
290 Quiet output.
291 Nothing is displayed except the summary lines at startup time and
292 when finished.
293 .It Fl S Ar src_addr
294 Use the following IP address as the source address in outgoing packets.
295 On hosts with more than one IP address, this option can be used to
296 force the source address to be something other than the IP address
297 of the interface the probe packet is sent on.
298 .Pp
299 For IPv4, if the IP address is not one of this machine's interface
300 addresses, an error is returned and nothing is sent.
301 .Pp
302 For IPv6, the source address must be one of the unicast addresses of
303 the sending node, and must be numeric.
304 .It Fl s Ar packetsize
305 Specify the number of data bytes to be sent.
306 The default is 56, which translates into 64
307 .Tn ICMP
308 data bytes when combined
309 with the 8 bytes of
310 .Tn ICMP
311 header data.
312 .Pp
313 For IPv4, only the super-user may specify values more than default.
314 This option cannot be used with ping sweeps.
315 .Pp
316 For IPv6, you may need to specify
317 .Fl b
318 as well to extend socket buffer size.
319 .It Fl t Ar timeout
320 Specify a timeout, in seconds, before ping exits regardless of how
321 many packets have been received.
322 .It Fl v
323 Verbose output.
324 .Tn ICMP
325 packets other than
326 .Tn ECHO_RESPONSE
327 that are received are listed.
328 .It Fl W Ar waittime
329 Time in milliseconds to wait for a reply for each packet sent.
330 If a reply arrives later, the packet is not printed as replied, but
331 considered as replied when calculating statistics.
332 .El
333 .Ss Options only for IPv4 targets
334 .Bl -tag -width indent
335 .It Fl 4
336 Use IPv4 regardless of how the target is resolved.
337 .It Fl G Ar sweepmaxsize
338 Specify the maximum size of
339 .Tn ICMP
340 payload when sending sweeping pings.
341 This option is required for ping sweeps.
342 .It Fl g Ar sweepminsize
343 Specify the size of
344 .Tn ICMP
345 payload to start with when sending sweeping pings.
346 The default value is 0.
347 .It Fl h Ar sweepincrsize
348 Specify the number of bytes to increment the size of
349 .Tn ICMP
350 payload after
351 each sweep when sending sweeping pings.
352 The default value is 1.
353 .It Fl L
354 Suppress loopback of multicast packets.
355 This flag only applies if the ping destination is a multicast address.
356 .It Fl M Cm mask | time
357 Use
358 .Dv ICMP_MASKREQ
359 or
360 .Dv ICMP_TSTAMP
361 instead of
362 .Dv ICMP_ECHO .
363 For
364 .Cm mask ,
365 print the netmask of the remote machine.
366 Set the
367 .Va net.inet.icmp.maskrepl
368 MIB variable to enable
369 .Dv ICMP_MASKREPLY
370 and
371 .Va net.inet.icmp.maskfake
372 if you want to override the netmask in the response.
373 For
374 .Cm time ,
375 print the origination, reception and transmission timestamps.
376 Set the
377 .Va net.inet.icmp.tstamprepl
378 MIB variable to enable or disable
379 .Dv ICMP_TSTAMPREPLY .
380 .It Fl Q
381 Somewhat quiet output.
382 .No Don Ap t
383 display ICMP error messages that are in response to our query messages.
384 Originally, the
385 .Fl v
386 flag was required to display such errors, but
387 .Fl v
388 displays all ICMP error messages.
389 On a busy machine, this output can be overbearing.
390 Without the
391 .Fl Q
392 flag,
393 .Nm
394 prints out any ICMP error messages caused by its own ECHO_REQUEST
395 messages.
396 .It Fl R
397 Record route.
398 Includes the
399 .Tn RECORD_ROUTE
400 option in the
401 .Tn ECHO_REQUEST
402 packet and displays
403 the route buffer on returned packets.
404 Note that the IP header is only large enough for nine such routes;
405 the
406 .Xr traceroute 8
407 command is usually better at determining the route packets take to a
408 particular destination.
409 If more routes come back than should, such as due to an illegal spoofed
410 packet, ping will print the route list and then truncate it at the correct
411 spot.
412 Many hosts ignore or discard the
413 .Tn RECORD_ROUTE
414 option.
415 .It Fl r
416 Bypass the normal routing tables and send directly to a host on an attached
417 network.
418 If the host is not on a directly-attached network, an error is returned.
419 This option can be used to ping a local host through an interface
420 that has no route through it
421 (e.g., after the interface was dropped by
422 .Xr routed 8 ) .
423 .It Fl T Ar ttl
424 Set the IP Time To Live for multicasted packets.
425 This flag only applies if the ping destination is a multicast address.
426 .It Fl z Ar tos
427 Use the specified type of service.
428 .It Ar IPv4-host
429 hostname or IPv4 address of the final destination node.
430 .It Ar IPv4-mcast-group
431 IPv4 multicast address of the final destination nodes.
432 .El
433 .Ss Options only for IPv6 targets
434 .Bl -tag -width indent
435 .It Fl 6
436 Use IPv6 regardless of how the target is resolved.
437 .It Fl b Ar bufsiz
438 Set socket buffer size.
439 .It Fl e Ar gateway
440 Specifies to use
441 .Ar gateway
442 as the next hop to the destination.
443 The gateway must be a neighbor of the sending node.
444 .It Fl k Ar addrtype
445 Generate ICMPv6 Node Information Node Addresses query, rather than echo-request.
446 .Ar addrtype
447 must be a string constructed of the following characters.
448 .Bl -tag -width Ds -compact
449 .It Ic a
450 requests unicast addresses from all of the responder's interfaces.
451 If the character is omitted,
452 only those addresses which belong to the interface which has the
453 responder's address are requests.
454 .It Ic c
455 requests responder's IPv4-compatible and IPv4-mapped addresses.
456 .It Ic g
457 requests responder's global-scope addresses.
458 .It Ic s
459 requests responder's site-local addresses.
460 .It Ic l
461 requests responder's link-local addresses.
462 .It Ic A
463 requests responder's anycast addresses.
464 Without this character, the responder will return unicast addresses only.
465 With this character, the responder will return anycast addresses only.
466 Note that the specification does not specify how to get responder's
467 anycast addresses.
468 This is an experimental option.
469 .El
470 .It Fl N
471 Probe node information multicast group address
472 .Pq Li ff02::2:ffxx:xxxx .
473 .Ar host
474 must be string hostname of the target
475 (must not be a numeric IPv6 address).
476 Node information multicast group will be computed based on given
477 .Ar host ,
478 and will be used as the final destination.
479 Since node information multicast group is a link-local multicast group,
480 outgoing interface needs to be specified by
481 .Fl I
482 option.
483 .Pp
484 When specified twice, the address
485 .Pq Li ff02::2:xxxx:xxxx
486 is used instead.
487 The former is in RFC 4620, the latter is in an old Internet Draft
488 draft-ietf-ipngwg-icmp-name-lookup.
489 Note that KAME-derived implementations including
490 .Fx
491 use the latter.
492 .It Fl O
493 Generate ICMPv6 Node Information supported query types query,
494 rather than echo-request.
495 .Fl s
496 has no effect if
497 .Fl O
498 is specified.
499 .It Fl u
500 By default,
501 .Nm
502 asks the kernel to fragment packets to fit into the minimum IPv6 MTU.
503 The
504 .Fl u
505 option
506 will suppress the behavior in the following two levels:
507 when the option is specified once, the behavior will be disabled for
508 unicast packets.
509 When the option is more than once, it will be disabled for both
510 unicast and multicast packets.
511 .It Fl Y
512 Same as
513 .Fl y ,
514 but with old packet format based on 03 draft.
515 This option is present for backward compatibility.
516 .Fl s
517 has no effect if
518 .Fl y
519 is specified.
520 .It Fl y
521 Generate ICMPv6 Node Information DNS Name query, rather than echo-request.
522 .Fl s
523 has no effect if
524 .Fl y
525 is specified.
526 .It Ar IPv6-hops
527 IPv6 addresses for intermediate nodes,
528 which will be put into type 0 routing header.
529 .It Ar IPv6-host
530 IPv6 address of the final destination node.
531 .El
532 .Ss Experimental options only for IPv6 target
533 .Bl -tag -width indent
534 .It Fl E
535 Enables transport-mode IPsec encapsulated security payload.
536 .It Fl Z
537 Enables transport-mode IPsec authentication header.
538 .El
539 .Pp
540 When using
541 .Nm
542 for fault isolation, it should first be run on the local host, to verify
543 that the local network interface is up and running.
544 Then, hosts and gateways further and further away should be
545 .Dq pinged .
546 Round-trip times and packet loss statistics are computed.
547 If duplicate packets are received, they are not included in the packet
548 loss calculation, although the round trip time of these packets is used
549 in calculating the round-trip time statistics.
550 When the specified number of packets have been sent
551 (and received)
552 or if the program is terminated with a
553 .Dv SIGINT ,
554 a brief summary is displayed, showing the number of packets sent and
555 received, and the minimum, mean, maximum, and standard deviation of
556 the round-trip times.
557 .Pp
558 If
559 .Nm
560 receives a
561 .Dv SIGINFO
562 (see the
563 .Cm status
564 argument for
565 .Xr stty 1 )
566 signal, the current number of packets sent and received, and the
567 minimum, mean, maximum, and standard deviation of the round-trip times
568 will be written to the standard output.
569 .Pp
570 This program is intended for use in network testing, measurement and
571 management.
572 Because of the load it can impose on the network, it is unwise to use
573 .Nm
574 during normal operations or from automated scripts.
575 .Sh ICMP PACKET DETAILS
576 An IP header without options is 20 bytes.
577 An
578 .Tn ICMP
579 .Tn ECHO_REQUEST
580 packet contains an additional 8 bytes worth of
581 .Tn ICMP
582 header followed by an arbitrary amount of data.
583 When a
584 .Ar packetsize
585 is given, this indicated the size of this extra piece of data
586 (the default is 56).
587 Thus the amount of data received inside of an IP packet of type
588 .Tn ICMP
589 .Tn ECHO_REPLY
590 will always be 8 bytes more than the requested data space
591 (the
592 .Tn ICMP
593 header).
594 .Pp
595 If the data space is at least eight bytes large,
596 .Nm
597 uses the first eight bytes of this space to include a timestamp which
598 it uses in the computation of round trip times.
599 If less than eight bytes of pad are specified, no round trip times are
600 given.
601 .Sh DUPLICATE AND DAMAGED PACKETS
602 The
603 .Nm
604 utility will report duplicate and damaged packets.
605 Duplicate packets should never occur when pinging a unicast address,
606 and seem to be caused by
607 inappropriate link-level retransmissions.
608 Duplicates may occur in many situations and are rarely
609 (if ever)
610 a good sign, although the presence of low levels of duplicates may not
611 always be cause for alarm.
612 Duplicates are expected when pinging a broadcast or multicast address,
613 since they are not really duplicates but replies from different hosts
614 to the same request.
615 .Pp
616 Damaged packets are obviously serious cause for alarm and often
617 indicate broken hardware somewhere in the
618 .Nm
619 packet's path (in the network or in the hosts).
620 .Sh TRYING DIFFERENT DATA PATTERNS
621 The
622 (inter)network
623 layer should never treat packets differently depending on the data
624 contained in the data portion.
625 Unfortunately, data-dependent problems have been known to sneak into
626 networks and remain undetected for long periods of time.
627 In many cases the particular pattern that will have problems is something
628 that does not have sufficient
629 .Dq transitions ,
630 such as all ones or all zeros, or a pattern right at the edge, such as
631 almost all zeros.
632 It is not
633 necessarily enough to specify a data pattern of all zeros (for example)
634 on the command line because the pattern that is of interest is
635 at the data link level, and the relationship between what you type and
636 what the controllers transmit can be complicated.
637 .Pp
638 This means that if you have a data-dependent problem you will probably
639 have to do a lot of testing to find it.
640 If you are lucky, you may manage to find a file that either
641 cannot
642 be sent across your network or that takes much longer to transfer than
643 other similar length files.
644 You can then examine this file for repeated patterns that you can test
645 using the
646 .Fl p
647 option of
648 .Nm .
649 .Sh IPv4 TTL DETAILS
650 The
651 .Tn TTL
652 value of an IP packet represents the maximum number of IP routers
653 that the packet can go through before being thrown away.
654 In current practice you can expect each router in the Internet to decrement
655 the
656 .Tn TTL
657 field by exactly one.
658 .Pp
659 The
660 .Tn TCP/IP
661 specification recommends setting the
662 .Tn TTL
663 field for
664 .Tn IP
665 packets to 64, but many systems use smaller values
666 .No ( Bx 4.3
667 uses 30,
668 .Bx 4.2
669 used 15).
670 .Pp
671 The maximum possible value of this field is 255, and most
672 .Ux
673 systems set
674 the
675 .Tn TTL
676 field of
677 .Tn ICMP ECHO_REQUEST
678 packets to 255.
679 This is why you will find you can
680 .Dq ping
681 some hosts, but not reach them with
682 .Xr telnet 1
683 or
684 .Xr ftp 1 .
685 .Pp
686 In normal operation
687 .Nm
688 prints the ttl value from the packet it receives.
689 When a remote system receives a ping packet, it can do one of three things
690 with the
691 .Tn TTL
692 field in its response:
693 .Bl -bullet
694 .It
695 Not change it; this is what
696 .Bx
697 systems did before the
698 .Bx 4.3 tahoe
699 release.
700 In this case the
701 .Tn TTL
702 value in the received packet will be 255 minus the
703 number of routers in the round-trip path.
704 .It
705 Set it to 255; this is what current
706 .Bx
707 systems do.
708 In this case the
709 .Tn TTL
710 value in the received packet will be 255 minus the
711 number of routers in the path
712 .Em from
713 the remote system
714 .Em to
715 the
716 .Nm Ns Em ing
717 host.
718 .It
719 Set it to some other value.
720 Some machines use the same value for
721 .Tn ICMP
722 packets that they use for
723 .Tn TCP
724 packets, for example either 30 or 60.
725 Others may use completely wild values.
726 .El
727 .Sh EXIT STATUS
728 The
729 .Nm
730 utility exits with one of the following values:
731 .Bl -tag -width indent
732 .It 0
733 At least one response was heard from the specified
734 .Ar host .
735 .It 2
736 The transmission was successful but no responses were received.
737 .It any other value
738 An error occurred.
739 .El
740 .Sh EXAMPLES
741 The following will send ICMPv6 echo request to
742 .Li dst.foo.com .
743 .Bd -literal -offset indent
744 ping -6 -n dst.foo.com
745 .Ed
746 .Pp
747 The following will probe hostnames for all nodes on the network link attached to
748 .Li wi0
749 interface.
750 The address
751 .Li ff02::1
752 is named the link-local all-node multicast address, and the packet would
753 reach every node on the network link.
754 .Bd -literal -offset indent
755 ping -6 -y ff02::1%wi0
756 .Ed
757 .Pp
758 The following will probe addresses assigned to the destination node,
759 .Li dst.foo.com .
760 .Bd -literal -offset indent
761 ping -6 -k agl dst.foo.com
762 .Ed
763 .Sh SEE ALSO
764 .Xr netstat 1 ,
765 .Xr icmp 4 ,
766 .Xr icmp6 4 ,
767 .Xr inet6 4 ,
768 .Xr ip6 4 ,
769 .Xr ifconfig 8 ,
770 .Xr routed 8 ,
771 .Xr traceroute 8 ,
772 .Xr traceroute6 8
773 .Rs
774 .%A A. Conta
775 .%A S. Deering
776 .%T "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification"
777 .%N RFC 2463
778 .%D December 1998
779 .Re
780 .Rs
781 .%A Matt Crawford
782 .%T "IPv6 Node Information Queries"
783 .%N draft-ietf-ipngwg-icmp-name-lookups-09.txt
784 .%D May 2002
785 .%O work in progress material
786 .Re
787 .Sh HISTORY
788 The
789 .Nm
790 utility appeared in
791 .Bx 4.3 .
792 The
793 .Nm ping6
794 utility with IPv6 support first appeared in the WIDE Hydrangea IPv6
795 protocol stack kit.
796 .Pp
797 IPv6 and IPsec support based on the KAME Project
798 .Pq Pa https://www.kame.net/
799 stack was initially integrated into
800 .Fx 4.0 .
801 .Pp
802 The
803 .Nm ping6
804 utility was merged to
805 .Nm
806 in Google Summer of Code 2019.
807 .Sh AUTHORS
808 The original
809 .Nm
810 utility was written by
811 .An Mike Muuss
812 while at the US Army Ballistics
813 Research Laboratory.
814 .Sh BUGS
815 Many Hosts and Gateways ignore the IPv4
816 .Tn RECORD_ROUTE
817 option.
818 .Pp
819 The maximum IP header length is too small for options like
820 .Tn RECORD_ROUTE
821 to be completely useful.
822 .No There Ap s
823 not much that can be done about this, however.
824 .Pp
825 Flood pinging is not recommended in general, and flood pinging the
826 broadcast address should only be done under very controlled conditions.
827 .Pp
828 The
829 .Fl v
830 option is not worth much on busy hosts.