- ProFTPd instance on a LXC container behind NAT
- LXC container is using bridged networking
PassivePorts 60000 61000
has been defined in proftpd.confnf_nat_ftp
andnf_conntrack_ftp
loaded on the host running the containeriptables inside the container contains
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -A INPUT -p tcp --dport 21 -m conntrack --ctstate NEW -j ACCEPT
Why does Passive mode
only work when I explicitly open passive ports with
-A INPUT -p tcp -m tcp --dport 60000:61000 -j ACCEPT
? Shouldn't this be automatically managed by the nf_conntrack_ftp
helper module?
I experienced the problem that after installing lxc together with a new version of the linux kernel needed, the connection tracker helpers stopped working. This, however, was not a problem of lxc but a problem of the kernel and I could get around it by adding
to sysctl.conf. Apparently newer kernels after 4.7 have better ways to configure the helpers (and probably using them would be a better answer to this question) and therefore net.netfilter.nf_conntrack_helper=0 is the default now, see here.