Pull in a number of fixes from FreeBSD to fix at least the worst
[dragonfly.git] / share / man / man4 / faith.4
1 .\"     $KAME: faith.4,v 1.9 2001/04/27 17:26:35 itojun Exp $
2 .\"
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the project nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     $FreeBSD: src/share/man/man4/faith.4,v 1.6.2.4 2002/08/28 04:44:23 brooks Exp $
31 .\"     $DragonFly: src/share/man/man4/faith.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
32 .\"
33 .Dd April 10, 1999
34 .Dt FAITH 4
35 .Os
36 .Sh NAME
37 .Nm faith
38 .Nd IPv6-to-IPv4 TCP relay capturing interface
39 .Sh SYNOPSIS
40 .Cd "pseudo-device faith" Op Ar count
41 .Sh DESCRIPTION
42 The
43 .Nm
44 interface captures IPv6 TCP traffic,
45 for implementing userland IPv6-to-IPv4 TCP relay
46 like
47 .Xr faithd 8 .
48 .Pp
49 Each
50 .Nm
51 interface is created at runtime using interface cloning.
52 This is
53 most easily done with the
54 .Xr ifconfig 8
55 .Cm create
56 command or using the
57 .Va cloned_interfaces
58 variable in
59 .Xr rc.conf 5 .
60 .Pp
61 Special action will be taken when IPv6 TCP traffic is seen on a router,
62 and routing table suggests to route it to
63 .Nm
64 interface.
65 In this case, the packet will be accepted by the router,
66 regardless of list of IPv6 interface addresses assigned to the router.
67 The packet will be captured by an IPv6 TCP socket, if it has
68 .Dv IN6P_FAITH
69 flag turned on and it has matching address/port pairs.
70 In result,
71 .Nm
72 will let you capture IPv6 TCP traffic to some specific destination addresses.
73 Userland programs, such as
74 .Xr faithd 8
75 can use this behavior to relay IPv6 TCP traffic to IPv4 TCP traffic.
76 The program can accept some specific IPv6 TCP traffic, perform
77 .Xr getsockname 2
78 to get the IPv6 destination address specified by the client,
79 and perform application-specific address mapping to relay IPv6 TCP to IPv4 TCP.
80 .Pp
81 The
82 .Dv IN6P_FAITH
83 flag on IPv6 TCP socket can be set by using
84 .Xr setsockopt 2 ,
85 with level equals to
86 .Dv IPPROTO_IPV6
87 and optname equals to
88 .Dv IPv6_FAITH .
89 .Pp
90 To handle error reports by ICMPv6, some of ICMPv6 packets routed to
91 .Nm
92 interface will be delivered to IPv6 TCP, as well.
93 .Pp
94 To understand how
95 .Nm
96 can be used, take a look at source code of
97 .Xr faithd 8 .
98 .Pp
99 As
100 .Nm
101 interface implements potentially dangerous operation,
102 great care must be taken when configuring
103 .Nm
104 interface.
105 To avoid possible misuse,
106 .Xr sysctl 8
107 variable
108 .Li net.inet6.ip6.keepfaith
109 must be set to
110 .Li 1
111 prior to the use of the interface.
112 When
113 .Li net.inet6.ip6.keepfaith
114 is
115 .Li 0 ,
116 no packet will be captured by
117 .Nm
118 interface.
119 .Pp
120 .Nm
121 interface is intended to be used on routers, not on hosts.
122 .\"
123 .Sh SEE ALSO
124 .Xr inet 4 ,
125 .Xr inet6 4 ,
126 .Xr faithd 8
127 .Rs
128 .%A Jun-ichiro itojun Hagino
129 .%A Kazu Yamamoto
130 .%T "An IPv6-to-IPv4 transport relay translator"
131 .%R internet draft
132 .%N draft-ietf-ngtrans-tcpudp-relay-04.txt
133 .%O work in progress material
134 .Re
135 .Sh HISTORY
136 The FAITH IPv6-to-IPv4 TCP relay translator was first appeared in
137 WIDE hydrangea IPv6 stack.