xref: /dflybsd-src/share/man/man4/stf.4 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino.\"	$FreeBSD: src/share/man/man4/stf.4,v 1.3.2.5 2002/08/28 04:46:25 brooks Exp $
286d7f5d3SJohn Marino.\"	$DragonFly: src/share/man/man4/stf.4,v 1.4 2007/11/23 23:16:37 swildner Exp $
386d7f5d3SJohn Marino.\"     $KAME: stf.4,v 1.35 2001/05/02 06:24:49 itojun Exp $
486d7f5d3SJohn Marino.\"
586d7f5d3SJohn Marino.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
686d7f5d3SJohn Marino.\" All rights reserved.
786d7f5d3SJohn Marino.\"
886d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
986d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
1086d7f5d3SJohn Marino.\" are met:
1186d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
1286d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
1386d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
1486d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
1586d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
1686d7f5d3SJohn Marino.\" 3. Neither the name of the project nor the names of its contributors
1786d7f5d3SJohn Marino.\"    may be used to endorse or promote products derived from this software
1886d7f5d3SJohn Marino.\"    without specific prior written permission.
1986d7f5d3SJohn Marino.\"
2086d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2186d7f5d3SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2286d7f5d3SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2386d7f5d3SJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2486d7f5d3SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2586d7f5d3SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2686d7f5d3SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2786d7f5d3SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2886d7f5d3SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2986d7f5d3SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3086d7f5d3SJohn Marino.\" SUCH DAMAGE.
3186d7f5d3SJohn Marino.\"
3286d7f5d3SJohn Marino.Dd April 27, 2001
3386d7f5d3SJohn Marino.Dt STF 4
3486d7f5d3SJohn Marino.Os
3586d7f5d3SJohn Marino.Sh NAME
3686d7f5d3SJohn Marino.Nm stf
3786d7f5d3SJohn Marino.Nd
3886d7f5d3SJohn Marino.Tn 6to4
3986d7f5d3SJohn Marinotunnel interface
4086d7f5d3SJohn Marino.Sh SYNOPSIS
4186d7f5d3SJohn Marino.Cd "pseudo-device stf"
4286d7f5d3SJohn Marino.Sh DESCRIPTION
4386d7f5d3SJohn MarinoThe
4486d7f5d3SJohn Marino.Nm
4586d7f5d3SJohn Marinointerface supports
4686d7f5d3SJohn Marino.Dq 6to4
4786d7f5d3SJohn MarinoIPv6 in IPv4 encapsulation.
4886d7f5d3SJohn MarinoIt can tunnel IPv6 traffic over IPv4, as specified in
4986d7f5d3SJohn Marino.Li RFC 3056 .
5086d7f5d3SJohn Marino.Pp
5186d7f5d3SJohn MarinoFor ordinary nodes in 6to4 site, you do not need
5286d7f5d3SJohn Marino.Nm
5386d7f5d3SJohn Marinointerface.
5486d7f5d3SJohn MarinoThe
5586d7f5d3SJohn Marino.Nm
5686d7f5d3SJohn Marinointerface is necessary for site border router
5786d7f5d3SJohn Marino(called
5886d7f5d3SJohn Marino.Dq 6to4 router
5986d7f5d3SJohn Marinoin the specification).
6086d7f5d3SJohn Marino.Pp
6186d7f5d3SJohn MarinoEach
6286d7f5d3SJohn Marino.Nm
6386d7f5d3SJohn Marinointerface is created at runtime using interface cloning.
6486d7f5d3SJohn MarinoThis is
6586d7f5d3SJohn Marinomost easily done with the
6686d7f5d3SJohn Marino.Xr ifconfig 8
6786d7f5d3SJohn Marino.Cm create
6886d7f5d3SJohn Marinocommand or using the
6986d7f5d3SJohn Marino.Va cloned_interfaces
7086d7f5d3SJohn Marinovariable in
7186d7f5d3SJohn Marino.Xr rc.conf 5 .
7286d7f5d3SJohn Marino.Pp
7386d7f5d3SJohn MarinoDue to the way 6to4 protocol is specified,
7486d7f5d3SJohn Marino.Nm
7586d7f5d3SJohn Marinointerface requires certain configuration to work properly.
7686d7f5d3SJohn MarinoSingle
7786d7f5d3SJohn Marino(no more than 1)
7886d7f5d3SJohn Marinovalid 6to4 address needs to be configured to the interface.
7986d7f5d3SJohn Marino.Dq A valid 6to4 address
8086d7f5d3SJohn Marinois an address which has the following properties.
8186d7f5d3SJohn MarinoIf any of the following properties are not satisfied,
8286d7f5d3SJohn Marino.Nm
8386d7f5d3SJohn Marinoraises runtime error on packet transmission.
8486d7f5d3SJohn MarinoRead the specification for more details.
8586d7f5d3SJohn Marino.Bl -bullet
8686d7f5d3SJohn Marino.It
8786d7f5d3SJohn Marinomatches
8886d7f5d3SJohn Marino.Li 2002:xxyy:zzuu::/48
8986d7f5d3SJohn Marinowhere
9086d7f5d3SJohn Marino.Li xxyy:zzuu
9186d7f5d3SJohn Marinois a hexadecimal notation of an IPv4 address for the node.
9286d7f5d3SJohn MarinoIPv4 address can be taken from any of interfaces your node has.
9386d7f5d3SJohn MarinoSince the specification forbids the use of IPv4 private address,
9486d7f5d3SJohn Marinothe address needs to be a global IPv4 address.
9586d7f5d3SJohn Marino.It
9686d7f5d3SJohn MarinoSubnet identifier portion
9786d7f5d3SJohn Marino(48th to 63rd bit)
9886d7f5d3SJohn Marinoand interface identifier portion
9986d7f5d3SJohn Marino(lower 64 bits)
10086d7f5d3SJohn Marinoare properly filled to avoid address collisions.
10186d7f5d3SJohn Marino.El
10286d7f5d3SJohn Marino.Pp
10386d7f5d3SJohn MarinoIf you would like the node to behave as a relay router,
10486d7f5d3SJohn Marinothe prefix length for the IPv6 interface address needs to be 16 so that
10586d7f5d3SJohn Marinothe node would consider any 6to4 destination as
10686d7f5d3SJohn Marino.Dq on-link .
10786d7f5d3SJohn MarinoIf you would like to restrict 6to4 peers to be inside certain IPv4 prefix,
10886d7f5d3SJohn Marinoyou may want to configure IPv6 prefix length as
10986d7f5d3SJohn Marino.Dq 16 + IPv4 prefix length .
11086d7f5d3SJohn Marino.Nm
11186d7f5d3SJohn Marinointerface will check the IPv4 source address on packets,
11286d7f5d3SJohn Marinoif the IPv6 prefix length is larger than 16.
11386d7f5d3SJohn Marino.Pp
11486d7f5d3SJohn Marino.Nm
11586d7f5d3SJohn Marinocan be configured to be ECN friendly.
11686d7f5d3SJohn MarinoThis can be configured by
11786d7f5d3SJohn Marino.Dv IFF_LINK1 .
11886d7f5d3SJohn MarinoSee
11986d7f5d3SJohn Marino.Xr gif 4
12086d7f5d3SJohn Marinofor details.
12186d7f5d3SJohn Marino.Pp
12286d7f5d3SJohn MarinoPlease note that 6to4 specification is written as
12386d7f5d3SJohn Marino.Dq accept tunnelled packet from everyone
12486d7f5d3SJohn Marinotunnelling device.
12586d7f5d3SJohn MarinoBy enabling
12686d7f5d3SJohn Marino.Nm
12786d7f5d3SJohn Marinodevice, you are making it much easier for malicious parties to inject
12886d7f5d3SJohn Marinofabricated IPv6 packet to your node.
12986d7f5d3SJohn MarinoAlso, malicious party can inject an IPv6 packet with fabricated source address
13086d7f5d3SJohn Marinoto make your node generate improper tunnelled packet.
13186d7f5d3SJohn MarinoAdministrators must take caution when enabling the interface.
13286d7f5d3SJohn MarinoTo prevent possible attacks,
13386d7f5d3SJohn Marino.Nm
13486d7f5d3SJohn Marinointerface filters out the following packets.
13586d7f5d3SJohn MarinoNote that the checks are no way complete:
13686d7f5d3SJohn Marino.Bl -bullet
13786d7f5d3SJohn Marino.It
13886d7f5d3SJohn MarinoPackets with IPv4 unspecified address as outer IPv4 source/destination
13986d7f5d3SJohn Marino.Pq Li 0.0.0.0/8
14086d7f5d3SJohn Marino.It
14186d7f5d3SJohn MarinoPackets with loopback address as outer IPv4 source/destination
14286d7f5d3SJohn Marino.Pq Li 127.0.0.0/8
14386d7f5d3SJohn Marino.It
14486d7f5d3SJohn MarinoPackets with IPv4 multicast address as outer IPv4 source/destination
14586d7f5d3SJohn Marino.Pq Li 224.0.0.0/4
14686d7f5d3SJohn Marino.It
14786d7f5d3SJohn MarinoPackets with limited broadcast address as outer IPv4 source/destination
14886d7f5d3SJohn Marino.Pq Li 255.0.0.0/8
14986d7f5d3SJohn Marino.It
15086d7f5d3SJohn MarinoPackets with subnet broadcast address as outer IPv4 source/destination.
15186d7f5d3SJohn MarinoThe check is made against subnet broadcast addresses for
15286d7f5d3SJohn Marinoall of the directly connected subnets.
15386d7f5d3SJohn Marino.It
15486d7f5d3SJohn MarinoPackets that does not pass ingress filtering.
15586d7f5d3SJohn MarinoOuter IPv4 source address must meet the IPv4 topology on the routing table.
15686d7f5d3SJohn MarinoIngress filter can be turned off by
15786d7f5d3SJohn Marino.Dv IFF_LINK2
15886d7f5d3SJohn Marinobit.
15986d7f5d3SJohn Marino.It
16086d7f5d3SJohn MarinoThe same set of rules are applied against the IPv4 address embedded into
16186d7f5d3SJohn Marinoinner IPv6 address, if the IPv6 address matches 6to4 prefix.
16286d7f5d3SJohn Marino.El
16386d7f5d3SJohn Marino.Pp
16486d7f5d3SJohn MarinoIt is recommended to filter/audit
16586d7f5d3SJohn Marinoincoming IPv4 packet with IP protocol number 41, as necessary.
16686d7f5d3SJohn MarinoIt is also recommended to filter/audit encapsulated IPv6 packets as well.
16786d7f5d3SJohn MarinoYou may also want to run normal ingress filter against inner IPv6 address
16886d7f5d3SJohn Marinoto avoid spoofing.
16986d7f5d3SJohn Marino.Pp
17086d7f5d3SJohn MarinoBy setting the
17186d7f5d3SJohn Marino.Dv IFF_LINK0
17286d7f5d3SJohn Marinoflag on the
17386d7f5d3SJohn Marino.Nm
17486d7f5d3SJohn Marinointerface, it is possible to disable the input path,
17586d7f5d3SJohn Marinomaking the direct attacks from the outside impossible.
17686d7f5d3SJohn MarinoNote, however, there are other security risks exist.
17786d7f5d3SJohn MarinoIf you wish to use the configuration,
17886d7f5d3SJohn Marinoyou must not advertise your 6to4 address to others.
17986d7f5d3SJohn Marino.\"
18086d7f5d3SJohn Marino.Sh EXAMPLES
18186d7f5d3SJohn MarinoNote that
18286d7f5d3SJohn Marino.Li 8504:0506
18386d7f5d3SJohn Marinois equal to
18486d7f5d3SJohn Marino.Li 133.4.5.6 ,
18586d7f5d3SJohn Marinowritten in hexadecimals.
18686d7f5d3SJohn Marino.Bd -literal
18786d7f5d3SJohn Marino# ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
18886d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\
18986d7f5d3SJohn Marino	prefixlen 16 alias
19086d7f5d3SJohn Marino.Ed
19186d7f5d3SJohn Marino.Pp
19286d7f5d3SJohn MarinoThe following configuration accepts packets from IPv4 source
19386d7f5d3SJohn Marino.Li 9.1.0.0/16
19486d7f5d3SJohn Marinoonly.
19586d7f5d3SJohn MarinoIt emits 6to4 packet only for IPv6 destination 2002:0901::/32
19686d7f5d3SJohn Marino(IPv4 destination will match
19786d7f5d3SJohn Marino.Li 9.1.0.0/16 ) .
19886d7f5d3SJohn Marino.Bd -literal
19986d7f5d3SJohn Marino# ifconfig ne0 inet 9.1.2.3 netmask 0xffff0000
20086d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:0901:0203:0000:a00:5aff:fe38:6f86 \\
20186d7f5d3SJohn Marino	prefixlen 32 alias
20286d7f5d3SJohn Marino.Ed
20386d7f5d3SJohn Marino.Pp
20486d7f5d3SJohn MarinoThe following configuration uses the
20586d7f5d3SJohn Marino.Nm
20686d7f5d3SJohn Marinointerface as an output-only device.
20786d7f5d3SJohn MarinoYou need to have alternative IPv6 connectivity
20886d7f5d3SJohn Marino(other than 6to4)
20986d7f5d3SJohn Marinoto use this configuration.
21086d7f5d3SJohn MarinoFor outbound traffic, you can reach other 6to4 networks efficiently via
21186d7f5d3SJohn Marino.Nm .
21286d7f5d3SJohn MarinoFor inbound traffic, you will not receive any 6to4-tunneled packets
21386d7f5d3SJohn Marino(less security drawbacks).
21486d7f5d3SJohn MarinoBe careful not to advertise your 6to4 prefix to others
21586d7f5d3SJohn Marino.Pq Li 2002:8504:0506::/48 ,
21686d7f5d3SJohn Marinoand not to use your 6to4 prefix as a source.
21786d7f5d3SJohn Marino.Bd -literal
21886d7f5d3SJohn Marino# ifconfig ne0 inet 133.4.5.6 netmask 0xffffff00
21986d7f5d3SJohn Marino# ifconfig stf0 inet6 2002:8504:0506:0000:a00:5aff:fe38:6f86 \\
22086d7f5d3SJohn Marino	prefixlen 16 alias deprecated link0
22186d7f5d3SJohn Marino# route add -inet6 2002:: -prefixlen 16 ::1
22286d7f5d3SJohn Marino# route change -inet6 2002:: -prefixlen 16 ::1 -ifp stf0
22386d7f5d3SJohn Marino.Ed
22486d7f5d3SJohn Marino.\"
22586d7f5d3SJohn Marino.Sh SEE ALSO
22686d7f5d3SJohn Marino.Xr gif 4 ,
22786d7f5d3SJohn Marino.Xr inet 4 ,
22886d7f5d3SJohn Marino.Xr inet6 4
22986d7f5d3SJohn Marino.Pp
23086d7f5d3SJohn Marino.Pa http://www.6bone.net/6bone_6to4.html
23186d7f5d3SJohn Marino.Rs
23286d7f5d3SJohn Marino.%A Brian Carpenter
23386d7f5d3SJohn Marino.%A Keith Moore
23486d7f5d3SJohn Marino.%T "Connection of IPv6 Domains via IPv4 Clouds"
23586d7f5d3SJohn Marino.%D February 2001
23686d7f5d3SJohn Marino.%R RFC
23786d7f5d3SJohn Marino.%N 3056
23886d7f5d3SJohn Marino.Re
23986d7f5d3SJohn Marino.Rs
24086d7f5d3SJohn Marino.%A Jun-ichiro itojun Hagino
24186d7f5d3SJohn Marino.%T "Possible abuse against IPv6 transition technologies"
24286d7f5d3SJohn Marino.%D July 2000
24386d7f5d3SJohn Marino.%N draft-itojun-ipv6-transition-abuse-01.txt
24486d7f5d3SJohn Marino.%O work in progress
24586d7f5d3SJohn Marino.Re
24686d7f5d3SJohn Marino.\"
24786d7f5d3SJohn Marino.Sh HISTORY
24886d7f5d3SJohn MarinoThe
24986d7f5d3SJohn Marino.Nm
25086d7f5d3SJohn Marinodevice first appeared in WIDE/KAME IPv6 stack.
25186d7f5d3SJohn Marino.\"
25286d7f5d3SJohn Marino.Sh BUGS
25386d7f5d3SJohn MarinoNo more than one
25486d7f5d3SJohn Marino.Nm
25586d7f5d3SJohn Marinointerface is allowed for a node,
25686d7f5d3SJohn Marinoand no more than one IPv6 interface address is allowed for an
25786d7f5d3SJohn Marino.Nm
25886d7f5d3SJohn Marinointerface.
25986d7f5d3SJohn MarinoIt is to avoid source address selection conflicts
26086d7f5d3SJohn Marinobetween IPv6 layer and IPv4 layer,
26186d7f5d3SJohn Marinoand to cope with ingress filtering rule on the other side.
26286d7f5d3SJohn MarinoThis is a feature to make
26386d7f5d3SJohn Marino.Nm
26486d7f5d3SJohn Marinowork right for all occasions.
265