Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 12-01-2001, 02:34 AM   #1
Registered: Sep 2001
Location: New York
Distribution: Slackware 8
Posts: 100

Rep: Reputation: 16
ipchains port forwarding

already got ipchans to act as a router.

i wanted to forward a single port, so that i can do stuff like ftp to a computer on the local network, or run vnc.

i took a few wild guess at this.. can anyone help me out
(i do not want to use iptables or ipwadfm)

ipchains -I forward -s -d 5900/5900 -j MASQ

ipchains -I forward --sport 216.179.999.999 5900:5900 -d 5900:5900 -j MASQ

ipchains -A forward -p tcp --sport 216.179.555.55 5900:5900 -p tcp --dport 5900:59000 -j MASQ

of course none of these woked for me.

if anyone can show me how to do this, please do
Old 12-02-2001, 10:26 PM   #2
Registered: Nov 2001
Location: atl
Distribution: redhat
Posts: 52

Rep: Reputation: 15
you need to get ipmasqadm

and then do this:

ipmasqadm portfw -A -P tcp -L $IPADDR 80 -R $IPADDR 80
Old 12-04-2001, 03:59 AM   #3
Registered: Apr 2001
Location: London
Posts: 408

Rep: Reputation: 31
Just to build on dangel's comment.

ipchains doesn't do reversed port forwarding through network address translation.
iptables will do this as part of the new MASQ requirements for 2.4 Kernels.

For more info on what's needed for Linux 2.0 & 2.2 Kernels read this:

The correct syntax is with a lower case "-a"
Also install the module as Linux 2.x doesn't use a Monolithic Kernel.

modprobe ip_masq_portfw
ipmasqadm portfw -a -P tcp -L 80 -R 80

What does it all mean:
ipmasqadm = ipmasq admin
portfw = internal port forward option
-a = add
-P = Protocol type
-L = source address port number
-R redirect address port number



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
ipchains forwarding rules scheidel21 Linux - Networking 0 01-20-2004 07:37 AM
IPChains/IPMasqadm Port Forwarding Sonicsone Linux - Networking 8 12-03-2002 01:18 PM
IPChains + port forwarding + redhat 7.2 purduephotog Linux - Networking 2 04-22-2002 04:38 PM
Ipchains port forwarding localy yogee Linux - Networking 7 07-16-2001 11:41 AM

All times are GMT -5. The time now is 12:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration