Initial import from FreeBSD RELENG_4:
[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 .\"
32 .Dd April 10, 1999
33 .Dt FAITH 4
34 .Os
35 .Sh NAME
36 .Nm faith
37 .Nd IPv6-to-IPv4 TCP relay capturing interface
38 .Sh SYNOPSIS
39 .Cd "pseudo-device faith" Op Ar count
40 .Sh DESCRIPTION
41 The
42 .Nm
43 interface captures IPv6 TCP traffic,
44 for implementing userland IPv6-to-IPv4 TCP relay
45 like
46 .Xr faithd 8 .
47 .Pp
48 Each
49 .Nm
50 interface is created at runtime using interface cloning.
51 This is
52 most easily done with the
53 .Xr ifconfig 8
54 .Cm create
55 command or using the
56 .Va cloned_interfaces
57 variable in
58 .Xr rc.conf 5 .
59 .Pp
60 Special action will be taken when IPv6 TCP traffic is seen on a router,
61 and routing table suggests to route it to
62 .Nm
63 interface.
64 In this case, the packet will be accepted by the router,
65 regardless of list of IPv6 interface addresses assigned to the router.
66 The packet will be captured by an IPv6 TCP socket, if it has
67 .Dv IN6P_FAITH
68 flag turned on and it has matching address/port pairs.
69 In result,
70 .Nm
71 will let you capture IPv6 TCP traffic to some specific destination addresses.
72 Userland programs, such as
73 .Xr faithd 8
74 can use this behavior to relay IPv6 TCP traffic to IPv4 TCP traffic.
75 The program can accept some specific IPv6 TCP traffic, perform
76 .Xr getsockname 2
77 to get the IPv6 destination address specified by the client,
78 and perform application-specific address mapping to relay IPv6 TCP to IPv4 TCP.
79 .Pp
80 The
81 .Dv IN6P_FAITH
82 flag on IPv6 TCP socket can be set by using
83 .Xr setsockopt 2 ,
84 with level equals to
85 .Dv IPPROTO_IPV6
86 and optname equals to
87 .Dv IPv6_FAITH .
88 .Pp
89 To handle error reports by ICMPv6, some of ICMPv6 packets routed to
90 .Nm
91 interface will be delivered to IPv6 TCP, as well.
92 .Pp
93 To understand how
94 .Nm
95 can be used, take a look at source code of
96 .Xr faithd 8 .
97 .Pp
98 As
99 .Nm
100 interface implements potentially dangerous operation,
101 great care must be taken when configuring
102 .Nm
103 interface.
104 To avoid possible misuse,
105 .Xr sysctl 8
106 variable
107 .Li net.inet6.ip6.keepfaith
108 must be set to
109 .Li 1
110 prior to the use of the interface.
111 When
112 .Li net.inet6.ip6.keepfaith
113 is
114 .Li 0 ,
115 no packet will be captured by
116 .Nm
117 interface.
118 .Pp
119 .Nm
120 interface is intended to be used on routers, not on hosts.
121 .\"
122 .Sh SEE ALSO
123 .Xr inet 4 ,
124 .Xr inet6 4 ,
125 .Xr faithd 8
126 .Rs
127 .%A Jun-ichiro itojun Hagino
128 .%A Kazu Yamamoto
129 .%T "An IPv6-to-IPv4 transport relay translator"
130 .%R internet draft
131 .%N draft-ietf-ngtrans-tcpudp-relay-04.txt
132 .%O work in progress material
133 .Re
134 .Sh HISTORY
135 The FAITH IPv6-to-IPv4 TCP relay translator was first appeared in
136 WIDE hydrangea IPv6 stack.