yet another blog about computer, technology, programming, and internet

Thursday, May 29, 2008

Setting up an FTP Server Behind NAT (Network Address Translation)

Thursday, May 29, 2008 Posted by Ismail Habib , 32 comments
Before starting, I assume that you have enough knowledge about FTP, active and passive mode in FTP, and NAT (Network Address Translation).

My home LAN (Local Area Connection) is consisted of several computers connected to The Internet via a router with a single IP Address, therefore obviously NAT is required. With NAT, there are two types of IP Address, local and global address(es). The computers in my network use local addresses which are only recognized inside my network. On the other hand, the router uses both address, so that it is possible to reach the router from local network or from the internet. I want to use one of my computer as an FTP server that can be accessed from outside my local network. The problem is that with only local address, the computer I used for FTP server couldn't be accessed from outside the local network.

In active mode, client is the one responsible in opening ports for data transmission. However, in passive mode (which is more popular), this responsibility is taken care by server. This is a similar problem from the previous one. The ports which are opened by the server are only available for those in the local network since it is using a local address.

Solution: Port Forwarding

In order to make the local FTP server available for anyone connected to the internet, a port forwarding must be applied to the router. For active mode, you just simply add port 21 (the default port for FTP) and forward it to the FTP server address. For passive mode, the same thing also have to be applied. In addition, several other ports are also need to be opened for data transmission.

I'm using the very common router (LinkSys WRT54GL) with local address I want to open the port 21 and another ports from 60000-60050 for data transmission (this is actually up to you, pick anything above 1024). Open the router's interface from browser: Open the Application & Gaming -> Port Range Forward and fill in as follow ( is my FTP Server's local address).

FTP Server Application

Another important thing that you need to do when using passive mode is setting up the FTP Server application itself. I think most of the FTP server application supports the usage of FTP server behind NAT. I'm going to use the free FileZilla FTP server as an example. In order to make the FTP Server works, you need to let it know about its global address. If you have a fixed address then you just have to tell the application about it, otherwise you will need another tool to retrieve the global address such as the one provided by FileZilla:

To set up the FileZilla FTP server, open the Edit -> Settings menu and choose "Passive mode settings". If you have a fixed IP address (like in my example is, fill in the "Use the following IP" field, otherwise (or if you're not sure), just tick the "Retrieve external IP address from" and fill it with "". Tick both "Don't use external IP for local connections" and "Use custom port range". Fill the port range with the same range that you have filled in the router settings.


  1. I daily set an FTP server to reset switches 'cause I'm part of the IT team of the university but the thing is that I never hard about to set and FTP server behind nat thanks for posting this.

  2. Perfect ideas for your story and great food for thought.

  3. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.

  4. Anonymous4:57 PM

    savior! thanks man! I applied this in linux firewall too and it works great!

    Thank you again!


  5. Anonymous4:54 PM

    Hey There. I found your blog using msn. This is an extremely well written article.
    I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post.

    I will certainly return.

    Visit my web blog: anti malaria pills

  6. Pick Qualified Packers and Movers Ghaziabad for Packing Moving

    Packers and Movers Delhi @
    Packers and Movers Faridabad @
    Packers and Movers Ghaziabad @
    Packers and Movers Noida @

  7. Exoprt Packers and Movers India are known to provide moving and packing services at the rates that actually fit in your budget and make you local shifting solutions experts for amazing rather than being filth only.
    Packers and Movers in Pune
    Packers and Movers in Mumbai
    Packers and Movers in Hyderabad
    Packers and Movers in Bangalore
    Packers and Movers in Chennai

  8. How did you can avail the experts services of listed Adword India's No 1 companies?
    Thanks for information:

  9. Thanks for sharing such a informative article. I hope that this post is really useful for the people who looks for this. Also please check the below links:
    We are expert in Handling, Movers Packers in Ahmedabad and Packing & Shifting of Household Goods, Office goods, Commercial Equipment and Car, Logistics and Transportation.

  10. packers and movers pune,

    packers and movers mumbai,

    packers and movers bangalore,

    packers and movers gurgaon,

  11. Packers and Movers Bangalore amenable and kind administration individual take care of customer's enthusiasm for pressing and transporting and give them as per their bolster and hobby. This is for to meet their individual requests as every one have an alternate safe place. With the yearning to be "THE BEST" Packers Movers Bangalore productively constant frequently work to keep up the tag. What's more, henceforth ruling out grumblings.

  12. Packers and Movers Delhi designate you a simple of covering the administrations like family/private moving, office exchanging, products moving , stacking and emptying, and so on most importantly if there should arise an occurrence of delay additionally we give you the office of warehousing your extensive measure of merchandise.

  13. Generally I don’t read article on blogs, but I would like to say that this write-up very compelled me to take
    a look at and do so! Your writing style has been amazed me.
    Thank you, very great post.
    Please visit our wonderful and valuable website-