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