xref: /illumos-gate/usr/src/man/man8/ndp.8 (revision 06ca4e396ecc93ed45a333664a51558b7e84e8f5)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2015, Joyent, Inc.  All rights reserved.
13.\"
14.Dd Sep 02, 2015
15.Dt NDP 8
16.Os
17.Sh NAME
18.Nm ndp
19.Nd manipulate IPv6 Neighbor Discovery Protocol mappings
20.Sh SYNOPSIS
21.Nm
22.Op Fl n
23.Fl a
24.Nm
25.Op Fl n
26.Fl A Ar period
27.Nm
28.Op Fl n
29.Op Fl i Ar iface
30.Ar hostname
31.Nm
32.Op Fl n
33.Op Fl i Ar iface
34.Fl d Ar hostname
35.Nm
36.Op Fl n
37.Op Fl i Ar iface
38.Fl f Ar filename
39.Nm
40.Op Fl n
41.Op Fl i Ar iface
42.Fl s Ar hostname lladdr
43.Op Cm temp
44.Op Cm any
45.Op Cm router
46.Sh DESCRIPTION
47The
48.Nm
49command displays and modifies the IPv6-to-MAC address translation
50tables used by the Neighbor Discovery Protocol
51.Po see Xr ndp 4P Pc .
52.Pp
53Given just a hostname,
54.Nm
55will display the current entry.
56Note that when getting, setting or deleting, if a hostname refers to multiple
57IPv6 addresses, the operation will apply to all of them.
58.Pp
59The NDP translation tables can be modified with
60.Fl d ,
61.Fl s ,
62or
63.Fl f .
64These flags can only be used when
65.Nm
66is given the
67.Sy PRIV_SYS_NET_CONFIG
68privilege.
69See
70.Xr privileges 7
71for further information.
72.Pp
73Note that NDP entries for IPMP (IP Network Multipathing) data and
74test addresses are managed by the kernel and therefore cannot be
75modified or deleted.
76.Sh OPTIONS
77.Bl -tag -width 6m
78.It Fl a
79Display all NDP entries.
80Entries can be one of several types:
81.Bl -tag -offset indent -width 7n
82.It Sy dynamic
83This is a normal NDP mapping and will eventually expire.
84This is the most common type of mapping for non-local addresses that will be
85displayed.
86.It Sy local
87The IPv6 address is local to the machine.
88.It Sy other
89The mapping is a multicast or broadcast address, or the system is acting
90as proxy for the address.
91.It Sy static
92The mapping is static and will not be removed from the machine over time.
93.El
94.Pp
95Entries also exist in one of the following states:
96.Bl -tag -offset indent -width 12m
97.It Sy INCOMPLETE
98Address resolution is in progress
99.It Sy REACHABLE
100This address has recently been reachable
101.It Sy STALE
102This address may be unreachable
103.It Sy DELAY
104Waiting to send out reachability probes
105.It Sy PROBE
106Sending out probes for the address
107.It Sy UNREACHABLE
108The address is unreachable, and will be deleted
109.It Sy UNKNOWN
110The state of the entry is unknown
111.El
112.Pp
113Using the
114.Fl a
115flag is equivalent to:
116.sp
117.Dl # netstat -p -f inet6
118.sp
119If
120.Fl n
121is passed to
122.Nm ,
123then it will be passed along to
124.Nm netstat .
125.It Fl A
126Display all NDP entries every
127.Ar period
128seconds.
129.It Fl d
130Delete NDP mappings for the host called
131.Ar hostname .
132.It Fl f
133Read in the lines from
134.Ar filename
135and use each one to set a mapping.
136The syntax of each line is the same as the arguments to
137.Fl s .
138Lines beginning with `#' will be ignored.
139.It Fl i
140By default,
141.Nm
142will use the routing table to determine the appropriate interface to place the
143mapping on.
144This flag allows forcing a specific interface
145.Ar iface .
146This argument will be ignored when using the
147.Fl a
148or
149.Fl A
150flags.
151.It Fl n
152Disable the default translation of numeric IP addresses to host names when
153printing.
154.It Fl s
155Add or update an NDP mapping, and set the desired properties for the entry.
156The list of flags should be the full set of flags desired on the entry, i.e.,
157not listing a flag will remove it if it already exists.
158The following flags can be used:
159.Bl -tag -offset indent -width Ds
160.It Cm temp
161The entry should be temporary and eventually expire like a normal NDP
162entry.
163By default, all entries created with the
164.Nm
165command are static, and will not be deleted.
166To make a static entry temporary, it should be deleted and recreated with the
167.Cm temp
168flag.
169.It Cm any
170The address should be treated like an anycast address.
171This will prevent the system from sending Neighbor Advertisements with the
172Override flag.
173.It Cm router
174The address should be treated like a router address.
175This cause the system to send Neighbor Advertisements with the Router flag.
176.El
177.El
178.Sh EXAMPLES
179.Ss Example 1: Setting a mapping
180To create a temporary mapping for an address:
181.Bd -literal -offset indent
182# ndp -s fd00::1 90:b8:d0:4b:c7:3b temp
183.Ed
184.Ss Example 2: Getting a mapping
185An entry can be fetched via its IP address:
186.Bd -literal -offset indent
187# ndp fd00::1
188fd00::1 (fd00::1) at 90:b8:d0:4b:c7:3b temp
189.Ed
190.sp
191Or via a name that resolves to that address:
192.Bd -literal -offset indent
193# echo fd00::1 epicac >> /etc/hosts
194# echo fd00::2 epicac >> /etc/hosts
195# ndp epicac
196fd00::1 (epicac) at 90:b8:d0:4b:c7:3b temp
197fd00::2 (epicac) -- no entry
198.Ed
199.Ss Example 3: Deleting a mapping
200An entry can be removed with the
201.Fl d
202flag:
203.Bd -literal -offset indent
204# ndp -d fd00::1
205.Ed
206.sp
207Attempting to remove it again will print an error message:
208.Bd -literal -offset indent
209# ndp -d fd00::1
210ndp: No entry for fd00::1
211.Ed
212.Sh STABILITY
213The command line options for this command are stable, but the output format
214and diagnostic messages are not.
215.Sh SEE ALSO
216.Xr ndp 4P ,
217.Xr attributes 7 ,
218.Xr privileges 7 ,
219.Xr arp 8 ,
220.Xr ifconfig 8 ,
221.Xr netstat 8
222