FTP server behind a NAT (pure-ftpd)
Translation of the original in Catalan. Read it in: CatalàCastellano
Often when we set up an FTP server behind a Firewall that does DNAT to publish the FTP ports (20, 21, tcp and udp) to the internet, FTP stops working in Passive On mode. Then we have to do that so annoying and, depending on the client, so difficult thing; that is, set a Passive Off so that the file transfers, file listings, etc. work properly. Well, today, tired of that on a pure-ftpd server that I have set up at work, I have solved it, because otherwise the technicians were very limited when they were at the clients' homes.
The thing has been quite simple, I only had to launch pure-ftpd with the -p parameter and specify a range of ports through which the passive connections will be made. I decided they should be between port 40000 and 50000. So, the parameter has ended up like this: -p 40000:50000. Then on the firewall I have redirected that whole range of ports against the internal IP of the server and that's it (doing a DNAT). Now passive FTP works perfectly.
If all this about passive and non-passive FTP sounds like Chinese to you, I have found a small and very good website that explains the difference between one system and the other: Active FTP vs. Passive FTP, a Definitive Explanation (local).
4 comments
Comments from the old blog, as they were written. Comments are closed.
Javier Mart
Oriol,
¿No sería mejor ofrecer a tus técnicos un método alternativo para enviar/recibir archivos de trabajo?
Algo así como un WebDAV utilizando HTTPS por ejemplo. (Doy por supuesto que son empleados y que por lo tanto son conocidos.)
—
[1]
No no, hablo de un repositorio de software. Los archivos son programas que se descargan desde los clientes.
Javier Mart
[2] Gracias por la aclaración! ;-)
Albert Coronado
Molt bona la solució. Fa uns anys vaig tenir el mateix problema i l'únic que varem poder fer va ser fer els ftp en mode passiu.