Hard to implement IPTables? Try this.
Install ConfigServer Security & Firewall on a Linux server, add its Perl dependencies, and check whether the required firewall modules work.
updated 2 min read
Have you ever try to implement filter on your server using IPTables?
It's hard isn't it?
You should try CSF.
CSF Installation
Download package
First, download latest package of CSF from official website, and extract it.
# cd /opt/# wget https://download.configserver.com/csf.tgz# tar -xvf csf.tgzI use CentOS, so I prefer store them in /opt/. Please try to read at your own distribution hier.
Then install required perl packages.
-- On rpm based systems:# yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph perl-Math-BigInt.noarch
-- On APT based systems:# apt-get install libwww-perl liblwp-protocol-https-perl libgd-graph-perlRun install.sh
# sh install.sh
Selecting installer...
Running csf generic installer
Installing generic csf and lfd
Check we're running as root...---- too long ----Installation CompletedAfter completed, try to restart csf.
# csf -rCSF will automatically added your current IP and SSH Port to the allow list.
Check whether your CSF running properly
# perl /usr/local/csf/bin/csftest.plTesting ip_tables/iptable_filter...OKTesting ipt_LOG...OKTesting ipt_multiport/xt_multiport...OKTesting ipt_REJECT...OKTesting ipt_state/xt_state...OKTesting ipt_limit/xt_limit...OKTesting ipt_recent...OKTesting xt_connlimit...OKTesting ipt_owner/xt_owner...OKTesting iptable_nat/ipt_REDIRECT...OKTesting iptable_nat/ipt_DNAT...OK
RESULT: csf should function on this serverAll config stored at /etc/csf/.
Find and write your desired rules, and save them by csf -r.
Don't forget to RTFM. You'll find the details.
# man csfThanks to:
(c)2006-2021, Way to the Web Limited (http://www.configserver.com)