1.\" $NetBSD: faith.4,v 1.14 2010/01/15 19:24:49 joerg Exp $ 2.\" $KAME: faith.4,v 1.10 2001/06/30 00:42:48 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 January 9, 2010 32.Dt FAITH 4 33.Os 34.Sh NAME 35.Nm faith 36.Nd IPv6-to-IPv4 TCP relay capturing interface 37.Sh SYNOPSIS 38.Cd "pseudo-device faith" 39.Sh DESCRIPTION 40The 41.Nm 42interface captures IPv6 TCP traffic, 43for implementing userland IPv6-to-IPv4 TCP relay 44like 45.Xr faithd 8 . 46.Pp 47.Nm 48interfaces are dynamically created and destroyed with the 49.Xr ifconfig 8 50.Cm create 51and 52.Cm destroy 53subcommands. 54.Pp 55Special action will be taken when IPv6 TCP traffic is seen on a router, 56and the routing table suggests to route it to the 57.Nm 58interface. 59In this case, the packet will be accepted by the router, 60regardless of the list of IPv6 interface addresses assigned to the router. 61The packet will be captured by an IPv6 TCP socket, if it has the 62.Dv IN6P_FAITH 63flag turned on and matching address/port pairs. 64As a result, 65.Nm 66will let you capture IPv6 TCP traffic to some specific destination addresses. 67Userland programs, such as 68.Xr faithd 8 69can use this behavior to relay IPv6 TCP traffic to IPv4 TCP traffic. 70The program can accept some specific IPv6 TCP traffic, perform 71.Xr getsockname 2 72to get the IPv6 destination address specified by the client, 73and perform application-specific address mapping to relay IPv6 TCP to IPv4 TCP. 74.Pp 75.Dv IN6P_FAITH 76flag on an IPv6 TCP socket can be set by using 77.Xr setsockopt 2 , 78with level 79.Dv IPPROTO_IPV6 80and optname 81.Dv IPv6_FAITH . 82.Pp 83To handle error reports by ICMPv6, some ICMPv6 packets routed to an 84.Nm 85interface will be delivered to IPv6 TCP, as well. 86.Pp 87To understand how 88.Nm 89can be used, take a look at the source code of 90.Xr faithd 8 . 91.Pp 92As the 93.Nm 94interface implements potentially dangerous operations, 95great care must be taken when configuring it. 96To avoid possible misuse, the 97.Xr sysctl 8 98variable 99.Li net.inet6.ip6.keepfaith 100must be set to 101.Li 1 102prior to using the interface. 103When 104.Li net.inet6.ip6.keepfaith 105is 106.Li 0 , 107no packets will be captured by the 108.Nm 109interface. 110.Pp 111The 112.Nm 113interface is intended to be used on routers, not on hosts. 114.\" 115.Sh SEE ALSO 116.Xr inet 4 , 117.Xr inet6 4 , 118.Xr faithd 8 119.Rs 120.%A Jun-ichiro itojun Hagino 121.%A Kazu Yamamoto 122.%T "An IPv6-to-IPv4 transport relay translator" 123.%B RFC 3142 124.%U ftp://ftp.isi.edu/in-notes/rfc3142.txt 125.%D June 2001 126.Re 127.Sh HISTORY 128The FAITH IPv6-to-IPv4 TCP relay translator first appeared in the 129WIDE hydrangea IPv6 stack. 130