Home | History | Annotate | Line # | Download | only in faithd
README revision 1.7
      1  1.1  itojun Configuring FAITH IPv6-to-IPv4 TCP relay
      2  1.1  itojun 
      3  1.1  itojun Kazu Yamamoto and Jun-ichiro itojun Hagino
      4  1.7  itojun $NetBSD: README,v 1.7 2000/07/02 09:17:30 itojun Exp $
      5  1.7  itojun $KAME: README,v 1.5 2000/07/02 08:50:50 itojun Exp $
      6  1.1  itojun 
      7  1.1  itojun 
      8  1.1  itojun Introduction
      9  1.1  itojun ============
     10  1.1  itojun 
     11  1.1  itojun FAITH is a IPv6-to-IPv4 TCP relay.  It performs tcp relay just as some of
     12  1.1  itojun firewall-oriented gateway does, but between IPv6 and IPv4 with address
     13  1.4  itojun translation.
     14  1.4  itojun TCP connections has to be made from IPv6 node to IPv4 node.  FAITH will
     15  1.1  itojun not relay connections for the opposite direction.
     16  1.1  itojun To perform relays, FAITH daemon needs to be executed on a router between
     17  1.1  itojun your local IPv6 site and outside IPv4 network.  The daemon needs to be
     18  1.1  itojun invoked per each TCP services (TCP port number).
     19  1.1  itojun 
     20  1.1  itojun 	IPv4 node "dest" = 123.4.5.6
     21  1.1  itojun 		|
     22  1.1  itojun 	[[[[ outside IPv4 ocean ]]]]
     23  1.1  itojun 		|
     24  1.1  itojun 	node that runs FAITH-daemon (usually a router)
     25  1.1  itojun 		|
     26  1.1  itojun 	==+=====+===+==== IPv6, or IPv4/v6 network in your site ^
     27  1.1  itojun 	  |	    |						| connection
     28  1.1  itojun 	clients	  IPv6 node "src"				|
     29  1.1  itojun 
     30  1.1  itojun You will have to allocate an IPv6 address prefix to map IPv4 addresses into.
     31  1.1  itojun The following description uses 3ffe:0501:1234:ffff:: as example.
     32  1.1  itojun Please use a prefix which belongs to your site.
     33  1.1  itojun FAITH will make it possible to make a IPv6 TCP connection From IPv6 node
     34  1.1  itojun "src", toward IPv4 node "dest", by specifying FAITH-mapped address
     35  1.1  itojun 3ffe:0501:1234:ffff::123.4.5.6
     36  1.1  itojun (which is, 3ffe:0501:1234:ffff:0000:0000:7b04:0506).
     37  1.1  itojun The address mapping can be performed by hand:-), by speical nameserver on
     38  1.1  itojun the network, or by special resolver on the source node.
     39  1.1  itojun 
     40  1.1  itojun 
     41  1.1  itojun Setup
     42  1.1  itojun =====
     43  1.1  itojun 
     44  1.1  itojun The following example assumes:
     45  1.1  itojun - You have assigned 3ffe:0501:1234:ffff:: as FAITH adderss prefix.
     46  1.1  itojun - You are willing to provide IPv6-to IPv4 TCP relay for telnet.
     47  1.1  itojun 
     48  1.1  itojun <<On the translating router on which faithd runs>>
     49  1.1  itojun 
     50  1.1  itojun (1) If you have IPv6 TCP server for the "telnet" service, i.e. telnetd via
     51  1.1  itojun     inet6d, disable that daemon.  Comment out the line from "inet6d.conf"
     52  1.1  itojun     and send the HUP signal to "inet6d".
     53  1.1  itojun 
     54  1.1  itojun (2) Execute sysctl as root to enable FAITH support in the kernel.
     55  1.1  itojun 
     56  1.1  itojun         # sysctl -w net.inet6.ip6.keepfaith=1
     57  1.1  itojun 
     58  1.1  itojun (3) Route packets toward FAITH prefix into "faith0" interface.
     59  1.1  itojun 
     60  1.1  itojun 	# ifconfig faith0 up
     61  1.1  itojun 	# route add -inet6 3ffe:0501:1234:ffff:: -prefixlen 64 \
     62  1.7  itojun 		fe80::xxxx:yyyy:zzzz:wwww%faith0
     63  1.1  itojun 
     64  1.1  itojun (4) Execute "faithd" by root as follows:
     65  1.1  itojun 
     66  1.5  itojun 	# faithd telnet /usr/libexec/telnetd telnetd
     67  1.1  itojun 
     68  1.1  itojun     1st argument is a service name you are willing to provide TCP relay.
     69  1.1  itojun 	(it can be specified either by number "23" or by string "telnet")
     70  1.1  itojun     2nd argument is a path name for local IPv6 TCP server.  If there is a
     71  1.1  itojun     connection toward the router itself, this program will be invoked.
     72  1.1  itojun     3rd and the following arguments are arguments for the local IPv6 TCP
     73  1.1  itojun     server.  (3rd argument is typically the program name without its path.)
     74  1.1  itojun 
     75  1.1  itojun     More examples:
     76  1.1  itojun 
     77  1.5  itojun 	# faithd login /usr/libexec/rlogin rlogind
     78  1.5  itojun 	# faithd shell /usr/libexec/rshd rshd
     79  1.5  itojun 	# faithd ftpd /usr/libexec/ftpd ftpd -l
     80  1.1  itojun 	# faithd sshd
     81  1.1  itojun 
     82  1.1  itojun 
     83  1.1  itojun <<Routing>>
     84  1.1  itojun 
     85  1.1  itojun (4) Make sure that packets whose destinations match the prefix can
     86  1.1  itojun reach from the IPv6 host to the translating router.
     87  1.1  itojun 
     88  1.1  itojun <<On the IPv6 host>>
     89  1.1  itojun 
     90  1.1  itojun There are two ways to translate IPv4 address to IPv6 address:
     91  1.1  itojun 	(a) Faked by DNS
     92  1.1  itojun 	(b) Faked by /etc/hosts.
     93  1.1  itojun 
     94  1.1  itojun (5.a) Install "newbie" and set up FAITH mode. See kit/ports/newbie.
     95  1.1  itojun 
     96  1.1  itojun (5.b) Add an entry into /etc/hosts so that you can resolve hostname into
     97  1.1  itojun faked IPv6 addrss.  For example, add the following line for www.netbsd.org:
     98  1.1  itojun 
     99  1.1  itojun 	3ffe:0501:1234:ffff::140.160.140.252	www.netbsd.org
    100  1.1  itojun 
    101  1.1  itojun <<On the translating router on which faithd runs.>>
    102  1.1  itojun 
    103  1.1  itojun (6) To see if "faithd" works, watch "/var/log/daemon". Note: please
    104  1.1  itojun setup "/etc/syslog.conf" so that LOG_DAEMON messages are to be stored
    105  1.1  itojun in "/var/log/daemon".
    106  1.1  itojun 
    107  1.1  itojun 	<e.g.>
    108  1.1  itojun 	daemon.*   /var/log/daemon
    109  1.1  itojun 
    110  1.1  itojun 
    111  1.1  itojun Advanced configuration
    112  1.1  itojun ======================
    113  1.1  itojun 
    114  1.1  itojun If you would like to restrict IPv4 destination for translation, you may
    115  1.1  itojun want to do the following:
    116  1.1  itojun 
    117  1.1  itojun 	# route add -inet6 3ffe:0501:1234:ffff::123.0.0.0 -prefixlen 104 \
    118  1.1  itojun 		-interface faith0
    119  1.1  itojun 
    120  1.1  itojun By this way, you can restrict IPv4 destination to 123.0.0.0/8.
    121  1.1  itojun You may also want to reject packets toward 3ffe:0501:1234:ffff::/64 which
    122  1.1  itojun is not in 3ffe:0501:1234:ffff::123.0.0.0/104.  This will be left as excerside
    123  1.1  itojun for the reader.
    124  1.1  itojun 
    125  1.1  itojun By doing this, you will be able to provide your IPv4 web server to outside
    126  1.1  itojun IPv6 customers, without risks of unwanted open relays.
    127  1.1  itojun 
    128  1.6  itojun 	[[[[ IPv6 network outside ]]]]			|
    129  1.1  itojun 		|					| connection
    130  1.1  itojun 	node that runs FAITH-daemon (usually a router)	v
    131  1.1  itojun 		|
    132  1.6  itojun 	========+======== IPv4/v6 network in your site
    133  1.1  itojun 		|			(123.0.0.0/8)
    134  1.1  itojun 	IPv4 web server
    135