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