README revision 1.5
11.1SitojunConfiguring FAITH IPv6-to-IPv4 TCP relay
21.1Sitojun
31.1SitojunKazu Yamamoto and Jun-ichiro itojun Hagino
41.5Sitojun$NetBSD: README,v 1.5 2000/02/25 10:05:01 itojun Exp $
51.4SitojunKAME Id: README,v 1.2 1999/12/21 01:37:06 itojun Exp
61.1Sitojun
71.1Sitojun
81.1SitojunIntroduction
91.1Sitojun============
101.1Sitojun
111.1SitojunFAITH is a IPv6-to-IPv4 TCP relay.  It performs tcp relay just as some of
121.1Sitojunfirewall-oriented gateway does, but between IPv6 and IPv4 with address
131.4Sitojuntranslation.
141.4SitojunTCP connections has to be made from IPv6 node to IPv4 node.  FAITH will
151.1Sitojunnot relay connections for the opposite direction.
161.1SitojunTo perform relays, FAITH daemon needs to be executed on a router between
171.1Sitojunyour local IPv6 site and outside IPv4 network.  The daemon needs to be
181.1Sitojuninvoked per each TCP services (TCP port number).
191.1Sitojun
201.1Sitojun	IPv4 node "dest" = 123.4.5.6
211.1Sitojun		|
221.1Sitojun	[[[[ outside IPv4 ocean ]]]]
231.1Sitojun		|
241.1Sitojun	node that runs FAITH-daemon (usually a router)
251.1Sitojun		|
261.1Sitojun	==+=====+===+==== IPv6, or IPv4/v6 network in your site ^
271.1Sitojun	  |	    |						| connection
281.1Sitojun	clients	  IPv6 node "src"				|
291.1Sitojun
301.1SitojunYou will have to allocate an IPv6 address prefix to map IPv4 addresses into.
311.1SitojunThe following description uses 3ffe:0501:1234:ffff:: as example.
321.1SitojunPlease use a prefix which belongs to your site.
331.1SitojunFAITH will make it possible to make a IPv6 TCP connection From IPv6 node
341.1Sitojun"src", toward IPv4 node "dest", by specifying FAITH-mapped address
351.1Sitojun3ffe:0501:1234:ffff::123.4.5.6
361.1Sitojun(which is, 3ffe:0501:1234:ffff:0000:0000:7b04:0506).
371.1SitojunThe address mapping can be performed by hand:-), by speical nameserver on
381.1Sitojunthe network, or by special resolver on the source node.
391.1Sitojun
401.1Sitojun
411.1SitojunSetup
421.1Sitojun=====
431.1Sitojun
441.1SitojunThe following example assumes:
451.1Sitojun- You have assigned 3ffe:0501:1234:ffff:: as FAITH adderss prefix.
461.1Sitojun- You are willing to provide IPv6-to IPv4 TCP relay for telnet.
471.1Sitojun
481.1Sitojun<<On the translating router on which faithd runs>>
491.1Sitojun
501.1Sitojun(1) If you have IPv6 TCP server for the "telnet" service, i.e. telnetd via
511.1Sitojun    inet6d, disable that daemon.  Comment out the line from "inet6d.conf"
521.1Sitojun    and send the HUP signal to "inet6d".
531.1Sitojun
541.1Sitojun(2) Execute sysctl as root to enable FAITH support in the kernel.
551.1Sitojun
561.1Sitojun        # sysctl -w net.inet6.ip6.keepfaith=1
571.1Sitojun
581.1Sitojun(3) Route packets toward FAITH prefix into "faith0" interface.
591.1Sitojun
601.1Sitojun	# ifconfig faith0 up
611.1Sitojun	# route add -inet6 3ffe:0501:1234:ffff:: -prefixlen 64 -interface faith0
621.1Sitojun
631.1Sitojun	or, on platforms that has problem with "-interface":
641.1Sitojun	# ifconfig faith0 up
651.1Sitojun	# route add -inet6 3ffe:0501:1234:ffff:: -prefixlen 64 \
661.1Sitojun		fe80:q::xxxx:yyyy:zzzz:wwww
671.1Sitojun	(the last one is link-local address assigned for faith0)
681.1Sitojun
691.1Sitojun(4) Execute "faithd" by root as follows:
701.1Sitojun
711.5Sitojun	# faithd telnet /usr/libexec/telnetd telnetd
721.1Sitojun
731.1Sitojun    1st argument is a service name you are willing to provide TCP relay.
741.1Sitojun	(it can be specified either by number "23" or by string "telnet")
751.1Sitojun    2nd argument is a path name for local IPv6 TCP server.  If there is a
761.1Sitojun    connection toward the router itself, this program will be invoked.
771.1Sitojun    3rd and the following arguments are arguments for the local IPv6 TCP
781.1Sitojun    server.  (3rd argument is typically the program name without its path.)
791.1Sitojun
801.1Sitojun    More examples:
811.1Sitojun
821.5Sitojun	# faithd login /usr/libexec/rlogin rlogind
831.5Sitojun	# faithd shell /usr/libexec/rshd rshd
841.5Sitojun	# faithd ftpd /usr/libexec/ftpd ftpd -l
851.1Sitojun	# faithd sshd
861.1Sitojun
871.1Sitojun
881.1Sitojun<<Routing>>
891.1Sitojun
901.1Sitojun(4) Make sure that packets whose destinations match the prefix can
911.1Sitojunreach from the IPv6 host to the translating router.
921.1Sitojun
931.1Sitojun<<On the IPv6 host>>
941.1Sitojun
951.1SitojunThere are two ways to translate IPv4 address to IPv6 address:
961.1Sitojun	(a) Faked by DNS
971.1Sitojun	(b) Faked by /etc/hosts.
981.1Sitojun
991.1Sitojun(5.a) Install "newbie" and set up FAITH mode. See kit/ports/newbie.
1001.1Sitojun
1011.1Sitojun(5.b) Add an entry into /etc/hosts so that you can resolve hostname into
1021.1Sitojunfaked IPv6 addrss.  For example, add the following line for www.netbsd.org:
1031.1Sitojun
1041.1Sitojun	3ffe:0501:1234:ffff::140.160.140.252	www.netbsd.org
1051.1Sitojun
1061.1Sitojun<<On the translating router on which faithd runs.>>
1071.1Sitojun
1081.1Sitojun(6) To see if "faithd" works, watch "/var/log/daemon". Note: please
1091.1Sitojunsetup "/etc/syslog.conf" so that LOG_DAEMON messages are to be stored
1101.1Sitojunin "/var/log/daemon".
1111.1Sitojun
1121.1Sitojun	<e.g.>
1131.1Sitojun	daemon.*   /var/log/daemon
1141.1Sitojun
1151.1Sitojun
1161.1SitojunAdvanced configuration
1171.1Sitojun======================
1181.1Sitojun
1191.1SitojunIf you would like to restrict IPv4 destination for translation, you may
1201.1Sitojunwant to do the following:
1211.1Sitojun
1221.1Sitojun	# route add -inet6 3ffe:0501:1234:ffff::123.0.0.0 -prefixlen 104 \
1231.1Sitojun		-interface faith0
1241.1Sitojun
1251.1SitojunBy this way, you can restrict IPv4 destination to 123.0.0.0/8.
1261.1SitojunYou may also want to reject packets toward 3ffe:0501:1234:ffff::/64 which
1271.1Sitojunis not in 3ffe:0501:1234:ffff::123.0.0.0/104.  This will be left as excerside
1281.1Sitojunfor the reader.
1291.1Sitojun
1301.1SitojunBy doing this, you will be able to provide your IPv4 web server to outside
1311.1SitojunIPv6 customers, without risks of unwanted open relays.
1321.1Sitojun
1331.1Sitojun	[[[[ IPv6 network outside ]]]]			| 
1341.1Sitojun		|					| connection
1351.1Sitojun	node that runs FAITH-daemon (usually a router)	v
1361.1Sitojun		|
1371.1Sitojun	========+======== IPv4/v6 network in your site 
1381.1Sitojun		|			(123.0.0.0/8)
1391.1Sitojun	IPv4 web server
140