FileZilla FTP 的被動模式不起作用
我們在 Windows server 2008 R2 上執行 FileZilla 伺服器 0.9.37
活動模式工作正常,伺服器上的 Windows 防火牆已關閉。
我們的路由器是 DrayTek vigor 2820。在 NAT 下,打開埠,我為伺服器本地 IP 打開了以下埠
TCP 20-22、TCP 45100-65535
在 FileZilla 伺服器中,在被動模式設置下(我無法發布圖像,所以……)
Use the following IP: 213.106.150.123 Don't use external IP from local connections: Checked Use custom port range: 45100-65535
從我 RDP 進入的德國遠端伺服器上,我嘗試連接回 FileZilla 伺服器。
Status: Connecting to 213.106.150.123:21... Status: Connection established, waiting for welcome message... Response: 220 -- Command: USER ftp_001471 Response: 331 Password required for ftp_001471 Command: PASS ******** Response: 230 Logged on Status: Connected Status: Retrieving directory listing... Command: CWD / Response: 250 CWD successful. "/" is current directory. Command: TYPE I Response: 200 Type set to I Command: PASV Response: 227 Entering Passive Mode (213,106,150,123,238,133) Command: MLSD Response: 425 Can't open data connection. Error: Failed to retrieve directory listing
FileZilla 伺服器上的狀態視窗報告以下內容
(not logged in) (87.106.131.22)> Connected, sending welcome message... (not logged in) (87.106.131.22)> 220 -- (not logged in) (87.106.131.22)> USER ftp_001471 (not logged in) (87.106.131.22)> 331 Password required for ftp_001471 (not logged in) (87.106.131.22)> PASS ******** ftp_001471 (87.106.131.22)> 230 Logged on ftp_001471 (87.106.131.22)> CWD / ftp_001471 (87.106.131.22)> 250 CWD successful. "/" is current directory. ftp_001471 (87.106.131.22)> TYPE I ftp_001471 (87.106.131.22)> 200 Type set to I ftp_001471 (87.106.131.22)> PASV ftp_001471 (87.106.131.22)> 227 Entering Passive Mode (213,106,150,123,195,197) ftp_001471 (87.106.131.22)> MLSD ftp_001471 (87.106.131.22)> 425 Can't open data connection.
如果我將 FileZilla 被動模式設置從我們的外部 IP 更改為預設值,我會從嘗試連接的德國客戶端獲得以下詳細資訊。
Status: Connecting to 213.106.150.123:21... Status: Connection established, waiting for welcome message... Response: 220 -- Command: USER ftp_001471 Response: 331 Password required for ftp_001471 Command: PASS ******** Response: 230 Logged on Status: Connected Status: Retrieving directory listing... Command: CWD / Response: 250 CWD successful. "/" is current directory. Command: TYPE I Response: 200 Type set to I Command: PASV Response: 227 Entering Passive Mode (213,106,150,123,196,198) Command: MLSD Response: 425 Can't open data connection. Error: Failed to retrieve directory listing
以及伺服器上的詳細資訊。
(not logged in) (87.106.131.22)> Connected, sending welcome message... (not logged in) (87.106.131.22)> 220 -- (not logged in) (87.106.131.22)> USER ftp_001471 (not logged in) (87.106.131.22)> 331 Password required for ftp_001471 (not logged in) (87.106.131.22)> PASS ******** ftp_001471 (87.106.131.22)> 230 Logged on ftp_001471 (87.106.131.22)> CWD / ftp_001471 (87.106.131.22)> 250 CWD successful. "/" is current directory. ftp_001471 (87.106.131.22)> TYPE I ftp_001471 (87.106.131.22)> 200 Type set to I ftp_001471 (87.106.131.22)> PASV ftp_001471 (87.106.131.22)> 227 Entering Passive Mode (192,168,1,4,195,198) ftp_001471 (87.106.131.22)> MLSD ftp_001471 (87.106.131.22)> 425 Can't open data connection.
我究竟做錯了什麼?
當我指定外部 IP 時,客戶端和伺服器報告相同,但埠被搞砸了,當我預設執行時,伺服器使用其內部 IP,但埠分配看起來更好。
編輯:更多測試及其工作。
所以我在 IIS 7.5 中安裝了 FTP 伺服器,禁用了 FileZilla 並且它工作了!然後我嘗試重新啟用 FileZilla,這也奏效了!這一切都來自我家的 ADSL 連接。
然後我從我們位於德國的遠端伺服器再次嘗試,但失敗了,掛在 IIS FTP 和 FileZilla 的被動模式下的目錄列表中。
我猜德國數據中心的防火牆/路由器有問題。我真的不想弄亂遠端伺服器路由器(我什至不確定我是否可以更改託管的防火牆規則)我擔心企業客戶在嘗試訪問我們的 FTP 站點時會遭受同樣的命運。
我建議您嘗試使用 Windows 的 FTP 或其他已安裝的客戶端在伺服器上進行本地操作。通過這種方式,您將看到是網路/防火牆問題還是 FTP 伺服器的配置問題。如果有命令,還要檢查 Filezilla 伺服器的日誌文件。
如果它依賴於防火牆,這裡有一篇 TechNet 文章可能會有所幫助:如何為被動模式 FTP 伺服器配置 Windows 防火牆。但是您寫道Windows防火牆已關閉,所以我認為這是外部防火牆/路由器的問題(還要檢查客戶端)。