port forwarding

E Frank Ball frankb at efball.com
Fri Jul 14 16:59:16 PDT 2000


The issue of port forwarding came up at the last nblug meeting, so here is an example
of how it works:

# this is for forwarding packets to an internal machine thru the firewall
# these have lower precedence than the ipchains rules, so the ports must
# first be opened by ipchains before ipmasqadm can use them.
#
/sbin/modprobe ip_masq_portfw
# see www.monmouth.demon.co.uk/ipsubs/portfw-2.2.html for  general info
# see man ipmasqadm for specific syntax (different than web page)
#
# redirect ssh connections to various internal hosts
ipmasqadm portfw -f
ipmasqadm portfw -a -P tcp -L 209.204.172.XXX YYYY -R 192.168.0.3 22

This example redirects connections on port YYYY to port 22 on my
internal machine.  The "-a" means add a rule.  "-P tcp" for protocal
tcp.

The ipmasqadm rpm can be found on the Turbo Server ftp site, it works
fine with RedHat.

   E Frank Ball           frankb at efball.com



More information about the talk mailing list