1 .\" $KAME: faithd.8,v 1.33 2001/09/05 03:04:20 itojun Exp $
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the project nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" $FreeBSD: src/usr.sbin/faithd/faithd.8,v 1.2.2.12 2003/03/12 22:08:14 trhodes Exp $
31 .\" $DragonFly: src/usr.sbin/faithd/faithd.8,v 1.2 2003/06/17 04:29:53 dillon Exp $
38 .Nd FAITH IPv6/v4 translator daemon
42 .Op Fl f Ar configfile
44 .Op Ar serverpath Op Ar serverargs
48 utility provides IPv6-to-IPv4 TCP relay. It
49 must be used on an IPv4/v6 dual stack router.
61 Destination for relayed
63 connection will be determined by the last 4 octets of the original
67 .Li 3ffe:0501:4819:ffff::
72 destination address is
73 .Li 3ffe:0501:4819:ffff::0a01:0101 ,
74 the traffic will be relayed to IPv4 destination
80 an IPv6 address prefix must be reserved for mapping IPv4 addresses into.
81 Kernel must be properly configured to route all the TCP connection
82 toward the reserved IPv6 address prefix into the
84 pseudo interface, by using
89 should be used to configure
90 .Dv net.inet6.ip6.keepfaith
94 The router must be configured to capture all the TCP traffic
97 address prefix, by using
105 utility needs a special name-to-address translation logic, so that
106 hostnames gets resolved into special
109 For small-scale installation, use
111 For large-scale installation, it is useful to have
112 a DNS server with special address translation support.
113 An implementation called
117 .Pa http://www.vermicelli.pasta.cs.uit.no/ipv6/software.html .
118 Make sure you do not propagate translated DNS records to normal DNS cloud,
119 it is highly harmful.
124 is invoked as a standalone program,
126 will daemonize itself.
129 utility will listen to
137 is found, it relays the connection.
143 it is not possible to run local TCP daemons for port
147 or other standard mechanisms.
152 you can run local daemons on the router.
155 utility will invoke local daemon at
157 if the destination address is local interface address,
158 and will perform translation to IPv4 TCP in other cases.
161 for the arguments for the local daemon.
163 The following options are available:
164 .Bl -tag -width indent
166 Debugging information will be generated using
168 .It Fl f Ar configfile
169 Specify a configuration file for access control.
172 Use privileged TCP port number as source port,
173 for IPv4 TCP connection toward final destination.
178 this flag is not necessary as special program code is supplied.
183 utility will relay both normal and out-of-band TCP data.
184 It is capable of emulating TCP half close as well.
187 utility includes special support for protocols used by
191 When translating FTP protocol,
193 translates network level addresses in
200 will relay back connection from
206 Inactive sessions will be disconnected in 30 minutes,
207 to avoid stale sessions from chewing up resources.
208 This may be inappropriate for some of the services
209 (should this be configurable?).
216 will handle connection passed from standard input.
217 If the connection endpoint is in the reserved IPv6 address prefix,
219 will relay the connection.
222 will invoke service-specific daemon like
224 by using the command argument passed from
229 utility determines operation mode by the local TCP port number,
230 and enables special protocol handling whenever necessary/possible.
235 on FTP port, it will operate as a FTP relay.
237 The operation mode requires special support for
242 To prevent malicious accesses,
244 implements a simple address-based access control.
252 will avoid relaying unwanted traffic.
255 contains directives with the following format:
258 .Ar src Ns / Ns Ar slen Cm deny Ar dst Ns / Ns Ar dlen
260 If the source address of a query matches
261 .Ar src Ns / Ns Ar slen ,
262 and the translated destination address matches
263 .Ar dst Ns / Ns Ar dlen ,
266 .Ar src Ns / Ns Ar slen Cm permit Ar dst Ns / Ns Ar dlen
268 If the source address of a query matches
269 .Ar src Ns / Ns Ar slen ,
270 and the translated destination address matches
271 .Ar dst Ns / Ns Ar dlen ,
272 permit the connection.
275 The directives are evaluated in sequence,
276 and the first matching entry will be effective.
278 (if we reach the end of the ruleset)
279 the traffic will be denied.
282 traffic may be filtered by using access control functionality in
288 interface has to be configured properly.
290 # sysctl net.inet6.ip6.accept_rtadv=0
291 # sysctl net.inet6.ip6.forwarding=1
292 # sysctl net.inet6.ip6.keepfaith=1
294 # route add -inet6 3ffe:501:4819:ffff:: -prefixlen 96 ::1
295 # route change -inet6 3ffe:501:4819:ffff:: -prefixlen 96 -ifp faith0
297 .Ss Daemon mode samples
300 service, and provide no local telnet service, invoke
307 If you would like to provide local telnet service via
310 .Pa /usr/libexec/telnetd ,
311 use the following command line:
313 # faithd telnet /usr/libexec/telnetd telnetd
316 If you would like to pass extra arguments to the local daemon:
318 # faithd ftp /usr/libexec/ftpd ftpd -l
321 Here are some other examples.
324 to translate rsh/rlogin services.
327 # faithd login /usr/libexec/rlogin rlogind
328 # faithd shell /usr/libexec/rshd rshd
331 However, you should be careful when translating rlogin or rsh
334 .Sx SECURITY CONSIDERATIONS
336 .Ss inetd mode samples
337 Add the following lines into
339 Syntax may vary depending upon your operating system.
341 telnet stream tcp6/faith nowait root /usr/sbin/faithd telnetd
342 ftp stream tcp6/faith nowait root /usr/sbin/faithd ftpd -l
343 ssh stream tcp6/faith nowait root /usr/sbin/faithd /usr/sbin/sshd -i
347 will open listening sockets with enabling kernel TCP relay support.
348 Whenever connection comes in,
352 If it the connection endpoint is in the reserved IPv6 address prefix.
355 utility will relay the connection.
358 will invoke service-specific daemon like
360 .Ss Access control samples
361 The following illustrates a simple
365 # permit anyone from 3ffe:501:ffff::/48 to use the translator,
366 # to connect to the following IPv4 destinations:
367 # - any location except 10.0.0.0/8 and 127.0.0.0/8.
368 # Permit no other connections.
370 3ffe:501:ffff::/48 deny 10.0.0.0/8
371 3ffe:501:ffff::/48 deny 127.0.0.0/8
372 3ffe:501:ffff::/48 permit 0.0.0.0/0
389 .%A Jun-ichiro itojun Hagino
391 .%T "An IPv6-to-IPv4 transport relay translator"
393 .%O ftp://ftp.isi.edu/in-notes/rfc3142.txt
400 utility first appeared in WIDE Hydrangea IPv6 protocol stack kit.
403 IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack
404 was initially integrated into
406 .Sh SECURITY CONSIDERATIONS
407 It is very insecure to use
409 and other IP-address based authentication, for connections relayed by
411 (and any other TCP relaying services).
413 Administrators are advised to limit accesses to
417 or by using IPv6 packet filters.
420 service from malicious parties and avoid theft of service/bandwidth.
421 IPv6 destination address can be limited by
422 carefully configuring routing entries that points to
426 IPv6 source address needs to be filtered by using packet filters.
429 have more discussions on this topic.