12月 222010
 

在路由器后,使用filezilla通过active mode连接ftp服务器,有时会遇到经常断线的问题.为什么说”有时”,因为连其中一台服务器正常不断线,连另一台就时常断线,所以许久没找到原因.

今天去filezilla官网看了一下说明,才发现我可能犯了一个错误. 给filezilla限定的port range太窄了,以至于同时传送很多文件时,新的tcp连接没有端口可以使用.

所以,如果你也有相同的困扰,那就把防火墙可允许的port范围调大一点,当然了ftp server的连接数限制不用改变.
同理,如果使用pasv mode,ftp server允许的port range也要大大于连接数限制. 使得传送另一个文件时,有端口可用.

If you do not want to allow incoming connections on all ports, or if you have a NAT router, you need to tell FileZilla to use a specific range of ports for active mode connections. You will have to open these ports in your firewall. If you have a NAT router, you need to forward these ports to the local machine FileZilla is installed on. Depending on your router model, you can either forward a range of ports or you need to forward all ports individually.

Valid ports can be from 1 to 65535; however, ports less than 1024 are reserved for other protocols. It is best to choose ports greater than or equal to 50000 for active mode FTP. Due to the nature of TCP (the underlying transport protocol), a port cannot be reused immediately after each connection. Therefore, the range of ports should not be too small to prevent the failure of transfers of multiple small files. A range of 50 ports should be sufficient in most cases.

4月 182010
 

目录
    
开场白
基础
主动FTP
主动FTP的例子
被动FTP
被动FTP的例子
总结
参考资料
附录 1: 配置常见FTP服务器

开场白

处理防火墙和其他网络连接问题时最常见的一个难题是主动FTP与被动FTP的区别以及如何完美地支持它们。幸运地是,本文能够帮助你清除在防火墙环境中如何支持FTP这个问题上的一些混乱。

本文也许不像题目声称的那样是一个权威解释,但我已经听到了很多好的反馈意见,也看到了本文在许多地方被引用,知道了很多人都认为它很有用。虽然我一直在找寻改进的方法,但如果你发现某个地方讲的不够清楚,需要更多的解释,请告诉我!最近的修改是增加了主动FTP和被动FTP会话中命令的例子。这些会话的例子应该对更好地理解问题有所帮助。例子中还提供了非常棒的图例来解释FTP会话过程的步骤。现在,正题开始了…

基础

FTP是仅基于TCP的服务,不支持UDP。 与众不同的是FTP使用2个端口,一个数据端口和一个命令端口(也可叫做控制端口)。通常来说这两个端口是21-命令端口和20-数据端口。但当我们发现根据(FTP工作)方式的不同数据端口并不总是20时,混乱产生了。 Continue reading »