2000-01-27 09:28:38 +00:00
|
|
|
Configuring FAITH IPv6-to-IPv4 TCP relay
|
|
|
|
|
|
|
|
Kazu Yamamoto and Jun-ichiro itojun Hagino
|
2002-04-19 04:46:24 +00:00
|
|
|
$KAME: README,v 1.8 2001/09/05 03:04:20 itojun Exp $
|
2000-01-27 09:28:38 +00:00
|
|
|
$FreeBSD$
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
2003-01-01 18:49:04 +00:00
|
|
|
FAITH is an IPv6-to-IPv4 TCP relay. It performs tcp relay just as some of
|
2000-01-27 09:28:38 +00:00
|
|
|
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.
|
2001-06-11 12:39:29 +00:00
|
|
|
The following description uses 3ffe:0501:ffff:0000:: as example.
|
2000-01-27 09:28:38 +00:00
|
|
|
Please use a prefix which belongs to your site.
|
2003-01-01 18:49:04 +00:00
|
|
|
FAITH will make it possible to make an IPv6 TCP connection From IPv6 node
|
2000-01-27 09:28:38 +00:00
|
|
|
"src", toward IPv4 node "dest", by specifying FAITH-mapped address
|
2001-06-11 12:39:29 +00:00
|
|
|
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
|
2000-01-27 09:28:38 +00:00
|
|
|
the network, or by special resolver on the source node.
|
|
|
|
|
|
|
|
|
|
|
|
Setup
|
|
|
|
=====
|
|
|
|
|
|
|
|
The following example assumes:
|
2001-06-11 12:39:29 +00:00
|
|
|
- You have assigned 3ffe:0501:ffff:0000:: as FAITH adderss prefix.
|
2000-01-27 09:28:38 +00:00
|
|
|
- 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.
|
|
|
|
|
2002-05-11 05:55:05 +00:00
|
|
|
# sysctl net.inet6.ip6.keepfaith=1
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
(3) Route packets toward FAITH prefix into "faith0" interface.
|
|
|
|
|
|
|
|
# ifconfig faith0 up
|
2001-06-11 12:39:29 +00:00
|
|
|
# route add -inet6 3ffe:0501:ffff:0000:: -prefixlen 64 ::1
|
|
|
|
# route change -inet6 3ffe:0501:ffff:0000:: -prefixlen 64 -ifp faith0
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
(4) Execute "faithd" by root as follows:
|
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
# faithd telnet /usr/libexec/telnetd telnetd
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
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:
|
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
# faithd login /usr/libexec/rlogin rlogind
|
|
|
|
# faithd shell /usr/libexec/rshd rshd
|
|
|
|
# faithd ftpd /usr/libexec/ftpd ftpd -l
|
2000-07-05 21:54:07 +00:00
|
|
|
# faithd sshd
|
2000-01-27 09:28:38 +00:00
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
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.
|
|
|
|
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
<<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.
|
|
|
|
|
2000-07-05 21:54:07 +00:00
|
|
|
(5.a) Install "newbie" and set up FAITH mode. See kit/ports/newbie.
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
(5.b) Add an entry into /etc/hosts so that you can resolve hostname into
|
2000-07-05 21:54:07 +00:00
|
|
|
faked IPv6 addrss. For example, add the following line for www.netbsd.org:
|
2000-01-27 09:28:38 +00:00
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
3ffe:0501:ffff:0000::140.160.140.252 www.netbsd.org
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
<<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
|
|
|
|
|
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
2000-01-27 09:28:38 +00:00
|
|
|
Advanced configuration
|
|
|
|
======================
|
|
|
|
|
|
|
|
If you would like to restrict IPv4 destination for translation, you may
|
|
|
|
want to do the following:
|
|
|
|
|
2001-06-11 12:39:29 +00:00
|
|
|
# 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
|
2000-01-27 09:28:38 +00:00
|
|
|
|
|
|
|
By this way, you can restrict IPv4 destination to 123.0.0.0/8.
|
2001-06-11 12:39:29 +00:00
|
|
|
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
|
2000-01-27 09:28:38 +00:00
|
|
|
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.
|
|
|
|
|
2000-07-05 21:54:07 +00:00
|
|
|
[[[[ IPv6 network outside ]]]] |
|
2000-01-27 09:28:38 +00:00
|
|
|
| | connection
|
|
|
|
node that runs FAITH-daemon (usually a router) v
|
|
|
|
|
|
2000-07-05 21:54:07 +00:00
|
|
|
========+======== IPv4/v6 network in your site
|
2000-01-27 09:28:38 +00:00
|
|
|
| (123.0.0.0/8)
|
|
|
|
IPv4 web server
|