Install CSF Firewall - Centos 7

Tango

Super Moderator
3,510
907
113
2009
420


Using Putty Install CSF Dependencies with YUM
Code:
yum upgrade
yum -y install wget perl bind-utils unzip net-tools perl-libwww-perl perl-LWP-Protocol-https perl-GDGraph nano
Download and Install CSF firewall
Code:
cd /opt
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
Check CSF will run on your system
Code:
perl /usr/local/csf/bin/csftest.pl
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK
Enable CSF Firewall using nano editor
Code:
nano /etc/csf/csf.conf

# lfd will not start while this is enabled
TESTING = "0"

# Using cursor change TESTING = "1" to "0", Press CTRL + O to save file
Restart Firewall
Code:
csf -r
Disable CSF Firewall
Code:
csf -x
Enable CSF Firewal
Code:
csf -e
Whitelist IP in CSF Firewall
Code:
csf -a IP
 
  • Like
Reactions: M
Top Bottom