How FTP server after NAT is configured

Source: Internet
Author: User
Tags ftp connection ftp client filezilla

Today, there is a problem: the system developed by the company, after the customer room on-line, because the FTP server can not directly hook up on the outside of the network, you must pass the NAT mapping on the router.

Suppose our router extranet IP is 1.2.3.4,ftp with an intranet IP of 192.168.1.100,ftp with a port number of 10000. Use FileZilla server as the FTP server.

At this point, you need to open port 10000 on the router and map to the FTP IP and port.

FileZilla server is set to PASV mode, the port is set to 10000-10000, and the specified IP is 1.2.3.4.

Outside the network, with FileZilla client login, because the client defaults to PASV mode, found that can log on, but unable to achieve data transmission. After you modify it to port mode, you can transfer it normally.

FTP connection via an app on the phone, because the default is PASV mode, log on is also available, but data transfer is not possible. After modifying to port mode, the data is still not being transferred properly.

Having not studied a similar problem before, just take this opportunity to get a deeper understanding of what the difference is between PASV and port. Assume that C is client,s for server.

PASV: When C is connected to S, s will send message to client C, this information is (s) open a port m locally, you can now connect me. When C receives this information, it can connect to the M port of S, and after the connection is successful, the data connection is established.

Port: When C is connected to S, C sends a command to tell S (I opened a port on the local n waiting for you to connect the data). When s receives this command, it connects to the port N that the client opened, and the data connection is generated.

After understanding the principle, we are looking at the actual configuration of the situation. Obviously, on FileZilla server, specifying only 10000 is not possible, you need to give a contiguous range of ports, such as 10000-10005, and then map the above port range on the router.

After you try this scenario, the problem is solved successfully.

Why not use the port mode? The biggest problem with Port mode is that if the FTP client is also behind a NAT, obviously the channel from S to C is not.

To avoid this limitation, the adoption of PASV is a reasonable choice.

How FTP server after NAT is configured

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.