LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-27-2003, 02:30 PM   #1
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Rep: Reputation: 15
VSFTPD Running But Cannot Connect from another machine


I can start VSFTPD manually on my Linux box and then do a

ftp -u localhost

and it seems to login and display the directories etc. without any problems. However, if I then change to my Windows XP box and do

ftp 127.21.1.101 (IP address assigned via LinkSys DHCP for my Linux box), I get:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Scott Forsgren>ftp 127.21.1.101
> ftp: connect :Unknown error number
ftp> user
Not connected.
ftp> open
To 127.21.1.101
> ftp: connect :Unknown error number
ftp>

Where would I look to see why it is failing?

Thanks
 
Old 04-28-2003, 01:18 AM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
You can use the ftp -v command to get verbose output of the connection attempt. Sounds like a firewall problem though. Check iptables to see if you're allowing incoming ftp connections and check /etc/hosts.allow to see if tcpwrappers is the problem. There should probably be an entry like:

FTPD: xxx.xxx.xxx.xxx for your windowsXP boxes ip address.

It might also be your linksys router. If your trying to connect from outside the LAN you'll have to setup the Linksys to forward ftp connections to your linux box. If your trying to connect from the LAN side, it shouldn't block the traffic.
 
Old 04-28-2003, 10:51 PM   #3
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Original Poster
Rep: Reputation: 15
Hi Capt_Caveman,

Thanks for the ideas. I tried ftp -v but did not get any different output. For my Windows XP FTP, -v shows

-v Suppresses display of remote server responses.

I tried the -d option as well which says it enabled debugging information. Same thing.

I was able to get the Linksys port mapping working and I can access my FTP server from my AOL Account. I just cannot access it from the standard FTP utility on my Windows XP box accessing the FTP Server on my Linux box. So the easy part is not working (WinXP) but the hard part is (getting this all working from the external internet).

I checked hosts.allow and actually I do not have any entries in that file at all.

I know that my vsftpd.conf file does have tcpwrappers=yes. Is that part of the problem? Why would I be able to connect from external but not from my local Windows box?

Thanks again
 
Old 04-29-2003, 02:26 AM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Sorry, my bad. The -v option is for verbose output in Linux. If you can login from the outside, it sound like everything with the linux ftp daemon is alright. If you don't have any entries in either hosts.allow or hosts.deny, then tcpwrappers won't block any of the traffic, so that's alright. Double check the ip address of the linux box (use ifconfig command as root). But it sounds like the firewall though. Try this:

more /etc/sysconfig/iptables

Look for entries that involve ftp (port 21). You should see something that vaguely resembles this:

-A INPUT -p tcp --dport 21 -j ACCEPT

The INPUT, --dport 21, and ACCEPT part are what you're looking for. My guess is that because your Linksys router is also your DHCP server, it's ip address is punched through the filewall automatically. Your external traffic might be getting masqueraded by the router, but your local LAN traffic isn't, so you may have to add an iptables entry for your LAN addresses. Any error messages will likely go to /var/log/messages or /var/log/secure. But the vsFTP.conf file should have an entry telling you where the error messages are logged to by default.
 
Old 04-29-2003, 09:57 PM   #5
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Original Poster
Rep: Reputation: 15
I do not have an iptables in /etc/sysconfig. I found an iptables script in /etc/rc.d/init.d, but nothing in /etc/sysconfig. I looked at the script and it shows /etc/sysconfig as the correct location, but no file. Should there be?

The only thing I do find in /var/log/messages that looks out of order is:

Apr 27 14:38:24 localhost vsftpd: warning: can't get client address: Bad file descriptor

Thoughts?

Thanks!
 
Old 04-29-2003, 11:03 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
>but nothing in /etc/sysconfig

That's odd. I double checked the location at the Redhat website to see if they moved it or something in RH9, but it said that it should be in the same place(/etc/sysconfig/iptables). You might not have enabled the firewall when you installed. Anyway it doesn't really matter for now, just do:

service iptables stop

to turn off iptables for now. See if that makes a difference. Also, from your windows box, try to ftp to the external ip address that is assigned to the router (you can find it using the Linksys web-administration interface).

Other things to try:
1. See if you can telnet to port 21 of the linux box. If you can, that means the windows FTP client is the problem.
Just do telnet 127.21.1.101 21
If it works, you'll see a greeting banner. If not, you won't see anything.

2. See if you can ping the linux box from windows.
 
Old 04-29-2003, 11:29 PM   #7
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Original Poster
Rep: Reputation: 15
Ah, I didn't realize that the iptables was only created if I had the firewall enabled. I had disabled it for some other debugging. I re-enabled it and now see:

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 21 --syn -j ACCEPT

I did do the stop and then tried to connect again but still got the same unknown connect error.

If I FTP to the IP Address of the router from my XP box much like I did from AOL externally, that works fine. I just cannot go directly to the Linux box via IP address.

Using telnet, I get

Could not open connection to host port 21: Connect failed.

So something going on with getting to the box or port 21. ping works fine.

Thanks Capt_Caveman!
 
Old 04-30-2003, 12:07 AM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
I don't think this is the problem, but put an entry in /etc/hosts.allow like this:

vsftpd: ALL
 
Old 04-30-2003, 11:22 PM   #9
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Original Poster
Rep: Reputation: 15
I added it and restarted vsftpd but still have the same problem. Hmm.. Ugly. Thanks for the advice!
 
Old 05-01-2003, 12:03 AM   #10
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
I think the problem has to do with the way the Linksys is doing its routing. If you're absolutely set on being able to access it by its internal LAN address, take a look at the documentation for the router at the Linksys site and try to do forwarding a different way. I think there are at least 2 options, standard port forwarding and uPnP. I actually realized that I have a similar problem occuring with a webserver on a LAN at work (I just never tested it from inside) and it has to do with the way the NAT is setup (specifically that SNAT'ing isn't setup). I think if you setup uPNP and static LAN addresses for the internal boxes, it can route the internal requests. If that doesn't work, I would recommend a large sledgehammer or 2x4 with a spike through it.
 
Old 05-01-2003, 11:55 PM   #11
SForsgren
Member
 
Registered: Apr 2003
Location: San Jose
Distribution: Red Hat 9
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks for the advice. I think I am going for the sledgehammer! Appreciate the comments.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba: can't connect to my local linux machine but can connect to windows. Royle Linux - Networking 3 01-18-2005 05:32 PM
vsftpd on redhat 9 machine pfunk Linux - Networking 4 12-06-2004 12:41 PM
VSFTPD Setup - Connect problem nadsab Linux - Software 4 08-29-2004 09:03 PM
vsftpd - Can't connect externally??? Xgkkp Linux - Networking 5 08-30-2003 12:50 PM
could not connect my vsftpd server exper Linux - Networking 2 07-26-2003 02:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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