[BACK]Return to README CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.sbin / faithd

File: [cvs.NetBSD.org] / src / usr.sbin / faithd / README (download)

Revision 1.13, Wed Nov 12 13:31:44 2003 UTC (11 years, 1 month ago) by grant
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-base, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, mjf-devfs2-base, mjf-devfs2, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-premerge-20101231, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, abandoned-netbsd-4-base, abandoned-netbsd-4, HEAD
Changes since 1.12: +2 -1 lines

fix a typo

Configuring FAITH IPv6-to-IPv4 TCP relay

Kazu Yamamoto and Jun-ichiro itojun Hagino
$KAME: README,v 1.9 2002/05/09 14:10:06 itojun Exp $


Introduction
============

FAITH is a IPv6-to-IPv4 TCP relay.  It performs tcp relay just as some of
firewall-oriented gateway does, but between IPv6 and IPv4 with address
translation.
TCP connections has to be made from IPv6 node to IPv4 node.  FAITH will
not relay connections for the opposite direction.
To perform relays, FAITH daemon needs to be executed on a router between
your local IPv6 site and outside IPv4 network.  The daemon needs to be
invoked per each TCP services (TCP port number).

	IPv4 node "dest" = 123.4.5.6
		|
	[[[[ outside IPv4 ocean ]]]]
		|
	node that runs FAITH-daemon (usually a router)
		|
	==+=====+===+==== IPv6, or IPv4/v6 network in your site ^
	  |	    |						| connection
	clients	  IPv6 node "src"				|

You will have to allocate an IPv6 address prefix to map IPv4 addresses into.
The following description uses 3ffe:0501:ffff:0000:: as example.
Please use a prefix which belongs to your site.
FAITH will make it possible to make a IPv6 TCP connection From IPv6 node
"src", toward IPv4 node "dest", by specifying FAITH-mapped address
3ffe:0501:ffff:0000::123.4.5.6
(which is, 3ffe:0501:ffff:0000:0000:0000:7b04:0506).
The address mapping can be performed by hand:-), by special nameserver on
the network, or by special resolver on the source node.


Setup
=====

The following example assumes:
- You have assigned 3ffe:0501:ffff:0000:: as FAITH adderss prefix.
- You are willing to provide IPv6-to IPv4 TCP relay for telnet.

<<On the translating router on which faithd runs>>

(1) If you have IPv6 TCP server for the "telnet" service, i.e. telnetd via
    inet6d, disable that daemon.  Comment out the line from "inet6d.conf"
    and send the HUP signal to "inet6d".

(2) Execute sysctl as root to enable FAITH support in the kernel.

        # sysctl -w net.inet6.ip6.keepfaith=1

(3) Route packets toward FAITH prefix into "faith0" interface.

	# ifconfig faith0 up
	# route add -inet6 3ffe:0501:ffff:0000:: -prefixlen 64 ::1
	# route change -inet6 3ffe:0501:ffff:0000:: -prefixlen 64 -ifp faith0

(4) Execute "faithd" by root as follows:

	# faithd telnet /usr/libexec/telnetd telnetd

    1st argument is a service name you are willing to provide TCP relay.
	(it can be specified either by number "23" or by string "telnet")
    2nd argument is a path name for local IPv6 TCP server.  If there is a
    connection toward the router itself, this program will be invoked.
    3rd and the following arguments are arguments for the local IPv6 TCP
    server.  (3rd argument is typically the program name without its path.)

    More examples:

	# faithd ftpd /usr/libexec/ftpd ftpd -l
	# faithd sshd

If inetd(8) on your platform have special support for faithd, it is possible
to setup faithd services via inetd(8).  Consult manpage for details.


<<Routing>>

(4) Make sure that packets whose destinations match the prefix can
reach from the IPv6 host to the translating router.

<<On the IPv6 host>>

There are two ways to translate IPv4 address to IPv6 address:
	(a) Faked by DNS
	(b) Faked by /etc/hosts.

(5.a) Install "newbie" and set up FAITH mode. See kit/ports/newbie.

(5.b) Add an entry into /etc/hosts so that you can resolve hostname into
faked IPv6 address.  For example, add the following line for
www.NetBSD.org:

	3ffe:0501:ffff:0000::140.160.140.252	www.NetBSD.org

<<On the translating router on which faithd runs.>>

(6) To see if "faithd" works, watch "/var/log/daemon". Note: please
setup "/etc/syslog.conf" so that LOG_DAEMON messages are to be stored
in "/var/log/daemon".

	<e.g.>
	daemon.*   /var/log/daemon


Access control
==============

Since faithd implements TCP relaying service, it is critical to implement
proper access control to cope with malicious use.  Bad guy may try to
use your relay router to circumvent access controls, or may try to
abuse your network (like sending SPAMs from IPv4 address that belong to you).
Install IPv6 packet filter directives that would reject traffic from
unwanted source.  If you are using inetd-based setup, you may be able to
use access control mechanisms in inetd.


Advanced configuration
======================

If you would like to restrict IPv4 destination for translation, you may
want to do the following:

	# route add -inet6 3ffe:0501:ffff:0000::123.0.0.0 -prefixlen 104 ::1
	# route change -inet6 3ffe:0501:ffff:0000::123.0.0.0 -prefixlen 104 \
		-ifp faith0

By this way, you can restrict IPv4 destination to 123.0.0.0/8.
You may also want to reject packets toward 3ffe:0501:ffff:0000::/64 which
is not in 3ffe:0501:ffff:0000::123.0.0.0/104.  This will be left as excerside
for the reader.

By doing this, you will be able to provide your IPv4 web server to outside
IPv6 customers, without risks of unwanted open relays.

	[[[[ IPv6 network outside ]]]]			|
		|					| connection
	node that runs FAITH-daemon (usually a router)	v
		|
	========+======== IPv4/v6 network in your site
		|			(123.0.0.0/8)
	IPv4 web server