LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 10-16-2001, 12:55 PM   #1
fddi1
LQ Newbie
 
Registered: Sep 2001
Posts: 5

Rep: Reputation: 0
Question iptables and ftp from the LANs


Hello there,

I'm sure this has been discussed before, but I have yet been able to find a solution.

I'm running RH 7.1 with Netfilters (iptables). I have a very vanilla setting so far. No firewall policies, only NAT. I also have
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
modules loaded. I can ftp to an external ftp site on any of my machine on the LAN, but I can't issue commands like "ls" to retrieve any type of information from the ftp server. Did I miss something in the setup? Thanks in advance.
 
Old 10-16-2001, 04:27 PM   #2
warath
Member
 
Registered: Oct 2001
Location: Ontario, Canada
Distribution: Redhat 9
Posts: 43

Rep: Reputation: 15
what ftp client are you using?
make sure that pasive mode is _ON_
 
Old 10-16-2001, 04:54 PM   #3
fddi1
LQ Newbie
 
Registered: Sep 2001
Posts: 5

Original Poster
Rep: Reputation: 0
ftp and iptables

actually, none of the FTP applications I tried was working. In this case, the standard ftp program in MacOS X (FreeBSD).
 
Old 10-16-2001, 10:19 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
give ncftp a try if you like using terminal based ftp

for gui try DeadFTP, it rocks
 
Old 10-17-2001, 12:19 PM   #5
Sevet
LQ Newbie
 
Registered: May 2001
Posts: 2

Rep: Reputation: 0
The problem is that the ftp client sends its own ip address. This is the internal ip address, not the external ip address so the ftp server doesnt know where to reply to.

You need to install an ftp proxy server. The one I'm using is jftpgw. It basically rewrites the ip addresses so that the ftp server knows the correct external ip address.

In iptables set it up to redirect all traffic going out on port 21 to the your server on whatever port jftpgw is listening on.

You may have some problems with other sites if they use a port other that 21. Either setup iptables to redirect these ports as well (if its a site you use regularly) or connect to the ftp proxy direct and tell it yourself where to connect to.

The alternative, and slightly easier, method is to use PASV (passive) mode in your ftp client. In this mode, your ftp client doesnt need to tell the ftp server the ip address so the problem doesnt occur.
 
  


Reply



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
ftp and iptables eantoranz Linux - Networking 1 07-04-2005 11:24 AM
ftp behind iptables fw PhatZero Linux - Software 1 02-19-2004 04:27 AM
IPTables and FTP - ftp on LAN adamgedde Linux - Newbie 6 10-16-2003 08:11 PM
ftp and ftp port forwarding with IPtables?? FunkFlex Linux - Security 3 04-24-2002 03:03 AM
LANs andymay27 Linux - Networking 1 10-14-2001 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration