Where should I load iptables modules, for example ip_conntrack and ip_conntrack_ftp.
Places I have found that might be candidates, but are they?
- The IPTABLES_MODULES variable in /etc/init.d/iptables
- In /etc/modprobe.conf
- In /etc/modprobe.d/xxxx.conf
None of them.
/etc/rc.d/rc.sysinit
looking for two locations to load modules:
# Load other user-defined modules
for file in /etc/sysconfig/modules/*.modules ; do
[ -x $file ] && $file
done# Load modules (for backward compatibility with VARs)
if [ -f /etc/rc.modules ]; then
/etc/rc.modules
fi
So, you should put the loading command into /etc/sysconfig/modules/*.modules
or /etc/rc.modules
:
# echo "modprobe ip_conntrack" >> /etc/sysconfig/modules/iptables.modules
# chmod +x /etc/sysconfig/modules/iptables.modules
Check more discussion of this question.