[CentOS] Vsftpd vs. iptables firewall script

Wed May 23 14:24:45 UTC 2018
Nicolas Kovacs <info at microlinux.fr>


I'm currently setting up a local FTP server, to receive disk images sent
with G4L (Ghost4Linux).

This server has been running Slackware Linux before, and the Vsftpd
setup was relatively simple.

With CentOS things seem to be slightly different, so I'm currently
trying to work things out. For the moment, two things seem to be
creating problems, the simple iptables firewall and SELinux.

When I disable the firewall and SELinux, Vsftp works as expected. So far
so good.

Now let's tackle this one dragon at a time. First the firewall. I'm
starting with a very simple firewall script that looks somewhat like
this. I'm linking to the template, I won't copy/paste the whole thing here.


Under Slackware, the iptables rule for a local FTP server looked like this:

  modprobe ip_conntrack
  iptables -A INPUT -p tcp -i $IFACE_LAN --dport 21 -j ACCEPT

I tried this, but to no avail. Can't connect to my server. I googled a
bit, and I found out that there seem to be quite many different answers
about the subject of "how do I configure my firewall for Vsftpd".

Any suggestions ?


Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32