]> Sergey Matveev's repositories - ndproxy.git/blob - ndproxy.4
Compatibility with FreeBSD 14
[ndproxy.git] / ndproxy.4
1 '\" te
2 .\" Copyright (c) 2015 Alexandre Fenyo <alex@fenyo.net> - http://www.fenyo.net
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $Id: ndproxy.c 173 2015-03-30 00:10:36Z fenyo $
27 .\"
28 .Dd May 27, 2017
29 .Dt NDPROXY 4
30 .Os
31 .Sh NAME
32 .Nm ndproxy
33 .Nd Neighbor Discovery Proxy
34 .Sh SYNOPSIS
35 ndproxy is a kernel module that implements IPv6 Neighbor Discovery proxying over Ethernet-like access networks, with many options to handle several use-cases.
36 .Pp
37 ndproxy replies to a neighbor solicitation with a specific neighbor advertisement, in order
38 to let the PE uplink router send further packets to a CPE downlink router, that may or may not
39 be the same node that run ndproxy.
40 .Pp
41 The hook-based
42 .Xr pfil 9
43 framework is used to let ndproxy be invoked for every IPv6 incoming packet, in order to specifically handle and filter neighbor solicitations and reply with appropriate neighbor advertisements.
44 .Pp
45 ND (Neighbor Discovery) packets are mainly targeted at solicited-node multicast addresses, but ndproxy has no information about the hosts to proxy, then it can not join the corresponding groups. Thus, the interface on which ndproxy listen to solicitations must be put into permanently promiscuous mode: add "promisc" to the
46 ifconfig_<interface> variable in
47 .Xr rc.conf 5 .
48 .Pp
49 For the same reason, MLD snooping must be disabled on the switches that share the PE/CPE interconnect (the layer-2 link the listening interface is attached to). Note that MLD snooping must not be disabled entirely on each switch, but only on the corresponding vlan.
50 .Pp
51 The interface on which ndproxy listen to solicitations only need to be assigned a link-local address. No information about the delegated prefix and no global address are needed on this interface. It is sufficient to add 
52 "inet6 -ifdisabled -accept_rtadv auto_linklocal" to the
53 ifconfig_<interface>_ipv6 variable in
54 .Xr rc.conf 5 .
55 .Sh DIFFERENCES WITH NDP
56 The target address to proxy must be given when using the
57 .Xr ndp 8
58 command-line tool with the proxy option. On the contrary, ndproxy does not rely on a list of target addresses to proxy. Thus, RFC-4941 temporary addresses can be proxyfied. For security reasons, many operating systems use a temporary address when establishing outbound connections.
59 .Pp
60 When using
61 .Xr ndp 8
62 command-line tool with the proxy option, the proxyfied packets are redirected to the node that run ndp. With ndproxy, the host that run ndp can be used only to redirect packets to another IPv6 internal router, for instance a dedicated router with hardware support of IPv6 routing process.
63 .Sh PREFIX SUBNETTING
64 Connecting a flat IPv6 network to the Internet is easily done with the RFC-4861 ND protocol. But connecting a subnetted IPv6 prefix is more complicated, depending on the ISP network design choices.
65 ndproxy can help subscribers to achieve this goal.
66 .Pp
67 Here are some protocols or mechanisms the ISP need to support, when the delegated prefix must be subnetted and assigned to multiple links within the subscriber's network.
68 For instance, the ISP could learn routes from the subscriber router using an IGP routing protocol, but the ISP and the subscriber must agree with a common routing protocol.
69 The ISP could also feed the PE with a static route to the CPE router, but the ISP must be informed about the subscriber router address.
70 Finally, the ISP could use the RFC-3633 IPv6 Prefix Options with DHCPv6 to delegate the prefix from its PE router to a requesting subscriber's router: in such a case, the ISP must support the DHCPv6 option.
71 .Pp
72 ndproxy has been written for subscribers to ISP that do not support any of those mechanisms or protocols, thus not being able to natively subnet their IPv6 delegated prefix.
73 .Sh NETWORK DESIGN
74 Here is a generic network design using ndproxy to solve such situations:
75 .ft CR
76    ______________________                 \\
77   /                      \\                 \\
78   |   ISP core network   |                  \\
79   \\__________ ___________/                   |
80              |                               | ISP network
81              | dsl to subscriber premises    |
82              |                              /
83          +---+---------------------+       /
84          |  PE or triple-play box  |      /
85          +-----------+-------------+
86                      |
87  PE/CPE interconnect | /48 prefix         \\
88          --+---------+---------+--         \\
89            |  no mld snooping  |            \\
90            |                   |             |
91       +----+--------+     +----+-----+       |
92       |     CPE     |     | ndproxy  |       |
93       | IPv6 router |     | BSD host |       |
94       +----+---+----+     +----------+       |
95   subnet1  |   |  subnet2                    | Subscriber
96  ----+-----+- -+-----+------                 | network
97      | /60           | /60                   |
98  +---+------+   +----+-----+                 |
99  |Subscriber|   |Subscriber|                /
100  |  host    |   |  host    |               /
101  +----------+   +----------+              /
102 .ft
103 .Pp
104 Note that many other use-cases can be handled with ndproxy: the BSD host and the CPE router can be the same node, the delegated-prefix length can be /64, the PE router can have several interfaces on the ISP/Subscriber layer-2 boundary, there can be multiple PE routers, etc.
105 .Sh PREFIX LENGTH
106 Even if the IESG and the IAB first recommended the allocations of /48 prefixes in the general case, for the boundary between the public and the private topology (see RFC-3177), and that some Regional Internet Registries (APNIC, ARIN and RIPE) have subsequently revised the end site assignment policy to encourage the assignment of /56 blocks to end sites, and that RFC-6177 finally recommended giving home sites significantly more than a single /64, in order for home sites to be given multiple subnets, some ISP currently only delegate /64 prefixes.
107 .Pp
108 In such a case, the subscriber should subnet a RFC-4193 Unique Local IPv6 Unicast Addresses prefix to the internal subnetworks, for internal-to-internal communications. The /64 global prefix should be routed to the only internal subnet in which RFC-4941 temporary addresses are used by hosts when establishing outbound connections. Static routes on the CPE router should be set to let hosts on other internal subnets be able to communicate with the Internet. Using temporary addresses for outbound connections to the Internet must be disabled on hosts on those other internal subnets.
109 .Sh IPv6 EXTENSION HEADERS
110 For security reasons, ndproxy explicitely rejects neighbor solicitation packets containing any extension header.
111 Such a packet is mainly unattended:
112 .Bl -hang -width 12n
113 .It Sy Fragmentation:
114 .Pp
115 According to RFC-6980, IPv6 fragmentation header is forbidden in all neighbor discovery messages.
116 .It Sy Hop-by-hop header:
117 .Pp
118 commonly used for jumbograms or for MLD. Should not involve neighbor solicitation packets.
119 .It Sy Destination mobility headers:
120 .Pp
121 commonly used for mobility, ndproxy does not support these headers.
122 .It Sy Routing header:
123 .Pp
124 commonly used for mobility or source routing, ndproxy does not support these headers.
125 .It Sy AH & ESP headers:
126 .Pp
127 securing the neighbor discovery process is not done with IPsec but with the SEcure Neighbor
128 Discovery protocol (RFC-3971). ndproxy can not support RFC-3971, since proxifying ND packets is
129 some kind of a spoofing process.
130 .El
131 .Sh EXCEPTION ADDRESSES
132 Some neigbhor solicitations sent on the PE/CPE interconnect must not be proxyfied:
133 .Bl -enum
134 .It
135 solicitations sent by other nodes than the PE;
136 .It
137 solicitations sent by the PE to reach any on-link address (the address filled in the target address option) owned by nodes attached to the PE/CPE interconnect, for instance to reach the CPE, the ndproxy host or other hosts attached to this layer-2 interconnect.
138 .El
139 .Pp
140 The target addresses filled in those solicitations that ndproxy must ignore have to be declared via sysctl (net.inet6.ndproxyconf_exception_ipv6_addresses). This list must contain the link-local and global-scoped unicast and anycast addresses of the CPE, of the ndproxy host and of any other host than the PE attached to the PE/CPE interconnect.
141 .Pp
142 Failing to maintain this list correctly could lead to badly redirect some packets to the CPE, but with a simple network design, this list can be let empty.
143 .Sh UPLINK ROUTER ADDRESSES
144 ndproxy only handles packets originating from one of the PE addresses.
145 During its address resolution process, different source addresses can be choosen by the PE, depending on the packet
146 that triggered the process or depending on other external constraints.
147 .Pp
148 Here are some cases when it can occur:
149 .Pp
150 .Bl -enum
151 .It
152 The PE may have multiple interfaces;
153 .It
154 There may be multiple PE;
155 .It
156 Many routers choose to use a link-local address when sending neighbor solicitations,
157 but when an administrator of such a router, also having a global address assigned on the same link,
158 tries to send packets (echo request, for instance) to an on-link destination global address,
159 the source address of the echo request packet prompting the solicitation may be global-scoped according
160 to the selection algorithm described in RFC-6724. Therefore, the source address of the Neighbor Solicitation
161 packet should also be selected in the same global scope, according to RFC-4861;
162 .It
163 When the uplink router does not yet know its own address, it must use the unspecified address,
164 according to RFC-4861.
165 .El
166 .Pp
167 So, it can not be assumed that an uplink router will always use the same IPv6 address to send
168 neighbor solicitations. Each assigned address that can be used as a source address by the PE on its downlink interface
169 must then be declared to ndproxy via sysctl (net.inet6.ndproxyconf_uplink_ipv6_addresses).
170 .Pp
171 ndproxy will only handle packets that come from one of these addresses.
172 .Pp
173 A special care must be taken about the unsolicited address. It may be used by the PE, then it is part of the list of PE addresses and should therefore be added to the list of PE addresses. Since this address can also be used by other nodes during some initialization steps (for instance when hot-swapping an Ethernet board), another node could use this address to send neighbor solicitations that ndproxy should not handle, because they are not sent by the PE. In fact, this is not a problem because the target address option contained in a solicitation from this other node should be in the exception list. So, adding the unsolicited address in the PE addresses list should be safe.
174 .Pp
175 Failing to maintain this list correctly could lead the PE not to be able to establish outbound connections to nodes on the PE/CPE interconnect, but if this list contains at least the PE link-local address, IPv6 connectivity should be correctly established between the Internet and the internal subscriber's subnets.
176 .Sh CONFIGURATION
177 .Pp
178 An IPv6 address can be any valid textual representation according to RFC-4291 and RFC-5952 (this means that transitional textual representation is fully supported).
179 Other representations will trigger an error event. IPv6 address lists must be formated as series of IPv6 adresses separated by semi-colons.
180 .Pp
181 The sysctl utility or
182 .Xr rc.conf 5
183 are used to set ndproxy configuration parameters.
184 .Pp
185 If you have installed ndproxy as a port or as a package, set the following variables in
186 .Xr rc.conf 5
187 and load the module at boot time by placing the following line in
188 .Xr rc.conf 5 :
189 .Bd -literal -offset indent
190 ndproxy_enable="YES"
191 .Ed
192 .Pp
193 On the contrary, if you have NOT installed ndproxy as a port or as a package but as a standalone distribution, place the sysctl entries in
194 .Xr sysctl.conf 5 and load the module at boot time by placing the following line in
195 .Xr loader.conf 5 :
196 .Bd -literal -offset indent
197 ndproxy_load="YES"
198 .Ed
199 .Pp
200 .Bl -hang -width 12n
201 .It Sy net.inet6.ndproxyconf_uplink_interface sysctl entry or ndproxy_uplink_interface rc.conf variable:
202 .Pp
203 Name of the interface talking to the broadcast multi-access network connecting the PE and CPE routers.
204 .Pp
205 Example: "vlan2".
206 .It Sy net.inet6.ndproxyconf_downlink_mac_address sysctl entry or ndproxy_downlink_mac_address rc.conf variable:
207 .Pp
208 MAC address of the CPE router. Neighbor advertisements sent by ndproxy will be filled with this address in the target link-layer address option. The format of this parameter is the hexadecimal representation made of 6 groups of 2 hexadecimal
209 numbers separated by colons.
210 .Pp
211 Example: "00:0C:29:B6:43:D5".
212 .It Sy net.inet6.ndproxyconf_exception_ipv6_addresses sysctl entry or ndproxy_exception_ipv6_addresses rc.conf variable:
213 .Pp
214 Target addresses not to proxy. In a simple network design, this list can be let empty. See section "EXCEPTION ADDRESSES".
215 .Pp
216 Example: "fe80::20d:edff:fe7b:68b7;fe80::222:15ff:fe3b:59a".
217 .It Sy net.inet6.ndproxyconf_uplink_ipv6_addresses sysctl entry or ndproxy_uplink_ipv6_addresses rc.conf variable:
218 .Pp
219 Addresses of the PE. This list should at least contain the PE link-local address. See section "UPLINK ROUTER ADDRESSES".
220 .Pp
221 Example: "fe80::207:cbff:fe4b:2d20;2a01:e35:8aae:bc60::1;::".
222 .Pp
223 .It Sy net.inet6.ndproxycount sysctl entry:
224 .Pp
225 Number of advertisements sent.
226 .El
227 .Sh SEE ALSO
228 .Xr inet6 4 ,
229 .Xr rc.conf 5 ,
230 .Xr loader.conf 5 ,
231 .Xr sysctl.conf 5 ,
232 .Xr sysctl 8 ,
233 .Xr loader 8 ,
234 .Xr pfil 9
235 .Sh AUTHOR
236 Alexandre Fenyo <alex@fenyo.net> - www.fenyo.net