How to install and configure Config Server Firewall (CSF) on CentOS 7

This guide will help you to install CSF Firewall on CentOS 7 cPanel Server let’s get started

Before starting the installation make sure to Install the CSF dependencies.

 [root@cloud ~]# yum -y install wget perl unzip net-tools perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph -y

Now disabled default firewall (firewalld) on CentOS 7 , RHEL 7 and CloudLinux 7 and install iptables with CSF Configuration

Stop firewalld:

 [root@cloud ~]# systemctl stop firewalld

Disable auto start at boot

 [root@cloud ~]# systemctl disable firewalld

Now Install iptables

[root@cloud ~]# yum -y install iptables-services

Now Create files needed by iptables

[root@cloud ~]#  touch /etc/sysconfig/iptables
[root@cloud ~]#  touch /etc/sysconfig/iptables6

Now Start iptables

[root@cloud ~]#  systemctl start iptables
[root@cloud ~]#  systemctl start ip6tables

Enable iptables at boot

[root@cloud ~]#  systemctl enable iptables
[root@cloud ~]#  systemctl enable ip6tables

Download the CSF installer Execute the following steps

[root@cloud ~]# cd /usr/src
[root@cloud ~]# rm -fv csf.tgz
[root@cloud ~]# wget https://download.configserver.com/csf.tgz
[root@cloud ~]# tar -xzf csf.tgz
[root@cloud ~]# cd csf
[root@cloud ~]# sh install.sh

Uninstallation
==============
Removing csf and lfd from the system.

[root@cloud ~]# cd /etc/csf
sh uninstall.sh

1 thought on “How to install and configure Config Server Firewall (CSF) on CentOS 7”

Leave a Comment

10 + = 19