Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / share / man / man8 / ipaddrsel.8
blobd6255174ecbe0e0c51254658b6a4251174723e20
1 '\" te
2 .\" Copyright (C) 2006, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright (C) 2017, Sebastian Wiedenroth
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH IPADDRSEL 8 "Nov 4, 2017"
8 .SH NAME
9 ipaddrsel \- configure IPv6 default address selection
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fB/usr/sbin/ipaddrsel\fR
14 .fi
16 .LP
17 .nf
18 \fB/usr/sbin/ipaddrsel\fR \fB-f\fR \fIfile\fR
19 .fi
21 .LP
22 .nf
23 \fB/usr/sbin/ipaddrsel\fR \fB-d\fR
24 .fi
26 .SH DESCRIPTION
27 .LP
28 Use the \fBipaddrsel\fR utility to configure the IPv6 default address selection
29 policy table. The policy table is a longest-matching-prefix lookup table that
30 is used for IPv6 source address selection and for destination address ordering
31 when resolving names to \fBAF_INET6\fR addresses. For a description of how the
32 policy table is used for source address selection, see \fBinet6\fR(7P). For a
33 description of how the policy table is used for destination address ordering,
34 see \fBgetaddrinfo\fR(3SOCKET).
35 .sp
36 .LP
37 The unmodified policy table is valid for all typical IPv6 deployments. Modify
38 the table only if a circumstance exists for which the default behavior of the
39 IPv6 source address selection or destination address ordering mechanism is
40 unsatisfactory. See the  section for examples of such circumstances. You should
41 carefully consider your addressing strategy before you change the table from
42 the provided default.
43 .sp
44 .LP
45 When the \fBipaddrsel\fR command is issued without any arguments, the address
46 selection policy currently in use is printed. The format of the output is
47 compatible with the format of the configuration file that the \fB-f\fR option
48 accepts.
49 .LP
50 Note -
51 .sp
52 .RS 2
53 If the \fBusesrc\fR subcommand to \fBifconfig\fR(8) is applied to a particular
54 physical interface, the selection policy specified by \fBusesrc\fR overrides
55 the source address selection policies specified by \fBipaddrsel\fR. This is
56 true for packets that are locally generated and for applications that do not
57 choose a non-zero source address using \fBbind\fR(3SOCKET).
58 .RE
59 .SS "The Configuration File"
60 .LP
61 The configuration file that the \fB-f\fR option accepts can contain either
62 comment lines or policy entries. Comment lines have a '\fB#\fR' character as
63 the first non-blank character. and they are ignored by the \fBipaddrsel\fR
64 utility. Policy entry lines have the following format:
65 .sp
66 .in +2
67 .nf
68 \fIprefix\fR/\fIprefix_length\fR \fIprecedence\fR \fIlabel\fR [# \fIcomment\fR]
69 .fi
70 .in -2
72 .sp
73 .LP
74 The \fIprefix\fR must be an IPv6 prefix in a format consistent with
75 \fBinet\fR(3SOCKET). The \fIprefix_length\fR is an integer ranging from 0 to
76 128. The IPv6 source address selection and destination address ordering
77 algorithms determine the precedence or label of an address by doing a
78 longest-prefix-match lookup using the prefixes in this table, much like
79 next-hop determination for a destination is done by doing a
80 longest-prefix-match lookup using an IP routing table.
81 .sp
82 .LP
83 The precedence is a non-negative integer that represents how the destination
84 address ordering mechanism will sort addresses returned from name lookups. In
85 general, addresses with a higher precedence will be in front of addresses with
86 a lower precedence. Other factors, such as destinations with undesirable source
87 addresses can, however, override these precedence values.
88 .sp
89 .LP
90 The label is a string of at most fifteen characters, not including the
91 \fINULL\fR terminator. The label allows particular source address prefixes to
92 be used with destination prefixes of the same label. Specifically, for a
93 particular destination address, the IPv6 source address selection algorithm
94 prefers source addresses whose label is equal that of the destination.
95 .sp
96 .LP
97 The label may be followed by an optional comment.
98 .sp
99 .LP
100 The file must contain a default policy entry, which is an entry with
101 \fB::0/0\fR as its \fIprefix\fR and \fIprefix_length\fR. This is to ensure that
102 all possible addresses match a policy.
103 .SH OPTIONS
105 The \fBippadrsel\fR utility supports the following options:
107 .ne 2
109 \fB\fB-f\fR \fIfile\fR\fR
111 .RS 11n
112 Replace the address selection policy table with the policy specified in the
113 \fIfile\fR.
117 .ne 2
119 \fB\fB-d\fR\fR
121 .RS 11n
122 Revert the kernel's address selection policy table back to the default table.
123 Invoking \fBipaddrsel\fR in this way only changes the currently running
124 kernel's policy table, and does not alter the configuration file
125 \fB/etc/inet/ipaddrsel.conf\fR. To revert the configuration file back to its
126 default settings, use \fBipaddrsel\fR \fB-d\fR, then dump the contents of the
127 table to the configuration file by redirecting the output of \fBipaddrsel\fR to
128 \fB/etc/inet/ipaddrsel.conf\fR.
130 .in +2
132 example# \fBipaddrsel -d\fR
133 example# \fBipaddrsel > /etc/inet/ipaddrsel.conf\fR
135 .in -2
140 .SH EXAMPLES
142 \fBExample 1 \fRThe Default Policy in \fB/etc/inet/ipaddrsel.conf\fR
145 The following example is the default policy that is located in
146 \fB/etc/inet/ipaddrsel.conf\fR:
149 .in +2
151 # Prefix                            Precedence Label
152 ::1/128                                     50 Loopback
153 ::/0                                        40 Default
154 ::ffff:0.0.0.0/96                           35 IPv4
155 2002::/16                                   30 6to4
156 2001::/32                                    5 Teredo
157 fc00::/7                                     3 ULA
158 ::/96                                        1 IPv4_Compatible
159 fec0::/10                                    1 Site_Local
160 3ffe::/16                                    1 6bone
162 .in -2
166 \fBExample 2 \fRAssigning a Lower Precedence to Link-local and Site-local
167 Addresses
170 By default, the destination address ordering rules sort addresses of smaller
171 scope before those of larger scope. For example, if a name resolves to a global
172 and a site-local address, the site local address would be ordered before the
173 global address. An administrator can override this ordering rule by assigning a
174 lower precedence to addresses of smaller scope, as the following table
175 demonstrates.
178 .in +2
180 # Prefix                            Precedence Label
181 ::1/128                                     50 Loopback
182 ::/0                                        40 Default
183 2002::/16                                   30 6to4
184 fec0::/10                                   27 Site-Local
185 fe80::/10                                   23 Link-Local
186 ::/96                                       20 IPv4_Compatible
187 ::ffff:0.0.0.0/96                           10 IPv4
189 .in -2
193 \fBExample 3 \fRAssigning Higher Precedence to IPv4 Destinations
196 By default, IPv6 addresses are ordered in front of IPv4 addresses in name
197 lookups. \fB::ffff:0.0.0.0/96\fR has the precedence of 35 in the default table.
198 In the following example, IPv4 addresses are assigned higher precedence and are
199 ordered in front of IPv6 destinations:
202 .in +2
204 # Prefix                            Precedence Label
205 ::1/128                                     50 Loopback
206 ::/0                                        40 Default
207 ::ffff:0.0.0.0/96                           60 IPv4
208 2002::/16                                   30 6to4
209 2001::/32                                    5 Teredo
210 fc00::/7                                     3 ULA
211 ::/96                                        1 IPv4_Compatible
212 fec0::/10                                    1 Site_Local
213 3ffe::/16                                    1 6bone
215 .in -2
219 \fBExample 4 \fREnsuring that a Particular Source Address is Used
222 This example ensures that a particular source address is used only when
223 communicating with destinations in a particular network.
227 The following policy table assigns the label "ClientNet" to a particular source
228 address on the local system, \fB2001:1111:1111::1\fR. The table assigns the same
229 label to a network, \fB2001:2222:2222::/48\fR. The result of this policy is that
230 the \fB2001:1111:1111::1\fR source address will only be used when communicating
231 with destinations contained in the \fB2001:2222:2222::/48\fR network. For this
232 example, this network is the \fBClientNet\fR, which could represent a
233 particular client's network.
236 .in +2
238 # Prefix                            Precedence Label
239 ::1/128                                     50 Loopback
240 2001:1111:1111::1/128                       40 ClientNet
241 2001:2222:2222::/48                         40 ClientNet
242 ::/0                                        40 Default
243 2002::/16                                   30 6to4
244 ::/96                                       20 IPv4_Compatible
245 ::ffff:0.0.0.0/96                           10 IPv4
247 .in -2
252 This example assumes that the local system has one physical interface, and that
253 all global prefixes are assigned to that physical interface.
255 .SH EXIT STATUS
257 \fBipaddrsel\fR returns the following exit values:
259 .ne 2
261 \fB\fB0\fR\fR
263 .RS 6n
264 \fBipaddrsel\fR successfully completed.
268 .ne 2
270 \fB>\fB0\fR\fR
272 .RS 6n
273 An error occurred. If a failure is encountered, the kernel's current policy
274 table is unchanged.
277 .SH FILES
278 .ne 2
280 \fB\fB/etc/inet/ipaddrsel.conf\fR\fR
282 .RS 28n
283 The file that contains the IPv6 default address selection policy to be
284 installed at boot time. This file is loaded before any Internet services are
285 started.
288 .SH ATTRIBUTES
290 See \fBattributes\fR(5) for descriptions of the following attributes:
295 box;
296 c | c
297 l | l .
298 ATTRIBUTE TYPE  ATTRIBUTE VALUE
300 Interface Stability     Evolving
303 .SH SEE ALSO
305 \fBnscd\fR(8), \fBinet\fR(3SOCKET), \fBgetaddrinfo\fR(3SOCKET),
306 \fBipaddrsel.conf\fR(4), \fBattributes\fR(5), \fBinet6\fR(7P)
307 .SH NOTES
309 The ipnodes cache kept by \fBnscd\fR(8) contains addresses that are ordered
310 using the destination address ordering algorithm, which is one of the reasons
311 why \fBipaddrsel\fR is called before \fBnscd\fR in the boot sequence. If
312 \fBipaddrsel\fR is used to change the address selection policy after \fBnscd\fR
313 has started, you should invalidate the \fBnscd\fR ipnodes cache by invoking the
314 following command:
316 .in +2
318 example# \fB/usr/sbin/nscd -i ipnodes\fR
320 .in -2