1*5c2921b0SApple OSS Distributions.\" $FreeBSD: src/share/man/man4/inet6.4,v 1.4.2.8 2001/12/17 11:30:12 ru Exp $ 2*5c2921b0SApple OSS Distributions.\" $KAME: inet6.4,v 1.21 2001/04/05 01:00:18 itojun Exp $ 3*5c2921b0SApple OSS Distributions.\" 4*5c2921b0SApple OSS Distributions.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5*5c2921b0SApple OSS Distributions.\" All rights reserved. 6*5c2921b0SApple OSS Distributions.\" 7*5c2921b0SApple OSS Distributions.\" Redistribution and use in source and binary forms, with or without 8*5c2921b0SApple OSS Distributions.\" modification, are permitted provided that the following conditions 9*5c2921b0SApple OSS Distributions.\" are met: 10*5c2921b0SApple OSS Distributions.\" 1. Redistributions of source code must retain the above copyright 11*5c2921b0SApple OSS Distributions.\" notice, this list of conditions and the following disclaimer. 12*5c2921b0SApple OSS Distributions.\" 2. Redistributions in binary form must reproduce the above copyright 13*5c2921b0SApple OSS Distributions.\" notice, this list of conditions and the following disclaimer in the 14*5c2921b0SApple OSS Distributions.\" documentation and/or other materials provided with the distribution. 15*5c2921b0SApple OSS Distributions.\" 3. Neither the name of the project nor the names of its contributors 16*5c2921b0SApple OSS Distributions.\" may be used to endorse or promote products derived from this software 17*5c2921b0SApple OSS Distributions.\" without specific prior written permission. 18*5c2921b0SApple OSS Distributions.\" 19*5c2921b0SApple OSS Distributions.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 20*5c2921b0SApple OSS Distributions.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21*5c2921b0SApple OSS Distributions.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22*5c2921b0SApple OSS Distributions.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 23*5c2921b0SApple OSS Distributions.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24*5c2921b0SApple OSS Distributions.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25*5c2921b0SApple OSS Distributions.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26*5c2921b0SApple OSS Distributions.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27*5c2921b0SApple OSS Distributions.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28*5c2921b0SApple OSS Distributions.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29*5c2921b0SApple OSS Distributions.\" SUCH DAMAGE. 30*5c2921b0SApple OSS Distributions.\" 31*5c2921b0SApple OSS Distributions.Dd January 29, 1999 32*5c2921b0SApple OSS Distributions.Dt INET6 4 33*5c2921b0SApple OSS Distributions.Os 34*5c2921b0SApple OSS Distributions.Sh NAME 35*5c2921b0SApple OSS Distributions.Nm inet6 36*5c2921b0SApple OSS Distributions.Nd Internet protocol version 6 family 37*5c2921b0SApple OSS Distributions.Sh SYNOPSIS 38*5c2921b0SApple OSS Distributions.In sys/types.h 39*5c2921b0SApple OSS Distributions.In netinet/in.h 40*5c2921b0SApple OSS Distributions.Sh DESCRIPTION 41*5c2921b0SApple OSS DistributionsThe 42*5c2921b0SApple OSS Distributions.Nm 43*5c2921b0SApple OSS Distributionsfamily is an updated version of 44*5c2921b0SApple OSS Distributions.Xr inet 4 45*5c2921b0SApple OSS Distributionsfamily. 46*5c2921b0SApple OSS DistributionsWhile 47*5c2921b0SApple OSS Distributions.Xr inet 4 48*5c2921b0SApple OSS Distributionsimplements Internet Protocol version 4, 49*5c2921b0SApple OSS Distributions.Nm 50*5c2921b0SApple OSS Distributionsimplements Internet Protocol version 6. 51*5c2921b0SApple OSS Distributions.Pp 52*5c2921b0SApple OSS Distributions.Nm 53*5c2921b0SApple OSS Distributionsis a collection of protocols layered atop the 54*5c2921b0SApple OSS Distributions.Em Internet Protocol version 6 55*5c2921b0SApple OSS Distributions.Pq Tn IPv6 56*5c2921b0SApple OSS Distributionstransport layer, and utilizing the IPv6 address format. 57*5c2921b0SApple OSS DistributionsThe 58*5c2921b0SApple OSS Distributions.Nm 59*5c2921b0SApple OSS Distributionsfamily provides protocol support for the 60*5c2921b0SApple OSS Distributions.Dv SOCK_STREAM , SOCK_DGRAM , 61*5c2921b0SApple OSS Distributionsand 62*5c2921b0SApple OSS Distributions.Dv SOCK_RAW 63*5c2921b0SApple OSS Distributionssocket types; the 64*5c2921b0SApple OSS Distributions.Dv SOCK_RAW 65*5c2921b0SApple OSS Distributionsinterface provides access to the 66*5c2921b0SApple OSS Distributions.Tn IPv6 67*5c2921b0SApple OSS Distributionsprotocol. 68*5c2921b0SApple OSS Distributions.Sh ADDRESSING 69*5c2921b0SApple OSS DistributionsIPv6 addresses are 16 byte quantities, stored in network standard byteorder. 70*5c2921b0SApple OSS DistributionsThe include file 71*5c2921b0SApple OSS Distributions.Aq Pa netinet/in.h 72*5c2921b0SApple OSS Distributionsdefines this address 73*5c2921b0SApple OSS Distributionsas a discriminated union. 74*5c2921b0SApple OSS Distributions.Pp 75*5c2921b0SApple OSS DistributionsSockets bound to the 76*5c2921b0SApple OSS Distributions.Nm 77*5c2921b0SApple OSS Distributionsfamily utilize the following addressing structure: 78*5c2921b0SApple OSS Distributions.Bd -literal -offset indent 79*5c2921b0SApple OSS Distributionsstruct sockaddr_in6 { 80*5c2921b0SApple OSS Distributions u_int8_t sin6_len; 81*5c2921b0SApple OSS Distributions u_int8_t sin6_family; 82*5c2921b0SApple OSS Distributions u_int16_t sin6_port; 83*5c2921b0SApple OSS Distributions u_int32_t sin6_flowinfo; 84*5c2921b0SApple OSS Distributions struct in6_addr sin6_addr; 85*5c2921b0SApple OSS Distributions u_int32_t sin6_scope_id; 86*5c2921b0SApple OSS Distributions}; 87*5c2921b0SApple OSS Distributions.Ed 88*5c2921b0SApple OSS Distributions.Pp 89*5c2921b0SApple OSS DistributionsSockets may be created with the local address 90*5c2921b0SApple OSS Distributions.Dq Dv :: 91*5c2921b0SApple OSS Distributions(which is equal to IPv6 address 92*5c2921b0SApple OSS Distributions.Dv 0:0:0:0:0:0:0:0 ) 93*5c2921b0SApple OSS Distributionsto affect 94*5c2921b0SApple OSS Distributions.Dq wildcard 95*5c2921b0SApple OSS Distributionsmatching on incoming messages. 96*5c2921b0SApple OSS Distributions.Pp 97*5c2921b0SApple OSS DistributionsThe IPv6 specification defines scoped addresses, 98*5c2921b0SApple OSS Distributionslike link-local or site-local addresses. 99*5c2921b0SApple OSS DistributionsA scoped address is ambiguous to the kernel, 100*5c2921b0SApple OSS Distributionsif it is specified without a scope identifier. 101*5c2921b0SApple OSS DistributionsTo manipulate scoped addresses properly from the userland, 102*5c2921b0SApple OSS Distributionsprograms must use the advanced API defined in RFC2292. 103*5c2921b0SApple OSS DistributionsA compact description of the advanced API is available in 104*5c2921b0SApple OSS Distributions.Xr ip6 4 . 105*5c2921b0SApple OSS DistributionsIf a scoped address is specified without an explicit scope, 106*5c2921b0SApple OSS Distributionsthe kernel may raise an error. 107*5c2921b0SApple OSS DistributionsNote that scoped addresses are not for daily use at this moment, 108*5c2921b0SApple OSS Distributionsboth from a specification and an implementation point of view. 109*5c2921b0SApple OSS Distributions.Pp 110*5c2921b0SApple OSS DistributionsThe KAME implementation supports an extended numeric IPv6 address notation 111*5c2921b0SApple OSS Distributionsfor link-local addresses, 112*5c2921b0SApple OSS Distributionslike 113*5c2921b0SApple OSS Distributions.Dq Li fe80::1%de0 114*5c2921b0SApple OSS Distributionsto specify 115*5c2921b0SApple OSS Distributions.Do 116*5c2921b0SApple OSS Distributions.Li fe80::1 117*5c2921b0SApple OSS Distributionson 118*5c2921b0SApple OSS Distributions.Li de0 119*5c2921b0SApple OSS Distributionsinterface 120*5c2921b0SApple OSS Distributions.Dc . 121*5c2921b0SApple OSS DistributionsThis notation is supported by 122*5c2921b0SApple OSS Distributions.Xr getaddrinfo 3 123*5c2921b0SApple OSS Distributionsand 124*5c2921b0SApple OSS Distributions.Xr getnameinfo 3 . 125*5c2921b0SApple OSS DistributionsSome of normal userland programs, such as 126*5c2921b0SApple OSS Distributions.Xr telnet 1 127*5c2921b0SApple OSS Distributionsor 128*5c2921b0SApple OSS Distributions.Xr ftp 1 , 129*5c2921b0SApple OSS Distributionsare able to use this notation. 130*5c2921b0SApple OSS DistributionsWith special programs 131*5c2921b0SApple OSS Distributionslike 132*5c2921b0SApple OSS Distributions.Xr ping6 8 , 133*5c2921b0SApple OSS Distributionsyou can specify the outgoing interface by an extra command line option 134*5c2921b0SApple OSS Distributionsto disambiguate scoped addresses. 135*5c2921b0SApple OSS Distributions.Pp 136*5c2921b0SApple OSS DistributionsScoped addresses are handled specially in the kernel. 137*5c2921b0SApple OSS DistributionsIn kernel structures like routing tables or interface structures, 138*5c2921b0SApple OSS Distributionsa scoped address will have its interface index embedded into the address. 139*5c2921b0SApple OSS DistributionsTherefore, 140*5c2921b0SApple OSS Distributionsthe address in some kernel structures is not the same as that on the wire. 141*5c2921b0SApple OSS DistributionsThe embedded index will become visible through a 142*5c2921b0SApple OSS Distributions.Dv PF_ROUTE 143*5c2921b0SApple OSS Distributionssocket, kernel memory accesses via 144*5c2921b0SApple OSS Distributions.Xr kvm 3 145*5c2921b0SApple OSS Distributionsand on some other occasions. 146*5c2921b0SApple OSS DistributionsHOWEVER, users should never use the embedded form. 147*5c2921b0SApple OSS DistributionsFor details please consult 148*5c2921b0SApple OSS Distributions.Pa IMPLEMENTATION 149*5c2921b0SApple OSS Distributionssupplied with KAME kit. 150*5c2921b0SApple OSS Distributions.Sh PROTOCOLS 151*5c2921b0SApple OSS DistributionsThe 152*5c2921b0SApple OSS Distributions.Nm 153*5c2921b0SApple OSS Distributionsfamily is comprised of the 154*5c2921b0SApple OSS Distributions.Tn IPv6 155*5c2921b0SApple OSS Distributionsnetwork protocol, Internet Control 156*5c2921b0SApple OSS DistributionsMessage Protocol version 6 157*5c2921b0SApple OSS Distributions.Pq Tn ICMPv6 , 158*5c2921b0SApple OSS DistributionsTransmission Control Protocol 159*5c2921b0SApple OSS Distributions.Pq Tn TCP , 160*5c2921b0SApple OSS Distributionsand User Datagram Protocol 161*5c2921b0SApple OSS Distributions.Pq Tn UDP . 162*5c2921b0SApple OSS Distributions.Tn TCP 163*5c2921b0SApple OSS Distributionsis used to support the 164*5c2921b0SApple OSS Distributions.Dv SOCK_STREAM 165*5c2921b0SApple OSS Distributionsabstraction while 166*5c2921b0SApple OSS Distributions.Tn UDP 167*5c2921b0SApple OSS Distributionsis used to support the 168*5c2921b0SApple OSS Distributions.Dv SOCK_DGRAM 169*5c2921b0SApple OSS Distributionsabstraction. 170*5c2921b0SApple OSS DistributionsNote that 171*5c2921b0SApple OSS Distributions.Tn TCP 172*5c2921b0SApple OSS Distributionsand 173*5c2921b0SApple OSS Distributions.Tn UDP 174*5c2921b0SApple OSS Distributionsare common to 175*5c2921b0SApple OSS Distributions.Xr inet 4 176*5c2921b0SApple OSS Distributionsand 177*5c2921b0SApple OSS Distributions.Nm . 178*5c2921b0SApple OSS DistributionsA raw interface to 179*5c2921b0SApple OSS Distributions.Tn IPv6 180*5c2921b0SApple OSS Distributionsis available 181*5c2921b0SApple OSS Distributionsby creating an Internet socket of type 182*5c2921b0SApple OSS Distributions.Dv SOCK_RAW . 183*5c2921b0SApple OSS DistributionsThe 184*5c2921b0SApple OSS Distributions.Tn ICMPv6 185*5c2921b0SApple OSS Distributionsmessage protocol is accessible from a raw socket. 186*5c2921b0SApple OSS Distributions.\" .Pp 187*5c2921b0SApple OSS Distributions.\" The 128-bit IPv6 address contains both network and host parts. 188*5c2921b0SApple OSS Distributions.\" However, direct examination of addresses is discouraged. 189*5c2921b0SApple OSS Distributions.\" For those programs which absolutely need to break addresses 190*5c2921b0SApple OSS Distributions.\" into their component parts, the following 191*5c2921b0SApple OSS Distributions.\" .Xr ioctl 2 192*5c2921b0SApple OSS Distributions.\" commands are provided for a datagram socket in the 193*5c2921b0SApple OSS Distributions.\" .Nm 194*5c2921b0SApple OSS Distributions.\" domain; they have the same form as the 195*5c2921b0SApple OSS Distributions.\" .Dv SIOCIFADDR 196*5c2921b0SApple OSS Distributions.\" command (see 197*5c2921b0SApple OSS Distributions.\" .Xr intro 4 ) . 198*5c2921b0SApple OSS Distributions.\" .Pp 199*5c2921b0SApple OSS Distributions.\" .Bl -tag -width SIOCSIFNETMASK 200*5c2921b0SApple OSS Distributions.\" .It Dv SIOCSIFNETMASK 201*5c2921b0SApple OSS Distributions.\" Set interface network mask. 202*5c2921b0SApple OSS Distributions.\" The network mask defines the network part of the address; 203*5c2921b0SApple OSS Distributions.\" if it contains more of the address than the address type would indicate, 204*5c2921b0SApple OSS Distributions.\" then subnets are in use. 205*5c2921b0SApple OSS Distributions.\" .It Dv SIOCGIFNETMASK 206*5c2921b0SApple OSS Distributions.\" Get interface network mask. 207*5c2921b0SApple OSS Distributions.\" .El 208*5c2921b0SApple OSS Distributions.\" .Sh ROUTING 209*5c2921b0SApple OSS Distributions.\" The current implementation of Internet protocols includes some routing-table 210*5c2921b0SApple OSS Distributions.\" adaptations to provide enhanced caching of certain end-to-end 211*5c2921b0SApple OSS Distributions.\" information necessary for Transaction TCP and Path MTU Discovery. The 212*5c2921b0SApple OSS Distributions.\" following changes are the most significant: 213*5c2921b0SApple OSS Distributions.\" .Bl -enum 214*5c2921b0SApple OSS Distributions.\" .It 215*5c2921b0SApple OSS Distributions.\" All IP routes, except those with the 216*5c2921b0SApple OSS Distributions.\" .Dv RTF_CLONING 217*5c2921b0SApple OSS Distributions.\" flag and those to multicast destinations, have the 218*5c2921b0SApple OSS Distributions.\" .Dv RTF_PRCLONING 219*5c2921b0SApple OSS Distributions.\" flag forcibly enabled (they are thus said to be 220*5c2921b0SApple OSS Distributions.\" .Dq "protocol cloning" ). 221*5c2921b0SApple OSS Distributions.\" .It 222*5c2921b0SApple OSS Distributions.\" When the last reference to an IP route is dropped, the route is 223*5c2921b0SApple OSS Distributions.\" examined to determine if it was created by cloning such a route. If 224*5c2921b0SApple OSS Distributions.\" this is the case, the 225*5c2921b0SApple OSS Distributions.\" .Dv RTF_PROTO3 226*5c2921b0SApple OSS Distributions.\" flag is turned on, and the expiration timer is initialized to go off 227*5c2921b0SApple OSS Distributions.\" in net.inet.ip.rtexpire seconds. If such a route is re-referenced, 228*5c2921b0SApple OSS Distributions.\" the flag and expiration timer are reset. 229*5c2921b0SApple OSS Distributions.\" .It 230*5c2921b0SApple OSS Distributions.\" A kernel timeout runs once every ten minutes, or sooner if there are 231*5c2921b0SApple OSS Distributions.\" soon-to-expire routes in the kernel routing table, and deletes the 232*5c2921b0SApple OSS Distributions.\" expired routes. 233*5c2921b0SApple OSS Distributions.\" .El 234*5c2921b0SApple OSS Distributions.\" .Pp 235*5c2921b0SApple OSS Distributions.\" A dynamic process is in place to modify the value of 236*5c2921b0SApple OSS Distributions.\" net.inet.ip.rtexpire if the number of cached routes grows too large. 237*5c2921b0SApple OSS Distributions.\" If after an expiration run there are still more than 238*5c2921b0SApple OSS Distributions.\" net.inet.ip.rtmaxcache unreferenced routes remaining, the rtexpire 239*5c2921b0SApple OSS Distributions.\" value is multiplied by 3/4, and any routes which have longer 240*5c2921b0SApple OSS Distributions.\" expiration times have those times adjusted. This process is damped 241*5c2921b0SApple OSS Distributions.\" somewhat by specification of a minimum rtexpire value 242*5c2921b0SApple OSS Distributions.\" (net.inet.ip.rtminexpire), and by restricting the reduction to once in 243*5c2921b0SApple OSS Distributions.\" a ten-minute period. 244*5c2921b0SApple OSS Distributions.\" .Pp 245*5c2921b0SApple OSS Distributions.\" If some external process deletes the original route from which a 246*5c2921b0SApple OSS Distributions.\" protocol-cloned route was generated, the ``child route'' is deleted. 247*5c2921b0SApple OSS Distributions.\" (This is actually a generic mechanism in the routing code support for 248*5c2921b0SApple OSS Distributions.\" protocol-requested cloning.) 249*5c2921b0SApple OSS Distributions.\" .Pp 250*5c2921b0SApple OSS Distributions.\" No attempt is made to manage routes which were not created by protocol 251*5c2921b0SApple OSS Distributions.\" cloning; these are assumed to be static, under the management of an 252*5c2921b0SApple OSS Distributions.\" external routing process, or under the management of a link layer 253*5c2921b0SApple OSS Distributions.\" (e.g., 254*5c2921b0SApple OSS Distributions.\" .Tn ARP 255*5c2921b0SApple OSS Distributions.\" for Ethernets). 256*5c2921b0SApple OSS Distributions.\" .Pp 257*5c2921b0SApple OSS Distributions.\" Only certain types of network activity will result in the cloning of a 258*5c2921b0SApple OSS Distributions.\" route using this mechanism. Specifically, those protocols (such as 259*5c2921b0SApple OSS Distributions.\" .Tn TCP 260*5c2921b0SApple OSS Distributions.\" and 261*5c2921b0SApple OSS Distributions.\" .Tn UDP ) 262*5c2921b0SApple OSS Distributions.\" which themselves cache a long-lasting reference to route for a destination 263*5c2921b0SApple OSS Distributions.\" will trigger the mechanism; whereas raw 264*5c2921b0SApple OSS Distributions.\" .Tn IP 265*5c2921b0SApple OSS Distributions.\" packets, whether locally-generated or forwarded, will not. 266*5c2921b0SApple OSS Distributions.Ss MIB Variables 267*5c2921b0SApple OSS DistributionsA number of variables are implemented in the net.inet6 branch of the 268*5c2921b0SApple OSS Distributions.Xr sysctl 3 269*5c2921b0SApple OSS DistributionsMIB. 270*5c2921b0SApple OSS DistributionsIn addition to the variables supported by the transport protocols 271*5c2921b0SApple OSS Distributions(for which the respective manual pages may be consulted), 272*5c2921b0SApple OSS Distributionsthe following general variables are defined: 273*5c2921b0SApple OSS Distributions.Bl -tag -width IPV6CTL_MAXFRAGPACKETS 274*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_FORWARDING 275*5c2921b0SApple OSS Distributions.Pq ip6.forwarding 276*5c2921b0SApple OSS DistributionsBoolean: enable/disable forwarding of 277*5c2921b0SApple OSS Distributions.Tn IPv6 278*5c2921b0SApple OSS Distributionspackets. 279*5c2921b0SApple OSS DistributionsAlso, identify if the node is acting as a router. 280*5c2921b0SApple OSS DistributionsDefaults to off. 281*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_SENDREDIRECTS 282*5c2921b0SApple OSS Distributions.Pq ip6.redirect 283*5c2921b0SApple OSS DistributionsBoolean: enable/disable sending of 284*5c2921b0SApple OSS Distributions.Tn ICMPv6 285*5c2921b0SApple OSS Distributionsredirects in response to unforwardable 286*5c2921b0SApple OSS Distributions.Tn IPv6 287*5c2921b0SApple OSS Distributionspackets. 288*5c2921b0SApple OSS DistributionsThis option is ignored unless the node is routing 289*5c2921b0SApple OSS Distributions.Tn IPv6 290*5c2921b0SApple OSS Distributionspackets, 291*5c2921b0SApple OSS Distributionsand should normally be enabled on all systems. 292*5c2921b0SApple OSS DistributionsDefaults to on. 293*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_DEFHLIM 294*5c2921b0SApple OSS Distributions.Pq ip6.hlim 295*5c2921b0SApple OSS DistributionsInteger: default hop limit value to use for outgoing 296*5c2921b0SApple OSS Distributions.Tn IPv6 297*5c2921b0SApple OSS Distributionspackets. 298*5c2921b0SApple OSS DistributionsThis value applies to all the transport protocols on top of 299*5c2921b0SApple OSS Distributions.Tn IPv6 . 300*5c2921b0SApple OSS DistributionsThere are APIs to override the value. 301*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_MAXFRAGPACKETS 302*5c2921b0SApple OSS Distributions.Pq ip6.maxfragpackets 303*5c2921b0SApple OSS DistributionsInteger: default maximum number of fragmented packets the node will accept. 304*5c2921b0SApple OSS Distributions0 means that the node will not accept any fragmented packets. 305*5c2921b0SApple OSS Distributions-1 means that the node will accept as many fragmented packets as it receives. 306*5c2921b0SApple OSS DistributionsThe flag is provided basically for avoiding possible DoS attacks. 307*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_ACCEPT_RTADV 308*5c2921b0SApple OSS Distributions.Pq ip6.accept_rtadv 309*5c2921b0SApple OSS DistributionsBoolean: enable/disable receiving of 310*5c2921b0SApple OSS Distributions.Tn ICMPv6 311*5c2921b0SApple OSS Distributionsrouter advertisement packets, 312*5c2921b0SApple OSS Distributionsand autoconfiguration of address prefixes and default routers. 313*5c2921b0SApple OSS DistributionsThe node must be a host 314*5c2921b0SApple OSS Distributions(not a router) 315*5c2921b0SApple OSS Distributionsfor the option to be meaningful. 316*5c2921b0SApple OSS DistributionsDefaults to off. 317*5c2921b0SApple OSS Distributions.\".It Dv IPV6CTL_KEEPFAITH 318*5c2921b0SApple OSS Distributions.\".Pq ip6.keepfaith 319*5c2921b0SApple OSS Distributions.\"Boolean: enable/disable 320*5c2921b0SApple OSS Distributions.\".Dq FAITH 321*5c2921b0SApple OSS Distributions.\"TCP relay IPv6-to-IPv4 translator code in the kernel. 322*5c2921b0SApple OSS Distributions.\"Refer 323*5c2921b0SApple OSS Distributions.\".Xr faith 4 324*5c2921b0SApple OSS Distributions.\"and 325*5c2921b0SApple OSS Distributions.\".Xr faithd 8 326*5c2921b0SApple OSS Distributions.\"for detail. 327*5c2921b0SApple OSS Distributions.\"Defaults to off. 328*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_LOG_INTERVAL 329*5c2921b0SApple OSS Distributions.Pq ip6.log_interval 330*5c2921b0SApple OSS DistributionsInteger: default interval between 331*5c2921b0SApple OSS Distributions.Tn IPv6 332*5c2921b0SApple OSS Distributionspacket forwarding engine log output 333*5c2921b0SApple OSS Distributions(in seconds). 334*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_HDRNESTLIMIT 335*5c2921b0SApple OSS Distributions.Pq ip6.hdrnestlimit 336*5c2921b0SApple OSS DistributionsInteger: default number of the maximum 337*5c2921b0SApple OSS Distributions.Tn IPv6 338*5c2921b0SApple OSS Distributionsextension headers 339*5c2921b0SApple OSS Distributionspermitted on incoming 340*5c2921b0SApple OSS Distributions.Tn IPv6 341*5c2921b0SApple OSS Distributionspackets. 342*5c2921b0SApple OSS DistributionsIf set to 0, the node will accept as many extension headers as possible. 343*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_DAD_COUNT 344*5c2921b0SApple OSS Distributions.Pq ip6.dad_count 345*5c2921b0SApple OSS DistributionsInteger: default number of 346*5c2921b0SApple OSS Distributions.Tn IPv6 347*5c2921b0SApple OSS DistributionsDAD 348*5c2921b0SApple OSS Distributions.Pq duplicated address detection 349*5c2921b0SApple OSS Distributionsprobe packets. 350*5c2921b0SApple OSS DistributionsThe packets will be generated when 351*5c2921b0SApple OSS Distributions.Tn IPv6 352*5c2921b0SApple OSS Distributionsinterface addresses are configured. 353*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_AUTO_FLOWLABEL 354*5c2921b0SApple OSS Distributions.Pq ip6.auto_flowlabel 355*5c2921b0SApple OSS DistributionsBoolean: enable/disable automatic filling of 356*5c2921b0SApple OSS Distributions.Tn IPv6 357*5c2921b0SApple OSS Distributionsflowlabel field, for outstanding connected transport protocol packets. 358*5c2921b0SApple OSS DistributionsThe field might be used by intermediate routers to identify packet flows. 359*5c2921b0SApple OSS DistributionsDefaults to on. 360*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_DEFMCASTHLIM 361*5c2921b0SApple OSS Distributions.Pq ip6.defmcasthlim 362*5c2921b0SApple OSS DistributionsInteger: default hop limit value for an 363*5c2921b0SApple OSS Distributions.Tn IPv6 364*5c2921b0SApple OSS Distributionsmulticast packet sourced by the node. 365*5c2921b0SApple OSS DistributionsThis value applies to all the transport protocols on top of 366*5c2921b0SApple OSS Distributions.Tn IPv6 . 367*5c2921b0SApple OSS DistributionsThere are APIs to override the value as documented in 368*5c2921b0SApple OSS Distributions.Xr ip6 4 . 369*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_GIF_HLIM 370*5c2921b0SApple OSS Distributions.Pq ip6.gifhlim 371*5c2921b0SApple OSS DistributionsInteger: default maximum hop limit value for an 372*5c2921b0SApple OSS Distributions.Tn IPv6 373*5c2921b0SApple OSS Distributionspacket generated by 374*5c2921b0SApple OSS Distributions.Xr gif 4 375*5c2921b0SApple OSS Distributionstunnel interface. 376*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_KAME_VERSION 377*5c2921b0SApple OSS Distributions.Pq ip6.kame_version 378*5c2921b0SApple OSS DistributionsString: identifies the version of KAME 379*5c2921b0SApple OSS Distributions.Tn IPv6 380*5c2921b0SApple OSS Distributionsstack implemented in the kernel. 381*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_USE_DEPRECATED 382*5c2921b0SApple OSS Distributions.Pq ip6.use_deprecated 383*5c2921b0SApple OSS DistributionsBoolean: enable/disable use of deprecated address, 384*5c2921b0SApple OSS Distributionsspecified in RFC2462 5.5.4. 385*5c2921b0SApple OSS DistributionsDefaults to on. 386*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_RR_PRUNE 387*5c2921b0SApple OSS Distributions.Pq ip6.rr_prune 388*5c2921b0SApple OSS DistributionsInteger: default interval between 389*5c2921b0SApple OSS Distributions.Tn IPv6 390*5c2921b0SApple OSS Distributionsrouter renumbering prefix babysitting, in seconds. 391*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_MAPPED_ADDR 392*5c2921b0SApple OSS Distributions.Pq ip6.mapped_addr 393*5c2921b0SApple OSS DistributionsBoolean: enable/disable use of 394*5c2921b0SApple OSS Distributions.Tn IPv4 395*5c2921b0SApple OSS Distributionsmapped address on 396*5c2921b0SApple OSS Distributions.Dv AF_INET6 397*5c2921b0SApple OSS Distributionssockets. 398*5c2921b0SApple OSS DistributionsDefaults to on. 399*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_RTEXPIRE 400*5c2921b0SApple OSS Distributions.Pq ip6.rtexpire 401*5c2921b0SApple OSS DistributionsInteger: lifetime in seconds of protocol-cloned 402*5c2921b0SApple OSS Distributions.Tn IP 403*5c2921b0SApple OSS Distributionsroutes after the last reference drops (default one hour). 404*5c2921b0SApple OSS Distributions.\"This value varies dynamically as described above. 405*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_RTMINEXPIRE 406*5c2921b0SApple OSS Distributions.Pq ip6.rtminexpire 407*5c2921b0SApple OSS DistributionsInteger: minimum value of ip.rtexpire (default ten seconds). 408*5c2921b0SApple OSS Distributions.\"This value has no effect on user modifications, but restricts the dynamic 409*5c2921b0SApple OSS Distributions.\"adaptation described above. 410*5c2921b0SApple OSS Distributions.It Dv IPV6CTL_RTMAXCACHE 411*5c2921b0SApple OSS Distributions.Pq ip6.rtmaxcache 412*5c2921b0SApple OSS DistributionsInteger: trigger level of cached, unreferenced, protocol-cloned routes 413*5c2921b0SApple OSS Distributionswhich initiates dynamic adaptation (default 128). 414*5c2921b0SApple OSS Distributions.El 415*5c2921b0SApple OSS Distributions.Ss Interaction between IPv4/v6 sockets 416*5c2921b0SApple OSS DistributionsThe behavior of 417*5c2921b0SApple OSS Distributions.Dv AF_INET6 418*5c2921b0SApple OSS DistributionsTCP/UDP socket is documented in RFC2553. 419*5c2921b0SApple OSS DistributionsBasically, it says this: 420*5c2921b0SApple OSS Distributions.Bl -bullet -compact 421*5c2921b0SApple OSS Distributions.It 422*5c2921b0SApple OSS DistributionsA specific bind on an 423*5c2921b0SApple OSS Distributions.Dv AF_INET6 424*5c2921b0SApple OSS Distributionssocket 425*5c2921b0SApple OSS Distributions.Xr ( bind 2 426*5c2921b0SApple OSS Distributionswith an address specified) 427*5c2921b0SApple OSS Distributionsshould accept IPv6 traffic to that address only. 428*5c2921b0SApple OSS Distributions.It 429*5c2921b0SApple OSS DistributionsIf you perform a wildcard bind 430*5c2921b0SApple OSS Distributionson an 431*5c2921b0SApple OSS Distributions.Dv AF_INET6 432*5c2921b0SApple OSS Distributionssocket 433*5c2921b0SApple OSS Distributions.Xr ( bind 2 434*5c2921b0SApple OSS Distributionsto IPv6 address 435*5c2921b0SApple OSS Distributions.Li :: ) , 436*5c2921b0SApple OSS Distributionsand there is no wildcard bind 437*5c2921b0SApple OSS Distributions.Dv AF_INET 438*5c2921b0SApple OSS Distributionssocket on that TCP/UDP port, IPv6 traffic as well as IPv4 traffic 439*5c2921b0SApple OSS Distributionsshould be routed to that 440*5c2921b0SApple OSS Distributions.Dv AF_INET6 441*5c2921b0SApple OSS Distributionssocket. 442*5c2921b0SApple OSS DistributionsIPv4 traffic should be seen as if it came from an IPv6 address like 443*5c2921b0SApple OSS Distributions.Li ::ffff:10.1.1.1 . 444*5c2921b0SApple OSS DistributionsThis is called an IPv4 mapped address. 445*5c2921b0SApple OSS Distributions.It 446*5c2921b0SApple OSS DistributionsIf there are both a wildcard bind 447*5c2921b0SApple OSS Distributions.Dv AF_INET 448*5c2921b0SApple OSS Distributionssocket and a wildcard bind 449*5c2921b0SApple OSS Distributions.Dv AF_INET6 450*5c2921b0SApple OSS Distributionssocket on one TCP/UDP port, they should behave separately. 451*5c2921b0SApple OSS DistributionsIPv4 traffic should be routed to the 452*5c2921b0SApple OSS Distributions.Dv AF_INET 453*5c2921b0SApple OSS Distributionssocket and IPv6 should be routed to the 454*5c2921b0SApple OSS Distributions.Dv AF_INET6 455*5c2921b0SApple OSS Distributionssocket. 456*5c2921b0SApple OSS Distributions.El 457*5c2921b0SApple OSS Distributions.Pp 458*5c2921b0SApple OSS DistributionsHowever, RFC2553 does not define the ordering constraint between calls to 459*5c2921b0SApple OSS Distributions.Xr bind 2 , 460*5c2921b0SApple OSS Distributionsnor how IPv4 TCP/UDP port numbers and IPv6 TCP/UDP port numbers 461*5c2921b0SApple OSS Distributionsrelate to each other 462*5c2921b0SApple OSS Distributions(should they be integrated or separated). 463*5c2921b0SApple OSS DistributionsImplemented behavior is very different from kernel to kernel. 464*5c2921b0SApple OSS DistributionsTherefore, it is unwise to rely too much upon the behavior of 465*5c2921b0SApple OSS Distributions.Dv AF_INET6 466*5c2921b0SApple OSS Distributionswildcard bind sockets. 467*5c2921b0SApple OSS DistributionsIt is recommended to listen to two sockets, one for 468*5c2921b0SApple OSS Distributions.Dv AF_INET 469*5c2921b0SApple OSS Distributionsand another for 470*5c2921b0SApple OSS Distributions.Dv AF_INET6 , 471*5c2921b0SApple OSS Distributionswhen you would like to accept both IPv4 and IPv6 traffic. 472*5c2921b0SApple OSS Distributions.Pp 473*5c2921b0SApple OSS DistributionsIt should also be noted that 474*5c2921b0SApple OSS Distributionsmalicious parties can take advantage of the complexity presented above, 475*5c2921b0SApple OSS Distributionsand are able to bypass access control, 476*5c2921b0SApple OSS Distributionsif the target node routes IPv4 traffic to 477*5c2921b0SApple OSS Distributions.Dv AF_INET6 478*5c2921b0SApple OSS Distributionssocket. 479*5c2921b0SApple OSS DistributionsUsers are advised to take care handling connections 480*5c2921b0SApple OSS Distributionsfrom IPv4 mapped address to 481*5c2921b0SApple OSS Distributions.Dv AF_INET6 482*5c2921b0SApple OSS Distributionssockets. 483*5c2921b0SApple OSS Distributions.\".Pp 484*5c2921b0SApple OSS Distributions.\"Because of the above, by default, 485*5c2921b0SApple OSS Distributions.\"KAME/NetBSD and KAME/OpenBSD 486*5c2921b0SApple OSS Distributions.\"does not route IPv4 traffic to 487*5c2921b0SApple OSS Distributions.\".Dv AF_INET6 488*5c2921b0SApple OSS Distributions.\"sockets. 489*5c2921b0SApple OSS Distributions.\"Listen to two sockets if you want to accept both IPv4 and IPv6 traffic. 490*5c2921b0SApple OSS Distributions.\"On KAME/NetBSD, IPv4 traffic may be routed with certain 491*5c2921b0SApple OSS Distributions.\"per-socket/per-node configuration, however, it is not recommended. 492*5c2921b0SApple OSS Distributions.\"Consult 493*5c2921b0SApple OSS Distributions.\".Xr ip6 4 494*5c2921b0SApple OSS Distributions.\"for details. 495*5c2921b0SApple OSS Distributions.Sh SEE ALSO 496*5c2921b0SApple OSS Distributions.Xr ioctl 2 , 497*5c2921b0SApple OSS Distributions.Xr socket 2 , 498*5c2921b0SApple OSS Distributions.Xr sysctl 3 , 499*5c2921b0SApple OSS Distributions.Xr icmp6 4 , 500*5c2921b0SApple OSS Distributions.Xr intro 4 , 501*5c2921b0SApple OSS Distributions.Xr ip6 4 , 502*5c2921b0SApple OSS Distributions.Xr tcp 4 , 503*5c2921b0SApple OSS Distributions.Xr udp 4 504*5c2921b0SApple OSS Distributions.Sh STANDARDS 505*5c2921b0SApple OSS Distributions.Rs 506*5c2921b0SApple OSS Distributions.%A Tatsuya Jinmei 507*5c2921b0SApple OSS Distributions.%A Atsushi Onoe 508*5c2921b0SApple OSS Distributions.%T "An Extension of Format for IPv6 Scoped Addresses" 509*5c2921b0SApple OSS Distributions.%R internet draft 510*5c2921b0SApple OSS Distributions.%D June 2000 511*5c2921b0SApple OSS Distributions.%N draft-ietf-ipngwg-scopedaddr-format-02.txt 512*5c2921b0SApple OSS Distributions.%O work in progress material 513*5c2921b0SApple OSS Distributions.Re 514*5c2921b0SApple OSS Distributions.Sh HISTORY 515*5c2921b0SApple OSS DistributionsThe 516*5c2921b0SApple OSS Distributions.Nm 517*5c2921b0SApple OSS Distributionsprotocol interfaces are defined in RFC2553 and RFC2292. 518*5c2921b0SApple OSS DistributionsThe implementation described herein appeared in the WIDE/KAME project. 519*5c2921b0SApple OSS Distributions.Sh BUGS 520*5c2921b0SApple OSS DistributionsThe IPv6 support is subject to change as the Internet protocols develop. 521*5c2921b0SApple OSS DistributionsUsers should not depend on details of the current implementation, 522*5c2921b0SApple OSS Distributionsbut rather the services exported. 523*5c2921b0SApple OSS Distributions.Pp 524*5c2921b0SApple OSS DistributionsUsers are suggested to implement 525*5c2921b0SApple OSS Distributions.Dq version independent 526*5c2921b0SApple OSS Distributionscode as much as possible, as you will need to support both 527*5c2921b0SApple OSS Distributions.Xr inet 4 528*5c2921b0SApple OSS Distributionsand 529*5c2921b0SApple OSS Distributions.Nm . 530