Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
FAITHD(8)               FreeBSD System Manager's Manual              FAITHD(8)

     faithd - FAITH IPv6/v4 translator daemon

     faithd [-dp] [-f configfile] service [serverpath [serverargs]]

     faithd provides IPv6-to-IPv4 TCP relay.  faithd must be used on an
     IPv4/v6 dual stack router.

     When faithd receives TCPv6 traffic, faithd will relay the TCPv6 traffic
     to TCPv4.  Destination for relayed TCPv4 connection will be determined by
     the last 4 octets of the original IPv6 destination.  For example, if
     3ffe:0501:4819:ffff:: is reserved for faithd, and the TCPv6 destination
     address is 3ffe:0501:4819:ffff::0a01:0101, the traffic will be relayed to
     IPv4 destination

     To use faithd translation service, an IPv6 address prefix must be
     reserved for mapping IPv4 addresses into.  Kernel must be properly
     configured to route all the TCP connection toward the reserved IPv6
     address prefix into the faith(4) pseudo interface, by using route(8)
     command.  Also, sysctl(8) should be used to configure
     net.inet6.ip6.keepfaith to 1.

     The router must be configured to capture all the TCP traffic toward
     reserved IPv6 address prefix, by using route(8) and sysctl(8) commands.

     faithd needs a special name-to-address translation logic, so that
     hostnames gets resolved into special IPv6 address prefix.  For small-
     scale installation, use hosts(5).  For large-scale installation, it is
     useful to have a DNS server with special address translation support.  An
     implementation called totd is available at  Make sure you
     do not propagate translated DNS records to normal DNS cloud, it is highly

   Daemon mode
     When faithd is invoked as a standalone program, faithd will daemonize
     itself.  faithd will listen to TCPv6 port service.  If TCPv6 traffic to
     port service is found, it relays the connection.

     Since faithd listens to TCP port service, it is not possible to run local
     TCP daemons for port service on the router, using inetd(8) or other
     standard mechanisms.  By specifying serverpath to faithd, you can run
     local daemons on the router.  faithd will invoke local daemon at
     serverpath if the destination address is local interface address, and
     will perform translation to IPv4 TCP in other cases.  You can also
     specify serverargs for the arguments for the local daemon.

     The following options are available:

     -d      Debugging information will be generated using syslog(3).

     -f configfile
             Specify a configuration file for access control.  See below.

     -p      Use privileged TCP port number as source port, for IPv4 TCP
             connection toward final destination.  For relaying ftp(1) and
             rlogin(1), this flag is not necessary as special program code is

     faithd will relay both normal and out-of-band TCP data.  It is capable of
     emulating TCP half close as well.  faithd includes special support for
     protocols used by ftp(1) and rlogin(1).  When translating FTP protocol,
     faithd translates network level addresses in PORT/LPRT/EPRT and
     PASV/LPSV/EPSV commands.  For RLOGIN protocol, faithd will relay back
     connection from rlogind(8) on the server to rlogin(1) on client.

     Inactive sessions will be disconnected in 30 minutes, to avoid stale
     sessions from chewing up resources.  This may be inappropriate for some
     of the services (should this be configurable?).

   inetd mode
     When faithd is invoked via inetd(8), faithd will handle connection passed
     from standard input.  If the connection endpoint is in the reserved IPv6
     address prefix, faithd will relay the connection.  Otherwise, faithd will
     invoke service-specific daemon like telnetd(8), by using the command
     argument passed from inetd(8).

     faithd determines operation mode by the local TCP port number, and
     enables special protocol handling whenever necessary/possible.  For
     example, if faithd is invoked via inetd(8) on FTP port, it will operate
     as a FTP relay.

     The operation mode requires special support for faithd in inetd(8).

   Access control
     To prevent malicious accesses, faithd implements a simple address-based
     access control.  With /etc/faithd.conf (or configfile specified by -f),
     faithd will avoid relaying unwanted traffic.  The faithd.conf contains
     directives with the following format:

     +o   src/slen deny dst/dlen

         If the source address of a query matches src/slen, and the translated
         destination address matches dst/dlen, deny the connection.

     +o   src/slen permit dst/dlen

         If the source address of a query matches src/slen, and the translated
         destination address matches dst/dlen, permit the connection.

     The directives are evaluated in sequence, and the first matching entry
     will be effective.

     With inetd mode, traffic may be filtered by using access control
     functionality in inetd(8).

     Before invoking faithd, faith(4) interface has to be configured properly.

     # sysctl net.inet6.ip6.accept_rtadv=0
     # sysctl net.inet6.ip6.forwarding=1
     # sysctl net.inet6.ip6.keepfaith=1
     # ifconfig faith0 up
     # route add -inet6 3ffe:501:4819:ffff:: -prefixlen 96 ::1
     # route change -inet6 3ffe:501:4819:ffff:: -prefixlen 96 -ifp faith0

   Daemon mode samples
     To translate telnet service, and provide no local telnet service, invoke
     faithd as follows:

     # faithd telnet

     If you would like to provide local telnet service via telnetd(8) on
     /usr/local/v6/libexec/telnetd, use the following command line:

     # faithd telnet /usr/local/v6/libexec/telnetd telnetd

     If you would like to pass extra arguments to the local daemon:

     # faithd ftp /usr/local/v6/libexec/ftpd ftpd -l

     Here are some other examples.  You may need -p to translate rsh/rlogin

     # faithd ssh
     # faithd login /usr/local/v6/libexec/rlogin rlogind
     # faithd shell /usr/local/v6/libexec/rshd rshd

     However, you should be careful when translating rlogin or rsh
     connections.  See SECURITY CONSIDERATIONS for more details.

   inetd mode samples
     Add the following lines into inetd.conf(5).  Syntax may vary depending
     upon your operating system.

     telnet  stream  tcp6/faith  nowait  root  /usr/sbin/faithd  telnetd
     ftp     stream  tcp6/faith  nowait  root  /usr/sbin/faithd  ftpd -l
     ssh     stream  tcp6/faith  nowait  root  /usr/sbin/faithd  /usr/sbin/sshd -i

     inetd(8) will open listening sockets with enabling kernel TCP relay
     support.  Whenever connection comes in, faithd will be invoked by
     inetd(8).  If it the connection endpoint is in the reserved IPv6 address
     prefix.  faithd will relay the connection.  Otherwise, faithd will invoke
     service-specific daemon like telnetd(8).

   Access control samples
     The following illustrates a simple faithd.conf setting.

     # permit anyone from 3ffe:501:ffff::/48 to use the translator,
     # to connect to the following IPv4 destinations:
     # - any location except and
     # Permit no other connections.
     3ffe:501:ffff::/48 deny
     3ffe:501:ffff::/48 deny
     3ffe:501:ffff::/48 permit

     faithd exits with EXIT_SUCCESS (0) on success, and EXIT_FAILURE (1) on

     faith(4), route(8), sysctl(8)

     Jun-ichiro itojun Hagino and Kazu Yamamoto, An IPv6-to-IPv4 transport
     relay translator, internet draft, draft-ietf-ngtrans-tcpudp-relay-04.txt,
     work in progress material.

     The faithd command first appeared in WIDE Hydrangea IPv6 protocol stack

     IPv6 and IPsec support based on the KAME Project (
     stack was initially integrated into FreeBSD 4.0

     It is very insecure to use rhosts(5) and other IP-address based
     authentication, for connections relayed by faithd (and any other TCP
     relaying services).

     Administrators are advised to limit accesses to faithd using faithd.conf,
     or by using IPv6 packet filters.  It is to protect faithd service from
     malicious parties and avoid theft of service/bandwidth.  IPv6 destination
     address can be limited by carefully configuring routing entries that
     points to faith(4), using route(8).  IPv6 source address needs to be
     filtered by using packet filters.  Documents listed in SEE ALSO have more
     discussions on this topic.

FreeBSD 11.0-PRERELEASE          May 17, 1998          FreeBSD 11.0-PRERELEASE


Want to link to this manual page? Use this URL:

home | help