xref: /netbsd-src/usr.sbin/ndp/ndp.8 (revision d90047b5d07facf36e6c01dcc0bded8997ce9cc2)
1.\"	$NetBSD: ndp.8,v 1.31 2020/06/12 21:08:02 roy Exp $
2.\"	$KAME: ndp.8,v 1.33 2005/10/19 14:57:42 suz 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 19, 2020
32.Dt NDP 8
33.Os
34.\"
35.Sh NAME
36.Nm ndp
37.Nd control/diagnose IPv6 neighbor discovery protocol
38.\"
39.Sh SYNOPSIS
40.Nm ndp
41.Op Fl nt
42.Ar hostname
43.Nm ndp
44.Op Fl nt
45.Fl a | Fl c
46.Nm ndp
47.Op Fl nt
48.Fl A Ar wait
49.Nm ndp
50.Op Fl nt
51.Fl d Ar hostname
52.Nm ndp
53.Op Fl nt
54.Fl f Ar filename
55.Nm ndp
56.Op Fl nt
57.Fl i
58.Ar interface
59.Op Ar expressions ...
60.Nm ndp
61.Op Fl nt
62.Fl s Ar nodename etheraddr
63.Op Li temp
64.Op Li proxy
65.\"
66.Sh DESCRIPTION
67The
68.Nm
69command manipulates the address mapping table
70used by the Neighbor Discovery Protocol (NDP).
71.Bl -tag -width Ds
72.It Fl A Ar wait
73Repeat
74.Fl a
75.Pq dump NDP entries
76every
77.Ar wait
78seconds.
79.It Fl a
80Dump the currently existing NDP entries.
81The following information will be printed:
82.Bl -tag -width NeighborXX
83.It Neighbor
84IPv6 address of the neighbor.
85.It Linklayer Address
86Linklayer address of the neighbor.
87It could be
88.Dq Li (incomplete)
89when the address is not available.
90.It Netif
91Network interface associated with the neighbor cache entry.
92.It Expire
93The time until expiry of the entry.
94The entry could become
95.Dq Li permanent ,
96in which case it will never expire.
97.It S
98State of the neighbor cache entry, as a single letter:
99.Pp
100.Bl -tag -width indent -compact
101.It D
102Delay
103.It I
104Incomplete
105.It N
106Nostate
107.It P
108Probe
109.It R
110Reachable
111.It S
112Stale
113.It W
114Waitdelete
115.It ?
116Unknown state (should never happen).
117.El
118.It Flags
119Flags on the neighbor cache entry, in a single letter.
120They are: Router, proxy neighbor advertisement
121.Pq Dq p .
122The field could be followed by a decimal number,
123which means the number of NS probes the node has sent during the current state.
124.El
125.It Fl c
126Erase all the NDP entries.
127.It Fl d
128Delete specified NDP entry.
129.It Fl f
130Parse the file specified by
131.Ar filename .
132.It Fl i Ar interface Op Ar expressions ...
133View ND information for the specified interface.
134If additional arguments
135.Ar expressions
136are given,
137.Nm
138sets or clears the flags or variables for the interface as specified in
139the expression.
140Each expression should be separated by white spaces or tab characters.
141Possible expressions are as follows.
142Some of the expressions can begin with the
143special character
144.Ql - ,
145which means the flag specified in the expression should be cleared.
146Note that you need
147.Fl -
148before
149.Fl foo
150in this case.
151.\"
152.Pp
153.Bl -tag -width Ds -compact
154.It Ic nud
155Turn on or off NUD (Neighbor Unreachability Detection) on the
156interface.
157NUD is usually turned on by default.
158.It Ic auto_linklocal
159Specify whether or not to perform automatic link-local address configuration on
160.Ar interface .
161This flag is set by
162.Li net.inet6.ip6.auto_linklocal
163sysctl variable.
164.It Ic prefer_source
165Prefer addresses on the
166.Ar interface
167as candidates of the source address for outgoing packets.
168The default value of this flag is off.
169For more details about the entire algorithm of source address
170selection, see the
171.Pa IMPLEMENTATION
172file supplied with the KAME kit.
173.It Ic disabled
174Disable IPv6 operation on the interface.
175When disabled, the interface discards any IPv6 packets
176received on or being sent to the interface and any IPv6 addresses
177on the interface are marked as
178.Dq tentative .
179When the disabled flag is cleared, DAD will be performed.
180In the sending case, an error of ENETDOWN will be returned to the
181application.
182This flag is typically set automatically in the kernel as a result of
183a certain failure of Duplicate Address Detection.
184While the flag can be set or cleared by hand with the
185.Nm
186command, it is not generally advisable to modify this flag manually.
187.It Ic basereachable=(number)
188Specify the BaseReachbleTimer on the interface in millisecond.
189.It Ic retrans=(number)
190Specify the RetransTimer on the interface in millisecond.
191.It Ic curhlim=(number)
192Specify the Cur Hop Limit on the interface.
193.El
194.It Fl n
195Do not try to resolve numeric addresses to hostnames.
196.It Fl s
197Register an NDP entry for a node.
198The entry will be permanent unless the word
199.Cm temp
200is given in the command.
201If the word
202.Cm proxy
203is given, this system will act as a proxy NDP server,
204responding to requests for
205.Ar hostname
206even though the host address is not its own.
207.It Fl t
208Print timestamp on each entry,
209making it possible to merge output with
210.Xr tcpdump 8 .
211Most useful when used with
212.Fl A .
213.El
214.\"
215.Sh EXIT STATUS
216The
217.Nm
218command will exit with 0 on success, and non-zero on errors.
219.\"
220.Sh SEE ALSO
221.Xr arp 8
222.\"
223.Sh HISTORY
224The
225.Nm
226command first appeared in the WIDE Hydrangea IPv6 protocol stack kit.
227.\"
228.\" .Sh BUGS
229.\" (to be written)
230