LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-29-2003, 08:09 AM   #1
mafa
LQ Newbie
 
Registered: Jan 2003
Posts: 6

Rep: Reputation: 0
ftp server behind linux box


Hi All!

I have the following problem - I want to install an FTP server behind a linux gateway.

I installed it (on a windows machine), but I cannot use it from the internet.
The linux box has no proxy, only iptables.
I have an ftp server running on linux, too (port 21)
I made the following settings:

iptables -t nat -A PREROUTING -p tcp -i eth0 -d NET-IP --dport 5002 -j DNAT --to ftp_machine_ip:21

I can connect to it (on port 5002), but when I try to download or list something, the client and server repllies, that the data channel cannot be made... :-( (I allow all outgoing connection form the internal network)

What is wrong?

Thanks: MaFa
 
Old 09-29-2003, 09:49 AM   #2
sal_paradise42
Member
 
Registered: Jul 2003
Location: Utah
Distribution: Gentoo FreeBSD 5.4
Posts: 150

Rep: Reputation: 16
what is the gateway on the outgoing machine ?
it should be the linux box
 
Old 09-29-2003, 09:58 AM   #3
mafa
LQ Newbie
 
Registered: Jan 2003
Posts: 6

Original Poster
Rep: Reputation: 0
It is, of course.
The internal machine works well, can see the net, and so on....
 
Old 09-29-2003, 10:54 AM   #4
slightcrazed
Member
 
Registered: May 2003
Location: Lisbon Falls, Maine
Distribution: RH 8.0, 9.0, FC2 - 4, Slack 9.0 - 10.2, Knoppix 3.4 - 4.0, LFS,
Posts: 789

Rep: Reputation: 30
Doesn't FTP use a 2nd connection for data control? Port 20 I think (by default). Sounds like that might be the issue.

slight
 
Old 09-29-2003, 02:52 PM   #5
sal_paradise42
Member
 
Registered: Jul 2003
Location: Utah
Distribution: Gentoo FreeBSD 5.4
Posts: 150

Rep: Reputation: 16
what ftp program are you using?
 
Old 09-29-2003, 02:54 PM   #6
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
dont forget to allow forwarding too if your linux machine is a router

iptables -A FORWARD -i eth0 -p tcp --dport 5002 -j ACCEPT

and you need the ftp conntrack module installed...

ip_conntrack_ftp

Last edited by hakcenter; 09-29-2003 at 02:57 PM.
 
  


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 from LInux to Serv-U ftp server problem csross Linux - General 2 11-07-2005 04:35 PM
FTP files from DOS box to LINUX box lobo1 Linux - Software 4 06-02-2005 10:57 AM
ftp from linux box via internet azacid Linux - Networking 14 06-14-2004 07:00 AM
Can't ftp into Linux box bal Linux - Networking 5 03-18-2002 06:05 AM
Can't FTP to my Linux box Kiwisheep Linux - Networking 2 03-09-2001 01:10 AM

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

All times are GMT -5. The time now is 06:13 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