2001-06-11 12:39:29 +00:00
|
|
|
.\" $KAME: faith.4,v 1.9 2001/04/27 17:26:35 itojun Exp $
|
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
|
|
|
.\" All rights reserved.
|
2001-05-01 09:15:30 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. Neither the name of the project nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
2001-05-01 09:15:30 +00:00
|
|
|
.\"
|
2000-01-06 12:40:54 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
2005-02-09 18:07:17 +00:00
|
|
|
.\" $FreeBSD$
|
2000-01-06 12:40:54 +00:00
|
|
|
.\"
|
2012-02-17 02:39:58 +00:00
|
|
|
.Dd January 23, 2012
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dt FAITH 4
|
2000-01-17 15:24:41 +00:00
|
|
|
.Os
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm faith
|
2001-06-11 12:39:29 +00:00
|
|
|
.Nd IPv6-to-IPv4 TCP relay capturing interface
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-09-25 18:40:52 +00:00
|
|
|
.Cd "device faith"
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2001-06-11 12:39:29 +00:00
|
|
|
interface captures IPv6 TCP traffic,
|
|
|
|
for implementing userland IPv6-to-IPv4 TCP relay
|
2000-01-06 12:40:54 +00:00
|
|
|
like
|
2000-03-15 03:33:30 +00:00
|
|
|
.Xr faithd 8 .
|
2000-01-06 12:40:54 +00:00
|
|
|
.Pp
|
2002-05-29 06:55:06 +00:00
|
|
|
Each
|
|
|
|
.Nm
|
|
|
|
interface is created at runtime using interface cloning.
|
|
|
|
This is
|
|
|
|
most easily done with the
|
|
|
|
.Xr ifconfig 8
|
|
|
|
.Cm create
|
|
|
|
command or using the
|
|
|
|
.Va cloned_interfaces
|
|
|
|
variable in
|
|
|
|
.Xr rc.conf 5 .
|
|
|
|
.Pp
|
2001-06-11 12:39:29 +00:00
|
|
|
Special action will be taken when IPv6 TCP traffic is seen on a router,
|
2012-02-17 02:39:58 +00:00
|
|
|
and the default routing table suggests to route it to the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
|
|
|
interface.
|
2001-06-11 12:39:29 +00:00
|
|
|
In this case, the packet will be accepted by the router,
|
2010-01-09 00:24:54 +00:00
|
|
|
regardless of the list of IPv6 interface addresses assigned to the router.
|
|
|
|
The packet will be captured by an IPv6 TCP socket, if it has the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv IN6P_FAITH
|
2010-01-09 00:24:54 +00:00
|
|
|
flag turned on and matching address/port pairs.
|
|
|
|
As a result,
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2001-06-11 12:39:29 +00:00
|
|
|
will let you capture IPv6 TCP traffic to some specific destination addresses.
|
2000-01-06 12:40:54 +00:00
|
|
|
Userland programs, such as
|
2001-06-11 12:39:29 +00:00
|
|
|
.Xr faithd 8
|
2000-01-06 12:40:54 +00:00
|
|
|
can use this behavior to relay IPv6 TCP traffic to IPv4 TCP traffic.
|
|
|
|
The program can accept some specific IPv6 TCP traffic, perform
|
2000-03-07 14:04:44 +00:00
|
|
|
.Xr getsockname 2
|
2000-01-06 12:40:54 +00:00
|
|
|
to get the IPv6 destination address specified by the client,
|
|
|
|
and perform application-specific address mapping to relay IPv6 TCP to IPv4 TCP.
|
|
|
|
.Pp
|
2000-01-17 13:03:58 +00:00
|
|
|
The
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv IN6P_FAITH
|
2010-01-09 00:24:54 +00:00
|
|
|
flag on a IPv6 TCP socket can be set by using
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr setsockopt 2 ,
|
2010-01-09 00:24:54 +00:00
|
|
|
with level
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv IPPROTO_IPV6
|
2010-01-09 00:24:54 +00:00
|
|
|
and optname
|
2000-01-06 12:40:54 +00:00
|
|
|
.Dv IPv6_FAITH .
|
|
|
|
.Pp
|
2010-01-09 00:24:54 +00:00
|
|
|
To handle error reports by ICMPv6, some ICMPv6 packets routed to an
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2001-06-11 12:39:29 +00:00
|
|
|
interface will be delivered to IPv6 TCP, as well.
|
2000-01-06 12:40:54 +00:00
|
|
|
.Pp
|
|
|
|
To understand how
|
|
|
|
.Nm
|
2010-01-09 00:24:54 +00:00
|
|
|
can be used, take a look at the source code of
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr faithd 8 .
|
|
|
|
.Pp
|
2010-01-09 00:24:54 +00:00
|
|
|
As the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
2010-01-09 00:24:54 +00:00
|
|
|
interface implements potentially dangerous operations,
|
|
|
|
great care must be taken when configuring it.
|
|
|
|
To avoid possible misuse, the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Xr sysctl 8
|
|
|
|
variable
|
|
|
|
.Li net.inet6.ip6.keepfaith
|
|
|
|
must be set to
|
|
|
|
.Li 1
|
2010-01-09 00:24:54 +00:00
|
|
|
prior to using the interface.
|
2000-01-06 12:40:54 +00:00
|
|
|
When
|
|
|
|
.Li net.inet6.ip6.keepfaith
|
2001-06-11 12:39:29 +00:00
|
|
|
is
|
2000-01-06 12:40:54 +00:00
|
|
|
.Li 0 ,
|
2010-01-09 00:24:54 +00:00
|
|
|
no packets will be captured by the
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
|
|
|
interface.
|
|
|
|
.Pp
|
2010-01-09 00:24:54 +00:00
|
|
|
The
|
2000-01-06 12:40:54 +00:00
|
|
|
.Nm
|
|
|
|
interface is intended to be used on routers, not on hosts.
|
|
|
|
.\"
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr inet 4 ,
|
|
|
|
.Xr inet6 4 ,
|
2000-01-17 13:03:58 +00:00
|
|
|
.Xr faithd 8
|
2001-06-11 12:39:29 +00:00
|
|
|
.Rs
|
|
|
|
.%A Jun-ichiro itojun Hagino
|
|
|
|
.%A Kazu Yamamoto
|
|
|
|
.%T "An IPv6-to-IPv4 transport relay translator"
|
2005-04-21 13:27:13 +00:00
|
|
|
.%O RFC3142
|
2001-06-11 12:39:29 +00:00
|
|
|
.Re
|
2000-01-06 12:40:54 +00:00
|
|
|
.Sh HISTORY
|
2010-01-09 00:24:54 +00:00
|
|
|
The FAITH IPv6-to-IPv4 TCP relay translator first appeared in the
|
2000-01-06 12:40:54 +00:00
|
|
|
WIDE hydrangea IPv6 stack.
|