In this article, We going to see how to setup ConfigServer Security and Firewall (CSF) on CentOS 7. Linux servers ConfigServer Security & Firewall shortly know as (CSF) is a login/intrusion detection, stateful packet inspection firewall (SPI) and security application. It is a most popular protection suite but this not helped officially yet on CentOS 7.
FirewallD is a cover for iptables to enable more friendly management of iptables rule it is not an iptables replacement. Most of the users have difficulties with the firewalld for their requirements and are returning back to iptables. For CentOS 5 and 6 Iptables was the standard firewall. The following commands will help you how to disable firewalld, install IP tables and install the CSF dependencies.
Note: You need to run the command as root or via the sudo.
Stop and disable firewalld
To stop and disable the firewalld use the following command.
systemctl stop firewalld
systemctl disable firewalld
Install iptables by the following command.
yum -y install iptables-services
Files needed by iptables.
Create supported files required by iptables using the following command.
Now start iptables using the following command.
systemctl start iptables
systemctl start ip6tables
Enable iptables at boot
Now enable iptables using the following command.
systemctl enable iptables
systemctl enable ip6tables
Install the CSF dependencies
To secure your iptable need to install the CSE dependencies by the following command.
yum -y install wget perl unzip net-tools perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph -y
Download and start the CSF installer.
Now download and start the CSF installer using the following command.
tar -xzf csf.tgz
Remove the installed files.
If you like to remove installed files use the following command.
rm -rf /opt/csf