"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/README" (30 Jul 2002, 7861 Bytes) of package /linux/privat/old/portfwd-0.29.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # README
    3 #
    4 # portfwd - Port Forwarding Daemon
    5 #
    6 # $Id: README,v 1.7 2002/07/30 13:09:12 evertonm Exp $
    7 #
    8 
    9 LICENSE
   10 
   11         Portfwd - Port Forwarding Daemon
   12 
   13         This program is free software; you can redistribute it and/or
   14         modify it under the terms of the GNU General Public License as
   15         published by the Free Software Foundation; either version 2 of
   16         the License, or (at your option) any later version.
   17 
   18         This program is distributed in the hope that it will be
   19         useful, but WITHOUT ANY WARRANTY; without even the implied
   20         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   21         PURPOSE.  See the GNU General Public License for more details.
   22 
   23         You should have received a copy of the GNU General Public
   24         License along with this program; if not, write to the Free
   25         Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   26         MA 02111-1307 USA
   27 
   28 INTRODUCTION
   29 
   30         Portfwd stands for port forwarding daemon. It's a small C++
   31         utility which forwards incoming TCP connections and/or UDP
   32         packets to remote hosts.
   33 
   34         My apologies for my poor English. Corrections are welcome.
   35 
   36 FEATURES
   37 
   38         -- Forwarding of TCP segments.
   39 
   40         -- Forwarding of UDP datagrams.
   41 
   42         -- Forwarding of FTP in active and/or passive modes.
   43 
   44         -- Transparent proxying available under Linux. Portfwd detects
   45         such facility in "./configure" time by searching the
   46         definition of MSG_PROXY in <sys/socket.h>.
   47 
   48         -- DNS names for destination hosts can be resolved upon
   49         start-up or on demand (see "on-the-fly" DNS option).
   50 
   51         -- Portfwd can listen on specific local addresses.
   52 
   53         -- Source addresses for outgoing connections can be explicitly
   54         specified or automatically selected by the system.
   55 
   56         -- Structured configuration language allows specification of
   57         multiple simultaneous forwarding processes.
   58 
   59         -- Portfwd spawns one forwarder process for each set of ports
   60         which are subject to the same rules. Within a process, Portfwd
   61         uses a select()-based event-loop to concurrently handle
   62         several network events. There is no threading. There is no
   63         further process creation after the startup of the configured
   64         daemons.
   65 
   66         -- The destination of a connection/datagram can be selected
   67         based on its source address/port pair.
   68 
   69         -- Portfwd allows simple round-robin load-balancing through
   70         specification of multiple destinations.
   71 
   72 	-- Support for external destination selector program (aka
   73 	"director").
   74 
   75 LIMITATIONS
   76 
   77         -- Port ranges cannot be forwarded. Ports must be specified in
   78         a one-by-one basis.
   79 
   80         -- Specification of source address for outgoing UDP datagrams
   81         require transparent proxy support available in the OS kernel.
   82 
   83         -- The daemon must be restarted in order to update its
   84         configuration.
   85 
   86         -- A forwarding process blocks on some system calls, such as
   87         connect().
   88 
   89 BUILDING
   90 
   91         This program has been compiled with gcc 2.95.2 and tested
   92         under Debian Potato (Linux 2.2.19), but it may work on other
   93         plataforms as well.
   94 
   95         As of version 0.18, Portfwd has been ported for FreeBSD and
   96         Solaris and there is support for autoconf/automake.
   97 
   98         In order to compile:
   99 
  100                 ./configure
  101                 make
  102 
  103         A file named 'portfwd' should be produced.
  104 
  105 INSTALL
  106 
  107         To install 'portfwd' under /usr/local/sbin:
  108 
  109                 make install
  110 
  111         Otherwise, just copy 'portfwd' to a suitable location.
  112 
  113 CONFIG
  114 
  115         The grammar for the configuration file is described in the
  116         'conf.txt' file. Examples can be found in the 'cfg' directory.
  117 
  118         For a quick experiment, use the following redirector, then
  119         test with "telnet 127.0.0.1 10000". It should give you telnet
  120         access to your local machine.
  121 
  122         /*
  123          * telnet.cfg
  124          *
  125          * Forward all connections on TCP port 10000 to 127.0.0.1:23
  126          */
  127         tcp { 10000 { => 127.0.0.1:23 } }
  128         /*
  129          * eof: telnet.cfg
  130          */
  131 
  132         Below you can see a more complete example using most features
  133         of portfwd.
  134 
  135         /*
  136          * example.cfg
  137          */     
  138         user  nobody
  139         group nobody
  140         
  141         tcp /* TCP connections */
  142         { 
  143                 /*
  144                  * Connections on port 12000 from subnet localhost/24 and
  145                  * ports in the range 0-5000 are forwarded to 127.0.0.1:23.
  146                  * Anything else goes to localhost:80.
  147                  */
  148                 12000 { 
  149                         localhost/24:+5000  => 127.0.0.1:23;
  150                         /* anything else */ => localhost:80
  151                 };
  152         
  153                 /*
  154                  * On port 11000, connections from address localhost, any 
  155                  * port, are forwarded to 127.0.0.1:telnet.
  156                  */
  157                 11000 { localhost => 127.0.0.1:telnet };
  158         
  159                 10000 
  160                 ftp-active-mode-on 127.0.0.1
  161                 ftp-passive-mode-on 127.0.0.1
  162                 { => localhost:ftp }
  163         }
  164         
  165         udp /* UDP packets */
  166         {
  167                 /*
  168                  * All packets on port 10000 are forwarded to 127.0.0.1:11000.
  169                  */
  170                 10000 { => 127.0.0.1:11000 }
  171         }
  172         /*
  173          * eof: example.cfg
  174          */
  175 
  176 RUNNING BASICS
  177 
  178         1. START
  179 
  180         Type:
  181         portfwd -c <path_to_config_file>
  182 
  183         2. STOP
  184 
  185         Send a TERM signal to the Portfwd master process (the one with
  186         lowest PID).
  187 
  188 COMMAND LINE OPTIONS
  189 
  190         Syntax Help
  191 
  192                 Option -h provides brief help on command line syntax.
  193 
  194         Running in Foreground
  195 
  196                 The -g switch prevents Portfwd from going to
  197                 background.
  198 
  199         Configuration File
  200 
  201                 Use -c <config_file_path> to specify the location of
  202                 your configuration file.
  203 
  204         On-the-fly DNS
  205 
  206                 Portfwd usually solves all DNS hostnames upon
  207                 startup. Specify the -f option if you want the
  208                 destination hostnames be updated on demand. Be aware
  209                 this can affect TCP connection times and the whole UDP
  210                 forwarding performance.
  211 
  212         Transparent Proxy
  213 
  214                 The -t switch enables transparent proxying; i.e. IP
  215                 address of outgoing data are "faked" to match those
  216                 from incoming data. If you plan to forward data to
  217                 hosts behind your firewall, you probably want this
  218                 option turned on, as it allows for your servers to see
  219                 original addresses of clients.
  220 
  221                 Of course, this feature requires transparent proxy
  222                 support compiled in your kernel, e.g.:
  223 
  224 			CONFIG_IP_TRANSPARENT_PROXY in Linux kernel.
  225 
  226         Debugging
  227 
  228                 If the -d switch is given, portfwd will produce
  229                 verbose logging for debug purposes. Up to 3 switches
  230                 are meaningful.
  231 
  232                 Failure messages are sent to the system log under the
  233                 "daemon" facility.
  234 
  235         Program Version
  236 
  237                 Portfwd version can be obtained by passing the -v
  238                 switch.
  239 
  240 SUPPORT
  241 
  242         If you have further questions, please consult the FAQ.
  243 
  244         There is a discussion board in the Portfwd web site at Source
  245         Forge:
  246 
  247                 http://portfwd.sf.net
  248 
  249         This is probably the most useful resource for Portfwd users.
  250 
  251         Anyway, one can contact me directly at:
  252 
  253                 Everton da Silva Marques
  254                 evertonsm at yahoo dot com dot br
  255 
  256                                  -x-