1 .\" $NetBSD: faithd.8,v 1.25 2009/10/25 01:09:09 jakllsch Exp $
2 .\" $KAME: faithd.8,v 1.37 2002/05/09 14:21:23 itojun Exp $
4 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the project nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .Nd FAITH IPv6/v4 translator daemon
40 .Op Fl f Ar configfile
42 .Op Ar serverpath Op Ar serverargs
46 provides IPv6-to-IPv4 TCP relay.
48 must be used on an IPv4/v6 dual stack router.
60 Destination for relayed
62 connection will be determined by the last 4 octets of the original
66 .Li 2001:0db8:4819:ffff::
71 destination address is
72 .Li 2001:0db8:4819:ffff::0a01:0101 ,
73 the traffic will be relayed to IPv4 destination
79 an IPv6 address prefix must be reserved for mapping IPv4 addresses into.
80 Kernel must be properly configured to route all the TCP connection
81 toward the reserved IPv6 address prefix into the
83 pseudo interface, by using
88 should be used to configure
89 .Dv net.inet6.ip6.keepfaith
93 The router must be configured to capture all the TCP traffic
96 address prefix, by using
103 needs a special name-to-address translation logic, so that
104 hostnames gets resolved into special
107 For small-scale installation, use
109 For large-scale installation, it is useful to have
110 a DNS server with special address translation support.
111 An implementation called
115 .Pa http://www.vermicelli.pasta.cs.uit.no/software/totd.html .
116 Make sure you do not propagate translated DNS records to normal DNS cloud,
117 it is highly harmful.
121 is invoked as a standalone program,
123 will daemonize itself.
133 is found, it relays the connection.
139 it is not possible to run local TCP daemons for port
143 or other standard mechanisms.
148 you can run local daemons on the router.
150 will invoke local daemon at
152 if the destination address is local interface address,
153 and will perform translation to IPv4 TCP in other cases.
156 for the arguments for the local daemon.
158 The following options are available:
159 .Bl -tag -width indent
161 Debugging information will be generated using
163 .It Fl f Ar configfile
164 Specify a configuration file for access control.
167 Use privileged TCP port number as source port,
168 for IPv4 TCP connection toward final destination.
171 this flag is not necessary as special program code is supplied.
175 will relay both normal and out-of-band TCP data.
176 It is capable of emulating TCP half close as well.
178 includes special support for protocols used by
180 When translating FTP protocol,
182 translates network level addresses in
188 Inactive sessions will be disconnected in 30 minutes,
189 to avoid stale sessions from chewing up resources.
190 This may be inappropriate for some of the services
191 .Pq should this be configurable? .
198 will handle connection passed from standard input.
199 If the connection endpoint is in the reserved IPv6 address prefix,
201 will relay the connection.
204 will invoke service-specific daemon like
206 by using the command argument passed from
210 determines operation mode by the local TCP port number,
211 and enables special protocol handling whenever necessary/possible.
216 on FTP port, it will operate as a FTP relay.
218 .\"The operation mode requires special support for
223 To prevent malicious accesses,
225 implements a simple address-based access control.
235 will avoid relaying unwanted traffic.
238 contains directives with the following format:
242 .Ar src/slen Li deny Ar dst/dlen
245 If the source address of a query matches
247 and the translated destination address matches
252 .Ar src/slen Li permit Ar dst/dlen
255 If the source address of a query matches
257 and the translated destination address matches
259 permit the connection.
262 The directives are evaluated in sequence,
263 and the first matching entry will be effective.
265 .Pq if we reach the end of the ruleset
266 the traffic will be denied.
269 traffic may be filtered by using access control functionality in
284 interface has to be configured properly.
286 # sysctl -w net.inet6.ip6.accept_rtadv=0
287 # sysctl -w net.inet6.ip6.forwarding=1
288 # sysctl -w net.inet6.ip6.keepfaith=1
289 # ifconfig faith0 create up
290 # route add -inet6 2001:0db8:4819:ffff:: -prefixlen 96 ::1
291 # route change -inet6 2001:0db8:4819:ffff:: -prefixlen 96 -ifp faith0
293 .Ss Daemon mode samples
296 service, and provide no local telnet service, invoke
303 If you would like to provide local telnet service via
306 .Pa /usr/libexec/telnetd ,
307 use the following command line:
309 # faithd telnet /usr/libexec/telnetd telnetd
312 If you would like to pass extra arguments to the local daemon:
314 # faithd ftp /usr/libexec/ftpd ftpd -l
317 Here are some other examples.
320 if the service checks the source port range.
323 # faithd telnet /usr/libexec/telnetd telnetd
325 .Ss inetd mode samples
326 Add the following lines into
328 .\"Syntax may vary depending upon your operating system.
330 telnet stream faith/tcp6 nowait root faithd telnetd
331 ftp stream faith/tcp6 nowait root faithd ftpd -l
332 ssh stream faith/tcp6 nowait root faithd /usr/sbin/sshd -i
336 will open listening sockets with enabling kernel TCP relay support.
337 Whenever connection comes in,
341 If it the connection endpoint is in the reserved IPv6 address prefix.
343 will relay the connection.
346 will invoke service-specific daemon like
348 .Ss Access control samples
349 The following illustrates a simple
353 # permit anyone from 2001:0db8:ffff::/48 to use the translator,
354 # to connect to the following IPv4 destinations:
355 # - any location except 10.0.0.0/8 and 127.0.0.0/8.
356 # Permit no other connections.
358 2001:0db8:ffff::/48 deny 10.0.0.0/8
359 2001:0db8:ffff::/48 deny 127.0.0.0/8
360 2001:0db8:ffff::/48 permit 0.0.0.0/0
368 .%A Jun-ichiro itojun Hagino
370 .%T "An IPv6-to-IPv4 transport relay translator"
372 .%O ftp://ftp.isi.edu/in-notes/rfc3142.txt
379 command first appeared in WIDE Hydrangea IPv6 protocol stack kit.
381 .Sh SECURITY CONSIDERATIONS
382 It is very insecure to use IP-address based authentication, for connections relayed by
384 and any other TCP relaying services.
386 Administrators are advised to limit accesses to
390 or by using IPv6 packet filters.
393 service from malicious parties and avoid theft of service/bandwidth.
394 IPv6 destination address can be limited by
395 carefully configuring routing entries that points to
399 IPv6 source address needs to be filtered by using packet filters.
402 have more discussions on this topic.