0

I've set up vsftpd server (version 3.0.5) in an Ubuntu Server 24.04 box.

No pasv_min_port nor pasv_max_port settings in vsftpd.conf. Except port 21, no port forwarding in router.

To my surprise, this setup works, the server is accesible from Internet, one can upload, download etc.

Why that? Data ports reservation and forwarding are not mandatory in passive mode?

Tried same settings on an Ubuntu 18 Desktop, but this time the server does not run without port reservation and forwarding.

Later edit:

Thanks so much everybody for replies, and sorry I didn't answer for so long. I was busy to learn more about FTP and to try settings. I even replaced the router to narrow down the problem. Finally, I believe I can explain what's going on.

The background:

When it comes about FTP, routers can perform in two modes:

  1. The "classic" mode: port 21 and port range defined by [pasv_min_port ... passv_max_port] in vsftpd.conf must be forwarded explicitly by settings in router.

  2. The ALG mode: the server ignores passive port settings, if any, and generates a random port on its own on every PASSV command from client. The router automatically opens this port.

My initial router, a Mercusys AC12, did ALG by default, without any settings. No information about this behavior were in router's documentation.

I've replaced the Mercusys with an ASUS RX3041. The latter has a checkbox for classic/ALG mode, and thus I was able to reproduce modes 1) and 2).

Finally, one more thing: why on an Ubuntu 18 Desktop the server does not run without port reservation and forwarding, even with router in ALG mode? I believe that's because of port mapping I've done: external port 21100 to 21. In this case, ALG does not function, must use classic mode.

4
  • Post some log files. Commented Jul 3 at 19:33
  • I wrote an answer but then realized I had misread the question. Are you sure the client was using passive mode? What are you using as your NAT gateway? Does your NAT gateway implementation contain an FTP ALG?
    – Spiff
    Commented Jul 3 at 22:26
  • Unless you're using an encrypted connection, a "NAT helper" will take care of everything.
    – Daniel B
    Commented Jul 15 at 17:12
  • 1
    Please post answers as answers – do not edit them into the question. Commented Jul 15 at 18:52

0

You must log in to answer this question.

Browse other questions tagged .