無法在外網建立 FTP 連接

無法在外網建立 FTP 連接

我無法與在一台 Windows 7 電腦上執行的 FTP 伺服器建立連線。我的NAT 路由器打開了5000-5100 和21 端口,我有我的外部IP 位址,LAN 中的FTP 已啟動,已經使用我的外部IP 位址在ftptest.net 和其他FTP 測試儀上進行了測試,一切正常。但是當我嘗試從瀏覽器訪問它時,它說連接被拒絕。也嘗試了一些 Python 和 C# 腳本來列出 FTP 目錄,在 LAN 中沒問題,但使用外部 IP 時,出現相同的錯誤。

FTPTest.net 輸出:

Status: Resolving address of 192.140.xx.xxx
Status: Connecting to 192.140.xx.xxx
Warning: The entered address does not resolve to an IPv6 address.
Status: Connected, waiting for welcome message...
Reply: 220-FileZilla Server 0.9.60 beta
Reply: 220-written by Tim Kosse ([email protected])
Reply: 220 Please visit https://filezilla-project.org/
Command: CLNT https://ftptest.net on behalf of 192.140.xx.xxx
Reply: 200 Don't care
Command: AUTH TLS
Reply: 234 Using authentication type TLS
Status: Performing TLS handshake...
Status: TLS handshake successful, verifying certificate...
Status: Received 1 certificates from server.
Status: cert[0]: subject='CN=192.140.xx.xxx,C=55,ST=Bahia,L=Itabuna,O=Contato Pericia Automotiva,OU=Contato Itabuna,[email protected]' issuer='CN=192.140.xx.xxx,C=55,ST=Bahia,L=Itabuna,O=Contato Pericia Automotiva,OU=Contato Itabuna,[email protected]'
Command: USER anonymous
Reply: 331 Password required for anonymous
Command: PASS ************************
Reply: 230 Logged on
Command: SYST
Reply: 215 UNIX emulated by FileZilla
Command: FEAT
Reply: 211-Features:
Reply: MDTM
Reply: REST STREAM
Reply: SIZE
Reply: MLST type*;size*;modify*;
Reply: MLSD
Reply: AUTH SSL
Reply: AUTH TLS
Reply: PROT
Reply: PBSZ
Reply: UTF8
Reply: CLNT
Reply: MFMT
Reply: EPSV
Reply: EPRT
Reply: 211 End
Command: PBSZ 0
Reply: 200 PBSZ=0
Command: PROT P
Reply: 200 Protection level set to P
Command: PWD
Reply: 257 "/" is current directory.
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to I
Command: PASV
Reply: 227 Entering Passive Mode (192,140,xx,xxx,19,140)
Command: MLSD
Status: Data connection established, performing TLS handshake...
Status: TLS handshake successful, verifying certificate...
Status: Received 1 certificates from server.
Status: cert[0]: subject='CN=192.140.xx.xxx,C=55,ST=Bahia,L=Itabuna,O=Contato Pericia Automotiva,OU=Contato Itabuna,[email protected]' issuer='CN=192.140.xx.xxx,C=55,ST=Bahia,L=Itabuna,O=Contato Pericia Automotiva,OU=Contato Itabuna,[email protected]'
Status: TLS session of transfer connection has been resumed.
Reply: 150 Opening data channel for directory listing of "/"
Reply: 226 Successfully transferred "/"
Listing: type=dir;modify=20161214150710; 2016
Listing: type=file;modify=20170808123602;size=2459; 2016 - Atalho.lnk
Listing: type=dir;modify=20170825193146; 2017
Listing: type=file;modify=20141126124218;size=244012; Apresentação1.png
Listing: type=file;modify=20160615135130;size=376600; BOLSONI RASCUNHO.jpg
Listing: type=file;modify=20170306121017;size=349184; Caixa depesas Contato.xls
Listing: type=dir;modify=20170830151015; CONTATO
Listing: type=file;modify=20141126124820;size=21129; CONTATO.jpeg
Listing: type=dir;modify=20170731185326; Documentos
Listing: type=file;modify=20140204041918;size=3049489; DSC00016.JPG
Status: Skipped display of 10 listing lines
Status: Success

正如我之前所說,路由器連接埠 5000-5100 和 21 是開放的。

在 FileZilla 伺服器選項上:

  • 被動模式設定:
    • 自訂連接埠範圍:5000 - 5100
    • 被動模式傳輸的外部伺服器 IP 位址:
      • 192.140.xx.xxx
  • 基於 TLS 的 FTP 設定:
    • 啟用 FTP over TLS 支持
    • 在預設連接埠 990 上偵聽隱式 FTP over TLS 連接

FileZilla 介面上沒有錯誤或警告。

Windows 上的防火牆:

建立入站規則以允許在本機連接埠 5000-5100 上與協定 TCP 連接,甚至新增 21 和 990 只是為了確保遠端連接埠所有連接埠仍然出現相同的錯誤。

我還可以做些什麼?

答案1

所以,我剛剛再次進行了相同的測試,今天可以正常工作,我不知道為什麼,也許我在不知道的情況下使用外部IP 位址在網路內部進行測試,只是也許......但我的問題現在已經解決了。

相關內容