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