LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-24-2003, 12:47 PM   #1
Belize
Member
 
Registered: Jul 2003
Posts: 113

Rep: Reputation: 15
NEWBIE ! Problem with Networking - CANT FTP


Greetings
Im using LAN and I recently got a second box that I use for server ( Red Hat 9 ). THe cable modem is connected to the server and It routes the net to my box. My IP is 192.168.20.1 the servers IP is 192.168.20.3. Here is what /etc/rc.local contains - Im trying to be explanatory so you can help me best
Quote:
[root@Cuba root]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

iptables -t nat -A POSTROUTING -s 192.168.20.1 -j SNAT --to-source 217.79.38.168
echo 1 >/proc/sys/net/ipv4/ip_forward
Since I started using the server (gateway), I cant FTP sites from my box. I use WinXP on it. The server CAN FTP sites, but I cant.
The problem is comeing after I send user & pass, have a look at what CuteFTP tells me

Quote:
230 Restricted user logged in.
STATUS:> Login successful
COMMAND:> TYPE I
200 Type okay.
COMMAND:> pwd
257 "/" is cwd.
COMMAND:> TYPE A
200 Type okay.
STATUS:> Retrieving directory listing...
COMMAND:> PORT 192,168,20,1,17,106
200 PORT command successful.
COMMAND:> LIST
550 Cannot connect to 192.168.20.1:4458 - No route to host.
ERROR:> File error
COMMAND:> TYPE A
It says No route to host and the port in this case is 4458. I noticed that the same error occurs but the port is random ( usually 1000,2000 something ) Please help me fix that bug. Peace
 
Old 07-24-2003, 12:57 PM   #2
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
The reason why the port is random is because your in FTP passive mode. While in this mode, every time you make a connection, a different port will be negotiated to talk on instead of just port 21 (active mode).

Try changing your FTP client (CuteFTP) to active mode. If that doesn't work, you may need to look further into your firewall (iptables) setup on your server to see why it's not routing the port(s) properly.

Regards,
Erik
 
Old 07-24-2003, 05:50 PM   #3
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
Quote:
The reason why the port is random is because your in FTP passive mode.
This isn't quite correct. The way servers work is that you send the request on port xx but then the server talks to your client and negotiates a port at a higher number.

I believe that your router iptables script is the problem.

I use the following lines to do what you are doing.

INTERNALNET="192.168.168.0/24"
EXT_IFACE1="eth1"
EXTERNAL=`ifconfig $EXT_IFACE1 | grep "inet addr:" | \awk -F: {'print $2'} | cut -d\ -f 1`


# This line tells INTERNALNET to use $EXTERNAL IP address
$IPT -t nat -I POSTROUTING -s $INTERNALNET -j SNAT --to $EXTERNAL

iptables -I INPUT -p ALL -i eth0 -s 192.168.168/24 -j ACCEPT
iptables -I OUTPUT -p ALL -s 192.168.168/24 -j ACCEPT
iptables -I FORWARD -i eth0 -d 0/0 -p all -j ACCEPT

If you would like to see the rest of my firewall script I would be happy to share it with you but it is a little large to post here.
email me at bbenz3@hotmail.com
 
Old 08-01-2003, 12:23 PM   #4
Belize
Member
 
Registered: Jul 2003
Posts: 113

Original Poster
Rep: Reputation: 15
*BUMPIN*
CuteFTP CANNOT GO into active mode. And Im pretty sure thats not a problem - its has something to deal with iptables.
PLEASE HELP !!!
 
Old 08-17-2003, 10:38 PM   #5
Belize
Member
 
Registered: Jul 2003
Posts: 113

Original Poster
Rep: Reputation: 15
*BUMP*
 
Old 08-18-2003, 12:41 AM   #6
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
I am not really sure what you mean by active mode as I do not use that particular piece of software. Please give more details about what you are trying to do and what is wrong.
 
Old 08-18-2003, 07:51 AM   #7
Belize
Member
 
Registered: Jul 2003
Posts: 113

Original Poster
Rep: Reputation: 15
I cant FTP from the box I use for PC ( WinXP&FREEBSD ) ( 192.168.20.1 )
if I log on to my server ( RED HAT 9 ) ( 192.168.20.3 ) I can FTP sites.
There is something wrong with the PC and server networking - Im sure its not because of OS/Software

Last edited by Belize; 08-18-2003 at 07:52 AM.
 
Old 08-18-2003, 11:33 AM   #8
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
either email me or post your entire iptables script. There is something wrong with how you have it setup. Also make sure that ipchains is not running and that the default firewall isn't running.

you can remove the built in firewall by removing the rpm lokkit.
to do this do:
rpm -e lokkit
and if any dependencies show up remove them as well.
 
Old 08-18-2003, 11:37 AM   #9
Belize
Member
 
Registered: Jul 2003
Posts: 113

Original Poster
Rep: Reputation: 15
I dont use firewall and what iptables script should I paste ? I just formatted and installed red hat 9 again ( there was some freaking segmentation error when loading the services ).
And the only thing I have manually set up is /etc/rc.local , which you can see quoted at the top of the thread.

Cant you post the script here ? I mailed you once on your first reply ...
and btw which file is the iptables scipt ?
Thanks
 
Old 08-18-2003, 11:47 AM   #10
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
I am sorry that I missed your email. My spam killer probably caught it somehow and I didn't see it. I don't have it running right now so I will definitely get your email.
sorry,
BB
 
  


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
Help Newbie Networking rmsat Linux - Networking 2 06-29-2004 04:26 PM
newbie: installing to WINXP using VMWare: networking problem quentin_compson Fedora - Installation 2 02-11-2004 03:22 PM
Networking Newbie Nice Guy Eddie Linux - Networking 1 05-04-2003 01:35 AM
Networking newbie lolmc Linux - Networking 3 12-29-2001 07:58 AM
very newbie ftp problem thewoz Linux - Newbie 5 10-16-2001 10:48 AM

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

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