Question : FTP connection problems with nas

I am having troubles making an FTP connection to a newly purchased Buffalo Linkstation Pro. I am able to connect inconsistantly. Right now it's about 50/50 chance. I have a linksys wrt54gs router. I've forward both ports 20 and 21 to the internal IP of the Linkstation. I've also purchased a service from DynsDNS to assign a static address to my dynamic IP assigned by my service provider. I've successfully connected using XP FTP, Filezilla, and Fetch. The problem is that I can connect....then I disconnect...and then I try to connect again and I get a "Connection Timed Out" "Could not connect to server". What would be the reason for this? Is there some setting that does not allow reconnecting to the FTP server?

Answer : FTP connection problems with nas

This is a typical symptom that is seen when using a standard port-based firewall for FTP.  You are trying to access a Linkstation that is behind the Linksys router from the public internet, correct?

If the public IP address you connect to on the internet is different from the IP address you assign to the Linkstation itself (you are using Network Address Translation or NAT, which most Linksys internet routers provide), then this is what happens.  When the FTP commands are sent back and forth they contain the IP addresses in the commands, and when the internal address of the FTP server (Linkstation) is different than the public address used the FTP client gets confused when it is told to connect to a different IP address than it originally connected to.

There are only two real solutions, but they have drawbacks.  

1) Switch to a full-featured firewall (Sonicwall, MS ISA server, LINUX-based firewall, or other more expensive ones) that will take the FTP packets and properly rewrite the address passed in the FTP commands.  The drawback of course is spending money on a new firewall.

2) Set up the Linkstation with a public IP address.  In your case since your Linksys router doesn't have an Optional or DMZ port where you can have systems set up with public IP addresses you would basically have to just hook the Linkstation up between your cable or DSL internet connection device and your Linksys device, probably on a network switch or hub if your cable or DSL device only provides one LAN port.  

However, if your cable or DSL device hands out private addresses (192.168.?.? or 10.?.?.?) then neither of those solutions will work.  You won't be able to plug your firewall or the Linkstation in and have it handle the public address traffic directly.

Unfortunately you may just have to drop the idea of using FTP.  FTP is a very old protocol that was not designed for today's complex networks, and most cheap router providers simply don't bother building in the complex support for it.  Even the "business class" Linksys firewalls (RV042, RV082) don't handle FTP correctly, which is how I learned about all this.

Further reading:
http://www.xlightftpd.com/tutorial/setup_behind_firewall.html
http://www.ncftp.com/ncftpd/doc/misc/ftp_and_firewalls.html
Random Solutions  
 
programming4us programming4us