我在Windows 2012 R2上运行IIS 8.5。
我创build了一个FTP站点来使用端口8021,当试图使用FileZilla(普通FTP)连接时,出现错误消息“连接超时20秒后超时,无法检索目录列表”。 我在FileZilla中使用活动模式,但是在FileZilla连接窗口中,它显示它自动切换到被动模式。 任何想法为什么? 我必须在IIS中configuration任何不使用被动模式?
14:19:39 Status: Connecting to ip:8021... 14:19:40 Status: Connection established, waiting for welcome message... 14:19:41 Status: Logged in 14:19:41 Status: Retrieving directory listing... 14:20:02 Command: PWD 14:20:02 Response: 257 "/" is current directory. 14:20:02 Command: TYPE I 14:20:02 Response: 200 Type set to I. 14:20:02 Command: PORT 10,0,1,16,5,64 14:20:02 Response: 501 Server cannot accept argument. 14:20:02 Command: PASV 14:20:02 Response: 227 Entering Passive Mode (ip,250,68). 14:20:02 Command: LIST 14:20:02 Response: 150 Opening BINARY mode data connection. 14:20:02 Error: Connection timed out after 20 seconds of inactivity 14:20:02 Error: Failed to retrieve directory listing
提前致谢。
更新:尝试被动模式,仍然没有运气,
09:27:20 Status: Connecting to ip:8021... 09:27:21 Status: Connection established, waiting for welcome message... 09:27:22 Status: Logged in 09:27:22 Status: Retrieving directory listing... 09:27:42 Command: PWD 09:27:42 Response: 257 "/" is current directory. 09:27:42 Command: TYPE I 09:27:42 Response: 200 Type set to I. 09:27:42 Command: PASV 09:27:42 Response: 227 Entering Passive Mode (ip,193,17). 09:27:42 Command: LIST 09:27:42 Response: 150 Opening BINARY mode data connection. 09:27:42 Error: Connection timed out after 20 seconds of inactivity 09:27:42 Error: Failed to retrieve directory listing
更新:解决! https://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7
为IIS FTP防火墙添加端口范围支持服务器节点,并在外部防火墙中打开端口范围以允许被动模式。 感谢Martin指出
您的FTP客户端(FileZilla)在PORT命令中发送本地networkingIP地址。 远程FTP服务器不能连接不同networking中的本地地址。
您必须configuration您的客户端来报告外部IP地址。 在FileZilla中,进入编辑>设置>连接> FTP>活动模式>活动模式IP 。
你将不得不configuration你的本地防火墙和/或NAT来允许/路由传入的连接。 其实这是没有道理的。 没有人使用主动FTP模式,正是因为这个原因。