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 , 50 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.

Example:
I'm using the very common router (LinkSys WRT54GL) with local address 192.168.1.1. 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: http://192.168.1.1. Open the Application & Gaming -> Port Range Forward and fill in as follow (192.168.1.100 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: http://ip.filezilla-project.org/ip.php.

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 202.169.1.1), 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 "http://ip.filezilla-project.org/ip.php". 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.

50 comments:

  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.

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

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

    ReplyDelete
  4. Anonymous4:57 PM

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

    Thank you again!

    Recommend!

    ReplyDelete
  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

    ReplyDelete
  6. Pick Qualified Packers and Movers Ghaziabad for Packing Moving

    Packers and Movers Delhi @ http://3th.co.in/packers-and-movers-delhi/
    Packers and Movers Faridabad @ http://3th.co.in/packers-and-movers-faridabad/
    Packers and Movers Ghaziabad @ http://3th.co.in/packers-and-movers-ghaziabad/
    Packers and Movers Noida @ http://3th.co.in/packers-and-movers-noida/

    ReplyDelete
  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

    ReplyDelete
  8. How did you can avail the experts services of listed Adword India's No 1 companies?
    Thanks for information: http://www.adword.co.in/

    ReplyDelete
  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:
    http://packersmoversahmedabad.co.in/
    We are expert in Handling, Movers Packers in Ahmedabad and Packing & Shifting of Household Goods, Office goods, Commercial Equipment and Car, Logistics and Transportation.

    ReplyDelete
  10. packers and movers pune, http://www.the5th.in/packers-and-movers-pune.html

    packers and movers mumbai, http://www.the5th.in/packers-and-movers-mumbai.html

    packers and movers bangalore, http://www.the5th.in/packers-and-movers-bangalore.html

    packers and movers gurgaon, http://www.the5th.in/packers-and-movers-gurgaon.html

    ReplyDelete
  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.
    http://blog.packersmoversbangalore.in/
    http://packersmoversbangalore.in/packers-and-movers-vijayawada

    ReplyDelete
  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.
    http://blog.packers-and-movers-delhi.in/
    http://packers-and-movers-delhi.in/packers-and-movers-election-commission-delhi









    ReplyDelete
  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-
    http://packersmoverschennai.in/
    http://packersmoverschennai.in/packers-and-movers-indian-institute-of-technology-chennai
    http://packersmoverschennai.in/packers-and-movers-krishnampet-chennai

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Packers and Movers Kolkata even say that we will go on your stock on time, however the capability for you to trust on us is you can check our customers diagram to affirm that different us from others. Movers And Packers Howarh say and furthermore appear and give you the best association. Every one of these parts of us make our affiliation the most solid and trust capable one among all. Close by these lines said, starting now and into the foreseeable future wards at whatever point you need pressing and moving relationship in an impeccable way you will get in touch with us with no faltering and will prescribe us to others we trust so from you.
    http://kolkatapackersmovers.in/
    http://kolkatapackersmovers.in/packers-and-movers-bhawanipore-kolkata
    Packers and Movers Kolkata

    ReplyDelete
  16. MOVERS AND PACKERS IN BANGALORE regard your sentiments and know the feelings of yours associated with the advantages thus to ensure the well-being and security of your associations is our uttermost need. Therefore we list only the skilled and sound departure workplaces with us. Our organizations are not compelled here just, we outfit you with the free question shape so you can get free relocation refers to from the top packers and movers of your city with a single structure. This is the thing that we and our working methodologies is about, your convenience and your satisfaction.
    http://packers-and-movers-bangalore.in/

    ReplyDelete
  17. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.
    visit :Packers And Movers Hyderbad have earned our name and got so prominent simply in light of our persevering and commitment towards our work. Once on getting your enquiry we seek among the rundown of grouped that could address your issues most likely. - See more at: http://packersmovershyderabadcity.in/
    Packers And Movers Hyderabad

    ReplyDelete
  18. I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://jaipurpackersandmovers.in/
    http://jaipurpackersandmovers.in/packers-and-movers-alwar
    Support by a group of qualified member, well-mannered and careful employees, #PackersMoversJaipur Provide adapted best service for any type of Relocation like Office and Home Shifting whether it is local or domestic.

    ReplyDelete
  19. Get a wide range of packing and moving companies at helloenquiry.in. We endeavour to furnish the best packers and movers companies in Dehradun at ease of Internet. Packers and Movers Dehradun

    ReplyDelete
  20. Are you looking for best packers and movers? Give a call to us.We have an updated database of verified packers and movers companies in India.

    Packers Movers Bangalore

    Bangalore Packers and Movers

    Packers Movers Bangalore

    Ezmove Bangalore

    packers in Bangalore

    ReplyDelete
  21. Thanks for sharing useful information for us.I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://bhubaneswarpackersmovers.in/
    In loading and unloading is done carefully by experienced workers. In addition, #bhubaneswarpackersmovers unpacks the delivery at the target, very efficiently & with maximum care.

    ReplyDelete
  22. I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://packersmoversmumbaicity.in/
    Packers And Movers Mumbai based company provided that Movers And Packers Mumbai Services for Office, Home, Local or domestic and commercial purposes.

    ReplyDelete