LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-26-2002, 10:11 AM   #1
Milkman00
Member
 
Registered: Jul 2002
Location: Tampa Bay area of FLORIDA!
Distribution: Slackware 8.1
Posts: 73

Rep: Reputation: 15
FTP to a machine BEHIND Firewall


Hello all:

I searched and searched this forum, and could not find the answer. I know its probably simple, but everything I find cannot make it work.

I am using Slack 2.4.19. I have my "firewall" using IP masquerading (iptables) set up as 192.168.0.1. I have a Windows computer BEHIND that firewall at 192.168.0.2 running BulletProof FTP. What is the command to forward port 21 for using FTP services to 192.168.0.2, so that if someone ftp's to my external IP, it will forward to 192.168.0.2 INTERNALLY.

PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!
 
Old 09-26-2002, 10:20 AM   #2
peter_robb
Moderator
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
My favourite tutorial is here
http://www.netfilter.org/documentati...ials/blueflux/

and you need a -j DNAT in the PREROUTING chain for port 20.

Regards,
Peter
 
Old 09-26-2002, 08:22 PM   #3
Milkman00
Member
 
Registered: Jul 2002
Location: Tampa Bay area of FLORIDA!
Distribution: Slackware 8.1
Posts: 73

Original Poster
Rep: Reputation: 15
Shouldn't it be port 21??? I tried the following line to no avail:

iptables -t nat -A PREROUTING -p tcp --dport 21 -i eth0 -j DNAT --to 192.168.0.2:21

Any help will be appreciated.
 
Old 09-26-2002, 09:55 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
FTP uses two ports: 20 for data and 21 for commands. You'll need to make sure that both ports pass through. In addition, passive versus active FTP might be the culprit.
 
Old 09-27-2002, 06:08 AM   #5
Milkman00
Member
 
Registered: Jul 2002
Location: Tampa Bay area of FLORIDA!
Distribution: Slackware 8.1
Posts: 73

Original Poster
Rep: Reputation: 15
Well, as the last suggestion stated, I now have the following lines:

iptables -t nat -A PREROUTING -p tcp --dport 21 -i eth0 -j DNAT --to 192.168.0.2:21
iptables -t nat -A PREROUTING -p tcp --dport 20 -i eth0 -j DNAT --to 192.168.0.2:20

Still no go.

Any ideas what I should change the commands to?

PLEASE HELP!!!!!!!!!!!!!
 
Old 09-27-2002, 11:40 AM   #6
Milkman00
Member
 
Registered: Jul 2002
Location: Tampa Bay area of FLORIDA!
Distribution: Slackware 8.1
Posts: 73

Original Poster
Rep: Reputation: 15
ANYONE???
 
Old 09-27-2002, 03:23 PM   #7
TruckStuff
Member
 
Registered: Apr 2002
Posts: 498

Rep: Reputation: 30
Are you using passive or active FTP transfers?
 
Old 09-27-2002, 04:05 PM   #8
Milkman00
Member
 
Registered: Jul 2002
Location: Tampa Bay area of FLORIDA!
Distribution: Slackware 8.1
Posts: 73

Original Poster
Rep: Reputation: 15
What do you mean exactly??? I guess I am using whatever Windows does, because Bulletproof FTP is on Windows.
 
Old 09-29-2002, 02:25 PM   #9
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 547

Rep: Reputation: 30
Active ftp uses port 20 and 21.

Passive ftp really sucks if you are setting up a good firewall. It uses port 20 and it takes a random port above port 1024. The best way to enable passive ftp on your firewall is with modules for connection tracking. I've tryed it myself once and i couldnt make it work. It just opened all ports above port 1024, not for only ftp but for all services.

To set your ftp program to passive or to active ftp, you could try the command: pasv
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up mail on machine behind a firewall Khang Linux - Networking 8 01-26-2005 11:54 AM
two ftp servers on same machine alpesh Linux - Security 3 08-20-2003 10:20 PM
Cannot FTP to RedHat 7.1 Machine Geams Linux - Networking 8 09-09-2001 08:30 PM
Whole bunch of UDP ports open on firewall machine AllenWood Linux - Networking 1 03-07-2001 10:46 AM
Whole bunch of UDP ports open on firewall machine AllenWood Linux - Security 1 03-06-2001 06:45 PM


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

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