xref: /freebsd-src/usr.sbin/ip6addrctl/ip6addrctl.8 (revision 6dcdd79a251b5e62ff9ce562ad451e92dec39408)
1.\"	$KAME: ip6addrctl.8,v 1.3 2003/03/22 05:56:41 jinmei Exp $
2.\"
3.\" Copyright (C) 2001 WIDE Project.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the project nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.Dd January 29, 2025
31.Dt IP6ADDRCTL 8
32.Os
33.\"
34.Sh NAME
35.Nm ip6addrctl
36.Nd configure address selection policy for IPv6 and IPv4
37.\"
38.Sh SYNOPSIS
39.Nm
40.Op Fl j Ar jail
41.Op Cm show
42.Nm
43.Op Fl j Ar jail
44.Cm add
45.Ar prefix precedence label
46.Nm
47.Op Fl j Ar jail
48.Cm delete
49.Ar prefix
50.Nm
51.Op Fl j Ar jail
52.Cm flush
53.Nm
54.Op Fl j Ar jail
55.Cm install
56.Ar configfile
57.\"
58.Sh DESCRIPTION
59The
60.Nm
61utility manages the policy table of source and destination address
62selection for outgoing IPv4 and IPv6 packets.
63When
64.Nm
65is invoked without an argument or with a single argument
66.Cm show ,
67it prints the content of the policy table currently installed in the
68kernel.
69.Pp
70To operate inside a jail, the option
71.Op Fl j Ar jail
72should precede other options.
73.Pp
74To modify the table, the following operations are available:
75.Bl -tag -width indent
76.It Cm add Ar prefix precedence label
77Add a policy entry.
78The
79.Ar prefix
80argument
81is an IPv6 prefix, which is a key for the entry.
82An IPv4 prefix should be specified with an IPv6 prefix using an
83IPv4-mapped IPv6 address.
84The
85.Ar precedence
86and
87.Ar label
88arguments
89are decimal numbers, which specify the precedence and label values
90for the entry, respectively.
91This operation should be performed without an existing entry for the
92prefix.
93.It Cm delete Ar prefix
94Delete a policy entry specified by
95.Ar prefix ,
96which should be an IPv6 prefix.
97A corresponding entry for the prefix should have already been
98installed.
99.It Cm flush
100Delete all existing policy entries in the kernel.
101.It Cm install Ar configfile
102Install policy entries from a configuration file named
103.Ar configfile .
104The configuration file should contain a set of policy entries.
105Each entry is specified in a single line which contains an IPv6 prefix,
106a decimal precedence value, and a decimal label value, separated with
107white space or tab characters.
108In the configuration file, lines beginning with the pound-sign
109.Pq Ql #
110are
111comments and are ignored.
112Note that the configuration file will be processed before attaching to a jail.
113.El
114.\"
115.Sh EXIT STATUS
116.Ex -std
117.\"
118.Sh SEE ALSO
119.Xr getaddrinfo 1 ,
120.Xr getaddrinfo 3
121.Rs
122.%A "Dave Thaler"
123.%A "Richard Draves"
124.%A "Arifumi Matsumoto"
125.%A "Tim Chown"
126.%T "Default Address Selection for Internet Protocol Version 6 (IPv6)"
127.%R RFC 6724
128.Re
129.\"
130.Sh HISTORY
131The
132.Nm
133utility first appeared in the KAME IPv6 protocol stack kit.
134The original command name was
135.Nm addrselect ,
136but it was then renamed to the current one so that the name would
137describe its function well.
138.\" .Sh BUGS
139.\" (to be written)
140