Linux Port Forwarding
Copyright 2002, 2003 Andy Barclay
OpenContent License (OPL)
IP Port Forwarding for Linux
------------------------------
The ipmasqadm kernel module is required to make this happen.
You can download ipmasqadm-0.4.2.tar.gz via anonymous ftp from woody.unixpeople.com
or the latest version is available from: http://juanjox.kernelnotes.org
You will want to read the man page for ipmasqadm, as you may need to
recompile the kernel with the specified parameters.
Configuring Port Forwarding
-----------------
/usr/sbin/ipmasqadm portfw -a -P tcp -L 171.133.80.22 3025 -R 165.48.113.141 3025
the -a is add
the -P is the protocol to forward
the -L is the interface and port to accept the forwarding
the -R is the device and port to forward the request to.
You will then want to have your inside hosts masquerade to the outside
world as port forwarding only allows packets to go in one direction.
Masquerading
--------------
/sbin/ipchains -A forward -s 192.168.37.0/24 -d 0.0.0.0/0 -i eth0 -j MASQ
the -s is your internal network
the -d is the destination, in this case the destination in the whole world
#JJR