IPChains and forwarding...

I've got one machine set up as a firewall/masquerading machine. I have another behind it on my LAN that's set up to do web serving, ftp serving, etc. How can I use IPChains to forward all packets on the outside NIC (eg on port 21 to the inside machine's (eg port 21. It'd be really cool if you could give me the command with all the options attached :). Thanks.

ipchains -I forward ...(?)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Manfred BertlManagerCommented:
ipchains -A forward -s 21 -d 21 -i eth0

jguerinAuthor Commented:
 mmmm... I'm not sure about that... but I'll try it. From what I've read in the man pages, that will just allow all packets with those respective source/destinations to go from the firewall to my other server... but I don't think that it actually will forward the connections from to but I'll give it a shot.
check out ipmasqadm

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

if i remember the syntax right...
portfw works by reverse-masq so you must have a masq rule to
``take the reply packets out

(something like this)
   # ipchains -I forward -p tcp -s internal_IP/32 80 -j MASQ

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

You also have to enable somethings in the kernel...

btw You have a FAQ on:
Sorry.. I'm to tired right now.
The syntax is
ipmasqadm portfw -a -P tcp -L 21 -R 21

I thought that you wanted to forward the www-server (port 80)
If you like to forward a ftp-server I think you also have to forward port 20 (ftp-data)
otherwise you can only use passive-mode in youre ftp-client when you connect to youre ftp from outside...
jguerinAuthor Commented:
Heheh, well I was hoping to find some way to get ipchains to do it. I guess it turns out that ipchains is only for packet filtering. Too bad. I just ran into ipmasqadm the other day and am trying to install it now. Thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.