CentOS 7 + IPTables + CSF

30th March 2016


As good as CentOS 7 is, the lack of IPTables can be an annoyance to people like me who need it for things like CSF Messenger.  Here is how to remove the CentOS 7 firewalld and install iptables.

First off,

Stop and disable firewalld

systemctl disable firewalld
systemctl stop firewalld

Install iptables.

   yum -y install iptables-services

Create files needed by iptables.

  touch /etc/sysconfig/iptables
  touch /etc/sysconfig/iptables6

Start iptables.

  systemctl start iptables
  systemctl start ip6tables

Enable iptables at boot.

  systemctl enable iptables
  systemctl enable ip6tables

Install the CSF dependencies.

  yum -y install wget perl unzip net-tools perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph -y

Download and launch the CSF installer.

  cd /opt
  wget https://download.configserver.com/csf.tgz
  tar -xzf csf.tgz
  cd csf
  sh install.sh

Remove the installation files.

 rm -rf /opt/csf
 rm /opt/csf.tgz 

You can now enable the messenger options within CSF to show a message to visitors is they have been blocked in the firewall.