How to make modprobe nf_conntrack_ftp persist a reboot on CentOS 7 and firewalld?

I’m stumped. I’ve seen the related questions about editing /etc/sysconfig/iptables-config, but I’m running CentOS 7 (and webmin/virtualmin), which uses firewalld instead of iptables.

How do I get modprobe nf_conntrack_ftp to persist after a reboot? I tried setting up a cron on reboot to issue the command, but that didn’t work (and is probably the wrong way to go about it anyway).

Right now after every reboot I have to login and type in the command manually in order to get FTP connections to work correctly.

Thanks.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

In /etc/modules-load.d, add a file {filename}.conf. That file should have the following contents:

nf_conntrack_ftp

Do the following for more info:

man modules-load.d

Here’s the doc for RHEL7:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Persistent_Module_Loading.html

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply