xref: /freebsd/share/man/man4/stf.4 (revision ec09ef4ff8d0a377fd86c0c2e96a807a538fce4b)
1.\"	$FreeBSD$
2.\"     $KAME: stf.4,v 1.24 2000/06/07 23:35:18 itojun Exp $
3.\"
4.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
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.
18.\"
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
29.\" SUCH DAMAGE.
30.\"
31.Dd March 6, 2000
32.Dt STF 4
33.Os
34.Sh NAME
35.Nm stf
36.Nd
37.Tn 6to4
38tunnel interface
39.Sh SYNOPSIS
40.Cd "device stf"
41.Sh DESCRIPTION
42The
43.Nm
44interface supports
45.Dq 6to4
46IPv6 in IPv4 encapsulation.
47It can tunnel IPv6 traffic over IPv4, as specified in
48.Li draft-ietf-ngtrans-6to4-06.txt .
49.Pp
50For ordinary nodes in 6to4 site, you do not need
51.Nm
52interface.
53The
54.Nm
55interface is necessary for site border router
56.Po
57called
58.Dq 6to4 router
59in the specification
60.Pc .
61.Pp
62Due to the way 6to4 protocol is specified,
63.Nm
64interface requires certain configuration to work properly.
65Single
66.Pq no more than 1
67valid 6to4 address needs to be configured to the interface.
68.Dq A valid 6to4 address
69is an address which has the following properties.
70If any of the following properties are not satisfied,
71.Nm
72raises runtime error on packet transmission.
73Read the specification for more details.
74.Bl -bullet
75.It
76matches
77.Li 2002:xxyy:zzuu::/48
78where
79.Li xxyy:zzuu
80is a hexadecimal notation of an IPv4 address for the node.
81IPv4 address can be taken from any of interfaces your node has.
82Since the specification forbids the use of IPv4 private address,
83the address needs to be a global IPv4 address.
84.It
85Subnet identifier portion
86.Pq 48th to 63rd bit
87and interface identifier portion
88.Pq lower 64 bits
89are properly filled to avoid address collisions.
90.El
91.Pp
92If you would like the node to behave as a relay router,
93the prefix length for the IPv6 interface address needs to be 16 so that
94the node would consider any 6to4 destination as
95.Dq on-link .
96If you would like to restrict 6to4 peers to be inside certain IPv4 prefix,
97you may want to configure IPv6 prefix length as
98.Dq 16 + IPv4 prefix length .
99.Nm
100interface will check the IPv4 source address on packets,
101if the IPv6 prefix length is larger than 16.
102.Pp
103.Nm
104can be configured to be ECN friendly.
105This can be configured by
106.Dv IFF_LINK1 .
107See
108.Xr gif 4
109for details.
110.Pp
111Please note that 6to4 specification is written as
112.Dq accept tunnelled packet from everyone
113tunnelling device.
114By enabling
115.Nm
116device, you are making it much easier for malicious parties to inject
117fabricated IPv6 packet to your node.
118Also, malicious party can inject an IPv6 packet with fabricated source address
119to make your node generate improper tunnelled packet.
120Administrators must take caution when enabling the interface.
121To prevent possible attacks,
122.Nm
123interface filters out the following packets.
124Note that the checks are no way complete:
125.Bl -bullet
126.It
127Packets with IPv4 unspecified addrss as outer IPv4 source/destination
128.Pq Li 0.0.0.0/8
129.It
130Packets with loopback address as outer IPv4 source/destination
131.Pq Li 127.0.0.0/8
132.It
133Packets with IPv4 multicast address as outer IPv4 source/destination
134.Pq Li 224.0.0.0/4
135.It
136Packets with limited broadcast address as outer IPv4 source/destination
137.Pq Li 255.0.0.0/8
138.It
139Packets with subnet broadcast address as outer IPv4 source/destination.
140The check is made against subnet broadcast addresses for
141all of the directly connected subnets.
142.It
143Packets that does not pass ingress filtering.
144Outer IPv4 source address must meet the IPv4 topology on the routing table.
145.It
146The same set of rules are appplied against the IPv4 address embedded into
147inner IPv6 address, if the IPv6 address matches 6to4 prefix.
148.El
149.Pp
150It is recommended to filter/audit
151incoming IPv4 packet with IP protocol number 41, as necessary.
152It is also recommended to filter/audit encapsulated IPv6 packets as well.
153You may also want to run normal ingress filter against inner IPv6 address
154to avoid spoofing.
155.\"
156.Sh EXAMPLES
157Note that
158.Li 8504:0506
159is equal to
160.Li 133.4.5.6 ,
161written in hexadecimals.
162.Bd -literal
163# ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
164# ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\
165	prefixlen 16 alias
166.Ed
167.Pp
168The following configuration accepts packets from IPv4 source
169.Li 9.1.0.0/16
170only.
171It emits 6to4 packet only for IPv6 destination 2002:0901::/32
172.Pq IPv4 destination will match Li 9.1.0.0/16 .
173.Bd -literal
174# ifconfig ne0 inet 9.1.2.3 netmask 0xffff0000
175# ifconfig stf0 inet6 2002:0901:0203:0000:a00:5aff:fe38:6f86 \\
176	prefixlen 32 alias
177.Ed
178.\"
179.Sh SEE ALSO
180.Xr gif 4 ,
181.Xr inet 4 ,
182.Xr inet6 4
183.Rs
184.%A Brian Carpenter
185.%A Keith Moore
186.%T "Connection of IPv6 Domains via IPv4 Clouds without Explicit Tunnels"
187.%D June 2000
188.%N draft-ietf-ngtrans-6to4-06.txt
189.%O work in progress
190.Re
191.Rs
192.%A Jun-ichiro itojun Hagino
193.%T "Possible abuse against IPv6 transition technologies"
194.%D March 2000
195.%N draft-itojun-ipv6-transition-abuse-00.txt
196.%O work in progress, http://playground.iijlab.net/i-d/draft-itojun-ipv6-transition-abuse-00.txt
197.Re
198.\"
199.Sh HISTORY
200The
201.Nm
202device first appeared in WIDE/KAME IPv6 stack.
203