1 .\" $NetBSD: stf.4,v 1.20 2004/03/24 12:09:21 wiz Exp $
2 .\" $KAME: stf.4,v 1.39 2002/11/17 19:34:02 itojun Exp $
4 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the project nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .Nd 6to4 tunnel interface
38 .Cd "pseudo-device stf"
44 IPv6 in IPv4 encapsulation.
45 It can tunnel IPv6 traffic over IPv4, as specified in
48 interfaces are dynamically created and destroyed with the
55 interface may be created.
57 For ordinary nodes in 6to4 sites, you do not need a
62 interface is only necessary on the site border router
69 Due to the way the 6to4 protocol is specified,
71 interfaces require certain configuration to work properly.
74 valid 6to4 address needs to be configured on the interface.
75 .Dq A valid 6to4 address
76 is an address which has the following properties.
77 If any of the following properties are not satisfied,
79 raises a runtime error on packet transmission.
80 Read the specification for more details.
84 .Li 2002:xxyy:zzuu::/48 ,
87 is the hexadecimal notation of an IPv4 address for the node.
88 The IPv4 address used can be taken from any interface your node has.
89 Since the specification forbids the use of IPv4 private address,
90 the address needs to be a global IPv4 address.
92 Subnet identifier portion
94 and interface identifier portion
96 are properly filled to avoid address collisions.
99 If you would like the node to behave as a relay router,
100 the prefix length for the IPv6 interface address needs to be 16 so that
101 the node would consider any 6to4 destination as
103 If you would like to restrict 6to4 peers to be inside a certain IPv4 prefix,
104 you may want to configure the IPv6 prefix length to be
105 .Dq 16 + IPv4 prefix length .
108 interface will check the IPv4 source address on packets
109 if the IPv6 prefix length is larger than 16.
112 can be configured to be ECN (Explicit Congestion Notification) friendly.
113 This can be configured by
119 Please note that the 6to4 specification is written as an
120 .Dq accept tunneled packet from everyone
124 device, you are making it much easier for malicious parties to inject
125 fabricated IPv6 packets to your node.
126 Also, malicious parties can inject IPv6 packets with fabricated source addresses
127 to make your node generate improper tunneled packets.
128 Administrators must be cautious when enabling the interface.
129 To prevent possible attacks, the
131 interface filters out the following packets (note that the checks are
135 Packets with IPv4 unspecified addresses as outer IPv4 source/destination
138 Packets with the loopback address as outer IPv4 source/destination
141 Packets with IPv4 multicast addresses as outer IPv4 source/destination
144 Packets with limited broadcast addresses as outer IPv4 source/destination
147 Packets with private addresses as outer IPv4 source/destination
148 .Pq Li 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
150 Packets with IPv4 link-local addresses as outer IPv4 source/destination
151 .Pq Li 169.254.0.0/16
153 Packets with subnet broadcast addresses as outer IPv4 source/destination.
154 The check is made against subnet broadcast addresses for
155 all of the directly connected subnets.
157 Packets that do not pass ingress filtering.
158 Outer IPv4 source addresses must meet the IPv4 topology on the routing table.
159 Ingress filtering can be turned off by
163 The same set of rules are applied against the IPv4 address embedded into
164 the inner IPv6 address, if the IPv6 address matches the 6to4 prefix.
166 Packets with site-local or link-local unicast addresses as
167 inner IPv6 source/destination
169 Packets with node-local or link-local multicast addresses as
170 inner IPv6 source/destination
173 It is recommended to filter/audit
174 incoming IPv4 packets with IP protocol number 41, as necessary.
175 It is also recommended to filter/audit encapsulated IPv6 packets as well.
176 You may also want to run normal ingress filtering against inner IPv6 addresses
183 interface, it is possible to disable the input path,
184 making direct attacks from the outside impossible.
185 Note, however, that other security risks exist.
186 If you wish to use the configuration,
187 you must not advertise your 6to4 addresses to others.
194 written in hexadecimal.
196 # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
197 # ifconfig stf0 create inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\
201 The following configuration accepts packets from IPv4 source address
204 It emits 6to4 packets only for IPv6 destination 2002:0901::/32
205 .Pq IPv4 destination will match Li 9.1.0.0/16 .
207 # ifconfig ne0 inet 9.1.2.3 netmask 0xffff0000
208 # ifconfig stf0 create inet6 2002:0901:0203:0000:a00:5aff:fe38:6f86 \\
212 The following configuration uses the
214 interface as an output-only device.
215 You need to have alternative IPv6 connectivity
217 to use this configuration.
218 For outbound traffic, you can reach other 6to4 networks efficiently via
220 For inbound traffic, you will not receive any 6to4-tunneled packets
221 .Pq less security drawbacks .
222 Be careful not to advertise your 6to4 prefix to others
223 .Pq Li 2002:8504:0506::/48 ,
224 and not to use your 6to4 prefix as a source address.
226 # ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
227 # ifconfig stf0 create inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\
228 prefixlen 16 alias deprecated link0
229 # route add -inet6 2002:: -prefixlen 16 ::1 -ifp stf0
237 .Pa http://www.6bone.net/6bone_6to4.html
241 .%T "Connection of IPv6 Domains via IPv4 Clouds"
249 .%T "Ingress Filtering for Multihomed Networks"
255 .%A Jun-ichiro itojun Hagino
256 .%T "Possible abuse against IPv6 transition technologies"
258 .%N draft-itojun-ipv6-transition-abuse-01.txt
265 device first appeared in WIDE/KAME IPv6 stack.
270 interface is allowed for a node,
271 and no more than one IPv6 interface address is allowed for an
274 This is to avoid source address selection conflicts
275 between the IPv6 layer and the IPv4 layer,
276 and to cope with ingress filtering rules on the other side.
277 This is a feature to make
279 work right for all occasions.