I had been experimenting with an FTP server setup using vsftpd on my Raspberry Pi but running into issues with getting 'passive mode' to work. (I have an Xfinity Gateway so I've heard that could be a problem as well). As long as I have it set too 'active mode' I have no problem.

Port forwarding is setup like this:

RaspberryPI FTP TCP/UDP (Start port 20 end port 21)

PI External Passive TCP/UDP (Start port 12000 end port 12100)

The 'vsftpd.conf' file was configured like this:

pasv_enable=YES pasv_min_port=12000 pasv_max_port=12100 port_enable=YES

I tried some options with 'UFW' on the PI but ended up completely messing it up and needed to redo it. So now I'm back to the beginning try to set it up right this time. Has anyone successfully got passive mode to work at all on the PI? I can remotely connect no problem, to the FTP server (And one my LAN) with 'active mode' set. I really don't know what else to change or add to fix this.

1 Answer 1


You should do tcpdump on your client and server to figure out where the protocol is going wrong. In passive mode, the server opens a connection on some random port and the client connects to that for data transfers.

A lot can go wrong, with NAT, with security and with firewalling. You need a packet-inspecting firewall to selectively open the port for the data transfer. NAT between the client and server could break the protocol (as IP addresses are sent within the FTP protocol, not just in IP packet headers). This leads me to ask:

Why are you beating yourself up like this? FTP is an obsolete protocol for all the above reasons and more. Why not just set up a web server for these file transfers?

  • it was partly because I wanted to see the vulnerability’s in an FTP server and then work my way up to setting up something more secure. I was never able to figure it out so, just followed a guide on YouTube. I know a little about networking but have figured it out for the most part. I never heard of tcpdump but I’ll take a look at trying to learn it. Thank you
    – Woolfy
    Sep 16, 2020 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.