如何连接局域网外的ftp服务器?

如何连接局域网外的ftp服务器?

我正在设置家庭 FTP 服务器,以便我可以与局域网外的朋友共享一些文件。我正在使用 filezilla 服务器,并且已配置好一切。http://www.canyouseeme.org/甚至看到我的端口 21 已打开,但是当我通过 fit 客户端或通过 Web 浏览器连接时,它会显示“530 用户 saravana 访问被拒绝”。

我该如何解决这个问题,我检查了用户名和密码,一切都很好,但我没有发送任何被动模式,(我不知道如何设置),如果这导致了麻烦,有人可以帮助我,但我可以通过本地主机进行本地连接。

    (000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> Connected, sending welcome message...
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220-FileZilla Server version 0.9.34 beta
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220-written by Tim Kosse ([email protected])
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> USER anonymous
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 331 Password required for anonymous
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> PASS *******************
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 530 Login or password incorrect!
(000001) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> disconnected.
(000002) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> Connected, sending welcome message...
(000002) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220-FileZilla Server version 0.9.34 beta
(000002) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220-written by Tim Kosse ([email protected])
(000002) 3/22/2010 16:56:04 PM - (not logged in) (192.168.1.9)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000002) 3/22/2010 16:56:09 PM - (not logged in) (192.168.1.9)> USER saravana
(000002) 3/22/2010 16:56:09 PM - (not logged in) (192.168.1.9)> 331 Password required for saravana
(000002) 3/22/2010 16:56:09 PM - (not logged in) (192.168.1.9)> PASS ********
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 230 Logged on
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> SYST
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 215 UNIX emulated by FileZilla
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> PWD
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 257 "/" is current directory.
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> TYPE I
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 200 Type set to I
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> PASV
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 227 Entering Passive Mode (192,168,1,9,212,191)
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> SIZE /
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> MDTM /
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> RETR /
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> PASV
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 227 Entering Passive Mode (192,168,1,9,212,193)
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> CWD /
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 250 CWD successful. "/" is current directory.
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> LIST
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 150 Connection accepted
(000002) 3/22/2010 16:56:09 PM - saravana (192.168.1.9)> 226 Transfer OK
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> PASV
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 227 Entering Passive Mode (192,168,1,9,212,196)
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> SIZE /favicon.ico
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> MDTM /favicon.ico
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> RETR /favicon.ico
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 550 File not found
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> PASV
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 227 Entering Passive Mode (192,168,1,9,212,198)
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> CWD /favicon.ico
(000002) 3/22/2010 16:56:11 PM - saravana (192.168.1.9)> 550 CWD failed. "/favicon.ico": directory not found.
(000002) 3/22/2010 16:56:14 PM - saravana (192.168.1.9)> disconnected.
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> Connected, sending welcome message...
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220-FileZilla Server version 0.9.34 beta
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220-written by Tim Kosse ([email protected])
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> USER anonymous
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 331 Password required for anonymous
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> PASS *******************
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 530 Login or password incorrect!
(000003) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> disconnected.
(000004) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> Connected, sending welcome message...
(000004) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220-FileZilla Server version 0.9.34 beta
(000004) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220-written by Tim Kosse ([email protected])
(000004) 3/22/2010 16:56:15 PM - (not logged in) (192.168.1.9)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000004) 3/22/2010 16:56:18 PM - (not logged in) (192.168.1.9)> USER saravana
(000004) 3/22/2010 16:56:18 PM - (not logged in) (192.168.1.9)> 331 Password required for saravana
(000004) 3/22/2010 16:56:18 PM - (not logged in) (192.168.1.9)> PASS ********
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 230 Logged on
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> SYST
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 215 UNIX emulated by FileZilla
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> PWD
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 257 "/" is current directory.
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> TYPE I
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 200 Type set to I
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> PASV
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 227 Entering Passive Mode (192,168,1,9,212,202)
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> SIZE /New Text Document.txt
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 213 5
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> MDTM /New Text Document.txt
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 213 20100322110559
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> RETR /New Text Document.txt
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 150 Connection accepted
(000004) 3/22/2010 16:56:18 PM - saravana (192.168.1.9)> 226 Transfer OK
(000004) 3/22/2010 16:58:18 PM - saravana (192.168.1.9)> 421 Connection timed out.
(000004) 3/22/2010 16:58:18 PM - saravana (192.168.1.9)> disconnected.

答案1

考虑到您提到的所有内容以及日志中的信息:您正在尝试通过公共地址连接到 ftp 服务器,该地址是不正确我不会详细介绍数据包路由和其他内容,只会用简单的话来讲述:

  • 公共(WAN)地址用于外部世界
  • 私有(LAN)地址用于企业网络

因此,如果您设置了 ftp 服务器,只要它位于您的公司网络内,就使用私有地址连接它。
或者,如果您确实想使用相同的公共地址连接它,则需要在路由器上设置路由表,这样它就会将 IP 转换为不同的地址(所谓的 NAT)。

答案2

您可以进入路由器的设置页面,配置通过端口 21 的每个外部连接,并将其重定向到您的 filezilla 服务器。这称为 NAT。

相关内容