Quantcast
Channel: Admins Goodies » modprobe
Viewing all articles
Browse latest Browse all 5

What is the correct way to load modules for iptables on Centos 6

$
0
0

Question

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

Answer

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

Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images