- 论坛徽章:
- 0
|
最近看坛子里面有人在讨论一些ftp遇到防火墙时怎么处理的问题。发现很多人都建议使用passive模式,或者打开21、20端口,但是并没有给出理由。
查了一些文档,请看:
Unlike most protocols used on the Internet, FTP requires multiple network ports to work properly. When an FTP client application initiates a connection to an FTP server, it opens port 21 on the server — known as the command port. This port is used to issue all commands to the server. Any data requested from the server is returned to the client via a data port. The port number for data connections and the way in which data connections are initialized vary depending upon whether the client requests the data in active or passive mode.
The following are descriptions of these two modes:
active mode
Active mode is the original method used by the FTP protocol for transferring data to the client application. When an active mode data transfer is initiated by the FTP client, the server opens a connection from port 20 on the server to the IP address and a random, unprivileged port (greater than 1024) specified by the client. This arrangement means that the client machine must be allowed to accept connections over any port above 1024. With the growth of insecure networks, such as the Internet, the use of firewalls to protect client machines is now prevalent. Because these client-side firewalls often deny incoming connections from active mode FTP servers, passive mode was devised.
passive mode
Passive mode, like active mode, is initiated by the FTP client application. When requesting data from the server, the FTP client indicates it wants to access the data in passive mode and the server provides the IP address and a random, unprivileged port (greater than 1024) on the server. The client then connects to that port on the server to download the requested information.
所以,当FTP遇到防火墙时,并不是passive模式或者是active模式就一定可以。具体问题具体分析。
[ 本帖最后由 dotone 于 2008-7-16 11:03 编辑 ] |
|