xref: /freebsd/usr.sbin/ndp/ndp.8 (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
1.\"	$KAME: ndp.8,v 1.28 2002/07/17 08:46:33 itojun 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.Dd May 9, 2014
31.Dt NDP 8
32.Os
33.\"
34.Sh NAME
35.Nm ndp
36.Nd control/diagnose IPv6 neighbor discovery protocol
37.\"
38.Sh SYNOPSIS
39.Nm
40.Op Fl nt
41.Ar hostname
42.Nm
43.Op Fl nt
44.Fl a | c | p
45.Nm
46.Op Fl nt
47.Fl r
48.Nm
49.Op Fl nt
50.Fl H | P | R
51.Nm
52.Op Fl nt
53.Fl A Ar wait
54.Nm
55.Op Fl nt
56.Fl d Ar hostname
57.Nm
58.Op Fl nt
59.Fl f Ar filename
60.Nm
61.Op Fl nt
62.Fl i
63.Ar interface
64.Op Ar expressions ...
65.Nm
66.Op Fl nt
67.Fl I Op Ar interface | Li delete
68.Nm
69.Op Fl nt
70.Fl s Ar nodename etheraddr
71.Op Li temp
72.Op Li proxy
73.\"
74.Sh DESCRIPTION
75The
76.Nm
77utility manipulates the address mapping table
78used by the Neighbor Discovery Protocol (NDP).
79.Bl -tag -width indent
80.It Fl a
81Dump the currently existing NDP entries.
82The following information will be printed:
83.Bl -tag -width "Neighbor"
84.It Neighbor
85IPv6 address of the neighbor.
86.It Linklayer Address
87Linklayer address of the neighbor.
88It could be
89.Dq Li (incomplete)
90when the address is not available.
91.It Netif
92Network interface associated with the neighbor cache entry.
93.It Expire
94The time until expiry of the entry.
95The entry could become
96.Dq Li permanent ,
97in which case it will never expire.
98.It S
99State of the neighbor cache entry, as a single letter:
100.Pp
101.Bl -tag -width indent -compact
102.It N
103Nostate
104.It W
105Waitdelete
106.It I
107Incomplete
108.It R
109Reachable
110.It S
111Stale
112.It D
113Delay
114.It P
115Probe
116.It ?\&
117Unknown state (should never happen).
118.El
119.It Flags
120Flags on the neighbor cache entry, in a single letter.
121They are: Router, proxy neighbor advertisement
122.Pq Dq p .
123The field could be followed by a decimal number,
124which means the number of NS probes the node has sent during the current state.
125.El
126.It Fl A Ar wait
127Repeat
128.Fl a
129(dump NDP entries)
130every
131.Ar wait
132seconds.
133.It Fl c
134Erase all the NDP entries.
135.It Fl d
136Delete specified NDP entry.
137.It Fl f Ar filename
138Cause the file
139.Ar filename
140to be read and multiple entries to be set in the
141.Tn NDP
142table.
143Entries
144in the file should be of the form
145.Pp
146.Bd -ragged -offset indent -compact
147.Ar hostname ether_addr
148.Op Cm temp
149.Op Cm proxy
150.Ed
151.Pp
152with argument meanings as given above.
153Leading whitespace and empty lines are ignored.
154A
155.Ql #
156character will mark the rest of the line as a comment.
157.It Fl H
158Harmonize consistency between the routing table and the default router
159list; install the top entry of the list into the kernel routing table.
160.It Fl I
161Shows the default interface used as the default route when
162there is no default router.
163.It Fl I Ar interface
164Specifies the default interface used as the default route when
165there is no default router.
166The
167.Ar interface
168will be used as the default.
169.It Fl I Li delete
170The current default interface will be deleted from the kernel.
171.It Fl i Ar interface Op Ar expressions ...
172View ND information for the specified interface.
173If additional arguments
174.Ar expressions
175are given,
176.Nm
177sets or clears the flags or variables for the interface as specified in
178the expression.
179Each expression should be separated by white spaces or tab characters.
180Possible expressions are as follows.
181Some of the expressions can begin with the
182special character
183.Ql - ,
184which means the flag specified in the expression should be cleared.
185Note that you need
186.Fl -
187before
188.Fl foo
189in this case.
190.\"
191.Bl -tag -width indent
192.It Ic nud
193Turn on or off NUD (Neighbor Unreachability Detection) on the
194interface.
195NUD is usually turned on by default.
196.It Ic accept_rtadv
197Specify whether or not to accept Router Advertisement messages
198received on the
199.Ar interface .
200This flag is set by
201.Va net.inet6.ip6.accept_rtadv
202sysctl variable.
203.It Ic auto_linklocal
204Specify whether or not to perform automatic link-local address configuration
205on
206.Ar interface .
207This flag is set by
208.Va net.inet6.ip6.auto_linklocal
209sysctl variable.
210.It Ic no_prefer_iface
211The address on the outgoing interface is preferred by source addess
212selection rule.
213If this flag is set, stop treating the address on the
214.Ar interface
215as special even when the
216.Ar interface
217is outgoing interface.
218The default value of this flag is off.
219.It Ic disabled
220Disable IPv6 operation on the interface.
221When disabled, the interface discards any IPv6 packets
222received on or being sent to the interface.
223In the sending case, an error of ENETDOWN will be returned to the
224application.
225This flag is typically set automatically in the kernel as a result of
226a certain failure of Duplicate Address Detection.
227If the auto_linklocal per-interface flag is set, automatic link-local
228address configuration is performed again when this flag is cleared.
229.It Ic basereachable Ns Li = Ns Pq Ar number
230Specify the BaseReachbleTimer on the interface in millisecond.
231.It Ic retrans Ns Li = Ns Pq Ar number
232Specify the RetransTimer on the interface in millisecond.
233.It Ic curhlim Ns Li = Ns Pq Ar number
234Specify the Cur Hop Limit on the interface.
235.El
236.It Fl n
237Do not try to resolve numeric addresses to hostnames.
238.It Fl p
239Show prefix list.
240The following information will be printed:
241.Bl -tag -width indent
242.It Cm if
243The network interface associated with this prefix.
244.It Cm flags
245The status of the prefix, expressed by a combination of the following
246letters:
247.Pp
248.Bl -tag -width indent -compact
249.It Cm A
250This prefix can be used for stateless address autoconfiguration.
251.It Cm L, Cm O
252This prefix can be used for on-link determination; that is, it can be
253used to determine whether a given destination address is on-link.
254.It Cm D
255There are no reachable routers advertising this prefix.
256.El
257.It Cm vltime
258Valid lifetime; the length of time for which the prefix and a stateless
259autoconfigured address generated from this prefix can be used for the
260source or destination address of a packet.
261.It Cm pltime
262Preferred lifetime; the length of time for which the prefix and a stateless
263autoconfigured address generated from this prefix can be used by upper-layer
264protocols unrestrictedly.
265.It Cm expire
266This is the remaining time that the prefix is in the valid state.
267.It Cm ref
268The number of kernel references held for this prefix.
269.El
270.It Fl P
271Flush all the entries in the prefix list.
272.It Fl r
273Show default router list.
274.It Fl R
275Flush all the entries in the default router list.
276.It Fl s
277Register an NDP entry for a node.
278The entry will be permanent unless the word
279.Li temp
280is given in the command.
281If the word
282.Li proxy
283is given, this system will act as a proxy NDP server,
284responding to requests for
285.Ar hostname
286even though the host address is not its own.
287.It Fl t
288Print timestamp for each entry,
289to make it possible to merge the output with
290.Xr tcpdump 1 .
291Most useful when used with
292.Fl A .
293.El
294.\"
295.Sh EXIT STATUS
296.Ex -std
297.\"
298.Sh SEE ALSO
299.Xr arp 8
300.\"
301.Sh HISTORY
302The
303.Nm
304utility first appeared in the WIDE Hydrangea IPv6 protocol stack kit.
305The
306.Fl I Ar auto_linklocal
307flag first appeared in
308.Fx 8.0 .
309.\"
310.\" .Sh BUGS
311.\" (to be written)
312