inetbase DDOS Protection Centos Installation + Setting
Nowadays it is very easy to make DDOS attacks easily at cheap costs. In this respect, we will explain the installation and configuration of inetbase
DDoS which provides blocking with inetbase
for a certain number of requests on your virtual servers with centos (if it is apf, it can also be blocked).
Of course, this inetbase
cannot block large attacks, but it can block specific requests for your IP with inetbase
.
You can install inetbase in all VPS packages in this article!
Take the file before installation (execute in ssh):
1 | wget http://www.inetbase.com/scripts/ddos/install.sh |
my rule:
1 | sh install.sh |
If the above command fails, try reinstalling it with chmod + x install.sh, giving chmod permission.
Let’s go to settings:
1 | nano /usr/local/ddos/ddos.conf |
With the above command, we open the DDoS.conf file with the nano editor. It contains some critical settings.
APF_BAN = 0 # This setting allows you to ban inetbase
using apf if your server has one. Leave 0 if there is no apf.
NO_OF_CONNECTIONS = 300 # this is important, how many connections from 1 IP to your server should be banned? We would recommend the 300 as techsoftcenter. If it creates problems, you can upgrade further.
BAN_PERIOD = 600 # This setting bans 300 linkers in 600 seconds. 600 seconds is 10 minutes, you can expand or narrow this time based on seconds.
EMAIL_TO=mail@techsoftcenter.com # here is a nice feature. If you want the report of the banned IP to come to your e-mail.
There’s another important setting. Inetbase is the default setting, so the current settings are unfortunately random banning. To prevent this, add the following command to the bottom of ddos.conf.
1 | netstat -tn --inet 2> /dev/null| grep ":80" | awk '/tcp[ ]*[0-9]+[ ]*[0-9]+[ ]+[^ ]+[ ]*[^ ]*/ { print $5; }' | cut -d":" -f1 | sort | uniq -c | sort -n |
After installation and settings are finished. You can see the banned IPs with the following command;
1 | nano /usr/local/ddos/ignore.ip.list |
to empty the ban list;
1 | iptables -F |
If you are not satisfied with inetbase
and want to remove it, follow the steps below,
1 2 | wget http://www.inetbase.com/scripts/ddos/uninstall.ddos sh uninstall.ddos |
I hope it has been a useful article.