6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / ndp.1m
blob6301181f5ffb9ce575571813cdd67dde358a76bf
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 1M
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
47 The
48 .Nm
49 command displays and modifies the IPv6-to-MAC address translation
50 tables used by the Neighbor Discovery Protocol
51 .Po see Xr ndp 7P Pc .
52 .Pp
53 Given just a hostname,
54 .Nm
55 will display the current entry. Note that when getting, setting or deleting,
56 if a hostname refers to multiple IPv6 addresses, the operation will apply to
57 all of them.
58 .Pp
59 The NDP translation tables can be modified with
60 .Fl d ,
61 .Fl s ,
63 .Fl f .
64 These flags can only be used when
65 .Nm
66 is given the
67 .Sy PRIV_SYS_NET_CONFIG
68 privilege. See
69 .Xr privileges 5
70 for further information.
71 .Pp
72 Note that NDP entries for IPMP (IP Network Multipathing) data and
73 test addresses are managed by the kernel and therefore cannot be
74 modified or deleted.
75 .Sh OPTIONS
76 .Bl -tag -width 6m
77 .It Fl a
78 Display all NDP entries. Entries can be one of several types:
79 .Bl -tag -offset indent -width 7n
80 .It Sy dynamic
81 This is a normal NDP mapping and will eventually expire. This is the most
82 common type of mapping for non-local addresses that will be displayed.
83 .It Sy local
84 The IPv6 address is local to the machine.
85 .It Sy other
86 The mapping is a multicast or broadcast address, or the system is acting
87 as proxy for the address.
88 .It Sy static
89 The mapping is static and will not be removed from the machine over time.
90 .El
91 .Pp
92 Entries also exist in one of the following states:
93 .Bl -tag -offset indent -width 12m
94 .It Sy INCOMPLETE
95 Address resolution is in progress
96 .It Sy REACHABLE
97 This address has recently been reachable
98 .It Sy STALE
99 This address may be unreachable
100 .It Sy DELAY
101 Waiting to send out reachability probes
102 .It Sy PROBE
103 Sending out probes for the address
104 .It Sy UNREACHABLE
105 The address is unreachable, and will be deleted
106 .It Sy UNKNOWN
107 The state of the entry is unknown
110 Using the
111 .Fl a
112 flag is equivalent to:
114 .Dl # netstat -p -f inet6
117 .Fl n
118 is passed to
119 .Nm ,
120 then it will be passed along to
121 .Nm netstat .
122 .It Fl A
123 Display all NDP entries every
124 .Ar period
125 seconds.
126 .It Fl d
127 Delete NDP mappings for the host called
128 .Ar hostname .
129 .It Fl f
130 Read in the lines from
131 .Ar filename
132 and use each one to set a mapping. The syntax of each line is the
133 same as the arguments to
134 .Fl s .
135 Lines beginning with `#' will be ignored.
136 .It Fl i
137 By default,
139 will use the routing table to determine the appropriate interface to place the
140 mapping on. This flag allows forcing a specific interface
141 .Ar iface .
142 This argument will be ignored when using the
143 .Fl a
145 .Fl A
146 flags.
147 .It Fl n
148 Disable the default translation of numeric IP addresses to host names when
149 printing.
150 .It Fl s
151 Add or update an NDP mapping, and set the desired properties for the entry. The
152 list of flags should be the full set of flags desired on the entry, i.e., not
153 listing a flag will remove it if it already exists. The following flags can be
154 used:
155 .Bl -tag -offset indent -width Ds
156 .It Cm temp
157 The entry should be temporary and eventually expire like a normal NDP
158 entry. By default, all entries created with the
160 command are static, and will not be deleted. To make a static entry temporary,
161 it should be deleted and recreated with the
162 .Cm temp
163 flag.
164 .It Cm any
165 The address should be treated like an anycast address. This will prevent the
166 system from sending Neighbor Advertisements with the Override flag.
167 .It Cm router
168 The address should be treated like a router address. This cause the system to
169 send Neighbor Advertisements with the Router flag.
172 .Sh EXAMPLES
173 .Ss Example 1: Setting a mapping
174 To create a temporary mapping for an address:
175 .Bd -literal -offset indent
176 # ndp -s fd00::1 90:b8:d0:4b:c7:3b temp
178 .Ss Example 2: Getting a mapping
179 An entry can be fetched via its IP address:
180 .Bd -literal -offset indent
181 # ndp fd00::1
182 fd00::1 (fd00::1) at 90:b8:d0:4b:c7:3b temp
185 Or via a name that resolves to that address:
186 .Bd -literal -offset indent
187 # echo fd00::1 epicac >> /etc/hosts
188 # echo fd00::2 epicac >> /etc/hosts
189 # ndp epicac
190 fd00::1 (epicac) at 90:b8:d0:4b:c7:3b temp
191 fd00::2 (epicac) -- no entry
193 .Ss Example 3: Deleting a mapping
194 An entry can be removed with the
195 .Fl d
196 flag:
197 .Bd -literal -offset indent
198 # ndp -d fd00::1
201 Attempting to remove it again will print an error message:
202 .Bd -literal -offset indent
203 # ndp -d fd00::1
204 ndp: No entry for fd00::1
206 .Sh STABILITY
207 The command line options for this command are stable, but the output format
208 and diagnostic messages are not.
209 .Sh SEE ALSO
210 .Xr arp 1M ,
211 .Xr ifconfig 1M ,
212 .Xr netstat 1M ,
213 .Xr attributes 5 ,
214 .Xr privileges 5 ,
215 .Xr ndp 7P