1*86d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man4/stf.4,v 1.3.2.5 2002/08/28 04:46:25 brooks Exp $ 2*86d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man4/stf.4,v 1.4 2007/11/23 23:16:37 swildner Exp $ 3*86d7f5d3SJohn Marino.\" $KAME: stf.4,v 1.35 2001/05/02 06:24:49 itojun Exp $ 4*86d7f5d3SJohn Marino.\" 5*86d7f5d3SJohn Marino.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6*86d7f5d3SJohn Marino.\" All rights reserved. 7*86d7f5d3SJohn Marino.\" 8*86d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without 9*86d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions 10*86d7f5d3SJohn Marino.\" are met: 11*86d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 12*86d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer. 13*86d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 14*86d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer in the 15*86d7f5d3SJohn Marino.\" documentation and/or other materials provided with the distribution. 16*86d7f5d3SJohn Marino.\" 3. Neither the name of the project nor the names of its contributors 17*86d7f5d3SJohn Marino.\" may be used to endorse or promote products derived from this software 18*86d7f5d3SJohn Marino.\" without specific prior written permission. 19*86d7f5d3SJohn Marino.\" 20*86d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 21*86d7f5d3SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*86d7f5d3SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*86d7f5d3SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 24*86d7f5d3SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*86d7f5d3SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*86d7f5d3SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*86d7f5d3SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*86d7f5d3SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*86d7f5d3SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*86d7f5d3SJohn Marino.\" SUCH DAMAGE. 31*86d7f5d3SJohn Marino.\" 32*86d7f5d3SJohn Marino.Dd April 27, 2001 33*86d7f5d3SJohn Marino.Dt STF 4 34*86d7f5d3SJohn Marino.Os 35*86d7f5d3SJohn Marino.Sh NAME 36*86d7f5d3SJohn Marino.Nm stf 37*86d7f5d3SJohn Marino.Nd 38*86d7f5d3SJohn Marino.Tn 6to4 39*86d7f5d3SJohn Marinotunnel interface 40*86d7f5d3SJohn Marino.Sh SYNOPSIS 41*86d7f5d3SJohn Marino.Cd "pseudo-device stf" 42*86d7f5d3SJohn Marino.Sh DESCRIPTION 43*86d7f5d3SJohn MarinoThe 44*86d7f5d3SJohn Marino.Nm 45*86d7f5d3SJohn Marinointerface supports 46*86d7f5d3SJohn Marino.Dq 6to4 47*86d7f5d3SJohn MarinoIPv6 in IPv4 encapsulation. 48*86d7f5d3SJohn MarinoIt can tunnel IPv6 traffic over IPv4, as specified in 49*86d7f5d3SJohn Marino.Li RFC 3056 . 50*86d7f5d3SJohn Marino.Pp 51*86d7f5d3SJohn MarinoFor ordinary nodes in 6to4 site, you do not need 52*86d7f5d3SJohn Marino.Nm 53*86d7f5d3SJohn Marinointerface. 54*86d7f5d3SJohn MarinoThe 55*86d7f5d3SJohn Marino.Nm 56*86d7f5d3SJohn Marinointerface is necessary for site border router 57*86d7f5d3SJohn Marino(called 58*86d7f5d3SJohn Marino.Dq 6to4 router 59*86d7f5d3SJohn Marinoin the specification). 60*86d7f5d3SJohn Marino.Pp 61*86d7f5d3SJohn MarinoEach 62*86d7f5d3SJohn Marino.Nm 63*86d7f5d3SJohn Marinointerface is created at runtime using interface cloning. 64*86d7f5d3SJohn MarinoThis is 65*86d7f5d3SJohn Marinomost easily done with the 66*86d7f5d3SJohn Marino.Xr ifconfig 8 67*86d7f5d3SJohn Marino.Cm create 68*86d7f5d3SJohn Marinocommand or using the 69*86d7f5d3SJohn Marino.Va cloned_interfaces 70*86d7f5d3SJohn Marinovariable in 71*86d7f5d3SJohn Marino.Xr rc.conf 5 . 72*86d7f5d3SJohn Marino.Pp 73*86d7f5d3SJohn MarinoDue to the way 6to4 protocol is specified, 74*86d7f5d3SJohn Marino.Nm 75*86d7f5d3SJohn Marinointerface requires certain configuration to work properly. 76*86d7f5d3SJohn MarinoSingle 77*86d7f5d3SJohn Marino(no more than 1) 78*86d7f5d3SJohn Marinovalid 6to4 address needs to be configured to the interface. 79*86d7f5d3SJohn Marino.Dq A valid 6to4 address 80*86d7f5d3SJohn Marinois an address which has the following properties. 81*86d7f5d3SJohn MarinoIf any of the following properties are not satisfied, 82*86d7f5d3SJohn Marino.Nm 83*86d7f5d3SJohn Marinoraises runtime error on packet transmission. 84*86d7f5d3SJohn MarinoRead the specification for more details. 85*86d7f5d3SJohn Marino.Bl -bullet 86*86d7f5d3SJohn Marino.It 87*86d7f5d3SJohn Marinomatches 88*86d7f5d3SJohn Marino.Li 2002:xxyy:zzuu::/48 89*86d7f5d3SJohn Marinowhere 90*86d7f5d3SJohn Marino.Li xxyy:zzuu 91*86d7f5d3SJohn Marinois a hexadecimal notation of an IPv4 address for the node. 92*86d7f5d3SJohn MarinoIPv4 address can be taken from any of interfaces your node has. 93*86d7f5d3SJohn MarinoSince the specification forbids the use of IPv4 private address, 94*86d7f5d3SJohn Marinothe address needs to be a global IPv4 address. 95*86d7f5d3SJohn Marino.It 96*86d7f5d3SJohn MarinoSubnet identifier portion 97*86d7f5d3SJohn Marino(48th to 63rd bit) 98*86d7f5d3SJohn Marinoand interface identifier portion 99*86d7f5d3SJohn Marino(lower 64 bits) 100*86d7f5d3SJohn Marinoare properly filled to avoid address collisions. 101*86d7f5d3SJohn Marino.El 102*86d7f5d3SJohn Marino.Pp 103*86d7f5d3SJohn MarinoIf you would like the node to behave as a relay router, 104*86d7f5d3SJohn Marinothe prefix length for the IPv6 interface address needs to be 16 so that 105*86d7f5d3SJohn Marinothe node would consider any 6to4 destination as 106*86d7f5d3SJohn Marino.Dq on-link . 107*86d7f5d3SJohn MarinoIf you would like to restrict 6to4 peers to be inside certain IPv4 prefix, 108*86d7f5d3SJohn Marinoyou may want to configure IPv6 prefix length as 109*86d7f5d3SJohn Marino.Dq 16 + IPv4 prefix length . 110*86d7f5d3SJohn Marino.Nm 111*86d7f5d3SJohn Marinointerface will check the IPv4 source address on packets, 112*86d7f5d3SJohn Marinoif the IPv6 prefix length is larger than 16. 113*86d7f5d3SJohn Marino.Pp 114*86d7f5d3SJohn Marino.Nm 115*86d7f5d3SJohn Marinocan be configured to be ECN friendly. 116*86d7f5d3SJohn MarinoThis can be configured by 117*86d7f5d3SJohn Marino.Dv IFF_LINK1 . 118*86d7f5d3SJohn MarinoSee 119*86d7f5d3SJohn Marino.Xr gif 4 120*86d7f5d3SJohn Marinofor details. 121*86d7f5d3SJohn Marino.Pp 122*86d7f5d3SJohn MarinoPlease note that 6to4 specification is written as 123*86d7f5d3SJohn Marino.Dq accept tunnelled packet from everyone 124*86d7f5d3SJohn Marinotunnelling device. 125*86d7f5d3SJohn MarinoBy enabling 126*86d7f5d3SJohn Marino.Nm 127*86d7f5d3SJohn Marinodevice, you are making it much easier for malicious parties to inject 128*86d7f5d3SJohn Marinofabricated IPv6 packet to your node. 129*86d7f5d3SJohn MarinoAlso, malicious party can inject an IPv6 packet with fabricated source address 130*86d7f5d3SJohn Marinoto make your node generate improper tunnelled packet. 131*86d7f5d3SJohn MarinoAdministrators must take caution when enabling the interface. 132*86d7f5d3SJohn MarinoTo prevent possible attacks, 133*86d7f5d3SJohn Marino.Nm 134*86d7f5d3SJohn Marinointerface filters out the following packets. 135*86d7f5d3SJohn MarinoNote that the checks are no way complete: 136*86d7f5d3SJohn Marino.Bl -bullet 137*86d7f5d3SJohn Marino.It 138*86d7f5d3SJohn MarinoPackets with IPv4 unspecified address as outer IPv4 source/destination 139*86d7f5d3SJohn Marino.Pq Li 0.0.0.0/8 140*86d7f5d3SJohn Marino.It 141*86d7f5d3SJohn MarinoPackets with loopback address as outer IPv4 source/destination 142*86d7f5d3SJohn Marino.Pq Li 127.0.0.0/8 143*86d7f5d3SJohn Marino.It 144*86d7f5d3SJohn MarinoPackets with IPv4 multicast address as outer IPv4 source/destination 145*86d7f5d3SJohn Marino.Pq Li 224.0.0.0/4 146*86d7f5d3SJohn Marino.It 147*86d7f5d3SJohn MarinoPackets with limited broadcast address as outer IPv4 source/destination 148*86d7f5d3SJohn Marino.Pq Li 255.0.0.0/8 149*86d7f5d3SJohn Marino.It 150*86d7f5d3SJohn MarinoPackets with subnet broadcast address as outer IPv4 source/destination. 151*86d7f5d3SJohn MarinoThe check is made against subnet broadcast addresses for 152*86d7f5d3SJohn Marinoall of the directly connected subnets. 153*86d7f5d3SJohn Marino.It 154*86d7f5d3SJohn MarinoPackets that does not pass ingress filtering. 155*86d7f5d3SJohn MarinoOuter IPv4 source address must meet the IPv4 topology on the routing table. 156*86d7f5d3SJohn MarinoIngress filter can be turned off by 157*86d7f5d3SJohn Marino.Dv IFF_LINK2 158*86d7f5d3SJohn Marinobit. 159*86d7f5d3SJohn Marino.It 160*86d7f5d3SJohn MarinoThe same set of rules are applied against the IPv4 address embedded into 161*86d7f5d3SJohn Marinoinner IPv6 address, if the IPv6 address matches 6to4 prefix. 162*86d7f5d3SJohn Marino.El 163*86d7f5d3SJohn Marino.Pp 164*86d7f5d3SJohn MarinoIt is recommended to filter/audit 165*86d7f5d3SJohn Marinoincoming IPv4 packet with IP protocol number 41, as necessary. 166*86d7f5d3SJohn MarinoIt is also recommended to filter/audit encapsulated IPv6 packets as well. 167*86d7f5d3SJohn MarinoYou may also want to run normal ingress filter against inner IPv6 address 168*86d7f5d3SJohn Marinoto avoid spoofing. 169*86d7f5d3SJohn Marino.Pp 170*86d7f5d3SJohn MarinoBy setting the 171*86d7f5d3SJohn Marino.Dv IFF_LINK0 172*86d7f5d3SJohn Marinoflag on the 173*86d7f5d3SJohn Marino.Nm 174*86d7f5d3SJohn Marinointerface, it is possible to disable the input path, 175*86d7f5d3SJohn Marinomaking the direct attacks from the outside impossible. 176*86d7f5d3SJohn MarinoNote, however, there are other security risks exist. 177*86d7f5d3SJohn MarinoIf you wish to use the configuration, 178*86d7f5d3SJohn Marinoyou must not advertise your 6to4 address to others. 179*86d7f5d3SJohn Marino.\" 180*86d7f5d3SJohn Marino.Sh EXAMPLES 181*86d7f5d3SJohn MarinoNote that 182*86d7f5d3SJohn Marino.Li 8504:0506 183*86d7f5d3SJohn Marinois equal to 184*86d7f5d3SJohn Marino.Li 133.4.5.6 , 185*86d7f5d3SJohn Marinowritten in hexadecimals. 186*86d7f5d3SJohn Marino.Bd -literal 187*86d7f5d3SJohn Marino# ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00 188*86d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\ 189*86d7f5d3SJohn Marino prefixlen 16 alias 190*86d7f5d3SJohn Marino.Ed 191*86d7f5d3SJohn Marino.Pp 192*86d7f5d3SJohn MarinoThe following configuration accepts packets from IPv4 source 193*86d7f5d3SJohn Marino.Li 9.1.0.0/16 194*86d7f5d3SJohn Marinoonly. 195*86d7f5d3SJohn MarinoIt emits 6to4 packet only for IPv6 destination 2002:0901::/32 196*86d7f5d3SJohn Marino(IPv4 destination will match 197*86d7f5d3SJohn Marino.Li 9.1.0.0/16 ) . 198*86d7f5d3SJohn Marino.Bd -literal 199*86d7f5d3SJohn Marino# ifconfig ne0 inet 9.1.2.3 netmask 0xffff0000 200*86d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:0901:0203:0000:a00:5aff:fe38:6f86 \\ 201*86d7f5d3SJohn Marino prefixlen 32 alias 202*86d7f5d3SJohn Marino.Ed 203*86d7f5d3SJohn Marino.Pp 204*86d7f5d3SJohn MarinoThe following configuration uses the 205*86d7f5d3SJohn Marino.Nm 206*86d7f5d3SJohn Marinointerface as an output-only device. 207*86d7f5d3SJohn MarinoYou need to have alternative IPv6 connectivity 208*86d7f5d3SJohn Marino(other than 6to4) 209*86d7f5d3SJohn Marinoto use this configuration. 210*86d7f5d3SJohn MarinoFor outbound traffic, you can reach other 6to4 networks efficiently via 211*86d7f5d3SJohn Marino.Nm . 212*86d7f5d3SJohn MarinoFor inbound traffic, you will not receive any 6to4-tunneled packets 213*86d7f5d3SJohn Marino(less security drawbacks). 214*86d7f5d3SJohn MarinoBe careful not to advertise your 6to4 prefix to others 215*86d7f5d3SJohn Marino.Pq Li 2002:8504:0506::/48 , 216*86d7f5d3SJohn Marinoand not to use your 6to4 prefix as a source. 217*86d7f5d3SJohn Marino.Bd -literal 218*86d7f5d3SJohn Marino# ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00 219*86d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\ 220*86d7f5d3SJohn Marino prefixlen 16 alias deprecated link0 221*86d7f5d3SJohn Marino# route add -inet6 2002:: -prefixlen 16 ::1 222*86d7f5d3SJohn Marino# route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0 223*86d7f5d3SJohn Marino.Ed 224*86d7f5d3SJohn Marino.\" 225*86d7f5d3SJohn Marino.Sh SEE ALSO 226*86d7f5d3SJohn Marino.Xr gif 4 , 227*86d7f5d3SJohn Marino.Xr inet 4 , 228*86d7f5d3SJohn Marino.Xr inet6 4 229*86d7f5d3SJohn Marino.Pp 230*86d7f5d3SJohn Marino.Pa http://www.6bone.net/6bone_6to4.html 231*86d7f5d3SJohn Marino.Rs 232*86d7f5d3SJohn Marino.%A Brian Carpenter 233*86d7f5d3SJohn Marino.%A Keith Moore 234*86d7f5d3SJohn Marino.%T "Connection of IPv6 Domains via IPv4 Clouds" 235*86d7f5d3SJohn Marino.%D February 2001 236*86d7f5d3SJohn Marino.%R RFC 237*86d7f5d3SJohn Marino.%N 3056 238*86d7f5d3SJohn Marino.Re 239*86d7f5d3SJohn Marino.Rs 240*86d7f5d3SJohn Marino.%A Jun-ichiro itojun Hagino 241*86d7f5d3SJohn Marino.%T "Possible abuse against IPv6 transition technologies" 242*86d7f5d3SJohn Marino.%D July 2000 243*86d7f5d3SJohn Marino.%N draft-itojun-ipv6-transition-abuse-01.txt 244*86d7f5d3SJohn Marino.%O work in progress 245*86d7f5d3SJohn Marino.Re 246*86d7f5d3SJohn Marino.\" 247*86d7f5d3SJohn Marino.Sh HISTORY 248*86d7f5d3SJohn MarinoThe 249*86d7f5d3SJohn Marino.Nm 250*86d7f5d3SJohn Marinodevice first appeared in WIDE/KAME IPv6 stack. 251*86d7f5d3SJohn Marino.\" 252*86d7f5d3SJohn Marino.Sh BUGS 253*86d7f5d3SJohn MarinoNo more than one 254*86d7f5d3SJohn Marino.Nm 255*86d7f5d3SJohn Marinointerface is allowed for a node, 256*86d7f5d3SJohn Marinoand no more than one IPv6 interface address is allowed for an 257*86d7f5d3SJohn Marino.Nm 258*86d7f5d3SJohn Marinointerface. 259*86d7f5d3SJohn MarinoIt is to avoid source address selection conflicts 260*86d7f5d3SJohn Marinobetween IPv6 layer and IPv4 layer, 261*86d7f5d3SJohn Marinoand to cope with ingress filtering rule on the other side. 262*86d7f5d3SJohn MarinoThis is a feature to make 263*86d7f5d3SJohn Marino.Nm 264*86d7f5d3SJohn Marinowork right for all occasions. 265