"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/doc/FAQ" (5 May 2002, 3494 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 # FAQ
    3 #
    4 # portfwd - Port Forwarding Daemon
    5 #
    6 # $Id: FAQ,v 1.4 2002/05/05 05:27:49 evertonm Exp $
    7 #
    8 
    9 
   10 Q: How to enable load balancing?
   11 
   12 A: There are two approaches:
   13 
   14    1. By using "on-the-fly DNS"
   15 
   16       Assign multiple addresses to a DNS name, use a such name as a
   17       single destination in Portfwd configuration and then run Portfwd
   18       in on-the-fly DNS mode with the "-f" switch.
   19 
   20       /*
   21        * Load-balacing example with DNS on-demand
   22        */
   23       tcp {
   24 	 80 { => multiple-addresses-hostname:8080 }
   25       }
   26 
   27       The DNS service will make Portfwd to scan, in a round-robin
   28       fashion, all addresses assigned to that name.
   29 
   30       One problem with this method is the time spent to query the DNS
   31       system.
   32 
   33    2. By specifying multiple destinations 
   34 
   35       As of version 0.23, Portfwd supports multiple
   36       destinations. Thus, one may write rules like:
   37 
   38       /*
   39        * Load-balacing example with multiple destinations
   40        */
   41       tcp {
   42 	 80 { => host1:8080, host2:80, host2:80, host3:80 }
   43       }
   44 
   45       In this example, 1/4 of the connections are forwarded
   46       to host1:80, 2/4 to host2:80 and 1/4 to host3.
   47 
   48    It's also possible to combine both methods.
   49 
   50 
   51 Q: How to bind to a specific address?
   52 
   53 A1: If you want to specify a local address for incoming
   54     connections, use the "listen-on" statement. In previous
   55     Portfwd versions, such option was known as "bind-address".
   56 
   57         /* 
   58 	 * listen-on example
   59 	 */
   60 
   61         listen-on 10.0.0.1 /* uses 10.0.0.1 until next listen-on */
   62         tcp {
   63           2323 { => 10.0.0.2:23 };
   64           8080 { => 10.0.0.2:80 }
   65         }
   66         udp { 6000 { => 192.168.0.2:6000 } }
   67 
   68         listen-on 192.168.0.1 /* from here afterwards, use 192.168.0.1 */
   69         tcp {
   70           2323 { => 10.0.0.3:23 };
   71           2525 { => 192.168.0.2:25 }
   72         }
   73 
   74 
   75 A2: If you want to specify a local source address for
   76     outgoing connections, use the "source-address" statement.
   77     Please notice this option overrides the transparent
   78     proxying.
   79 
   80 	/*
   81 	 * source-address example
   82 	 */
   83 
   84 	tcp { 10000 { => localhost:15000 } }
   85 	udp { 10000 { => localhost:15000 } }
   86 
   87         /* Above the source-address line, the system
   88            automatically selects the source address
   89            for outgoing connections. */
   90 
   91 	source-address 10.0.0.2
   92 
   93         /* Below the source-address line, the address
   94            specified is used as source address
   95            for outgoing connections. Of course, that
   96            address must be previously assigned to a
   97            local interface. */
   98 
   99 	tcp { 11000 { => localhost:15000 } }
  100 	udp { 11000 { => localhost:15000 } }
  101 
  102 
  103 Q: How does FTP forwarding work?
  104 
  105 A: See the example below.
  106 
  107 	 ----------      -----------      ---------- 
  108 	 | FTP    |      | portfwd |      | FTP    |
  109 	 | client |      | host    |      | server |
  110 	 ----------      -----------      ----------
  111 	      |           |       |            |
  112 	 -----------...------   ------...-----------
  113 	      a           b       c            d
  114 
  115         b = name/address of client-side interface 
  116 	c = name/address of server-side interface
  117 	
  118 	tcp {
  119 		2121
  120 		ftp-active-mode-on c
  121 		ftp-passive-mode-on b
  122 		{ => d:21 }
  123 	}
  124 
  125 
  126 Q: How can I debug Portfwd behavior?
  127 
  128 A: Append the "-d" switch to Portfwd command 
  129    line and then watch your logs. 
  130 
  131 	Example:
  132 	echo "daemon.* /var/log/daemon.log" >> /etc/syslog.conf
  133 	touch /var/log/daemon.log
  134 	/etc/rc.d/init.d/syslog restart
  135 	tail -f /var/log/daemon.log
  136 	portfwd -d -c <your_config_file>
  137 
  138 
  139 				 -x-