centos7安装ddos-deflate
官網(wǎng):https://github.com/jgmdev/ddos-deflate
文章的開頭,先把填過(guò)的坑說(shuō)說(shuō),目前github上有7個(gè)版本,但從0.9版本開始,就不是很好使用了。好在當(dāng)時(shí)在2018年8月17號(hào),服務(wù)器上還留一個(gè)版本,下面是下載的地址:https://download.csdn.net/download/u011442726/20086141
1.先創(chuàng)建一個(gè)目錄,然就把軟件下載下來(lái)
2.下載軟件
wget https://github.com/jgmdev/ddos-deflate/archive/master.zip -O ddos.zip3.解壓
unzip ddos.zip cd ddos-deflate-master ./install.sh然后就是一路點(diǎn)擊“y”,讓其安裝。
到這一步,就已經(jīng)安裝成功了。注意:默認(rèn)安裝成功后,就是啟動(dòng)的了。
4.卸載
As root user execute the following commands:
cd ddos-deflate-master ./uninstall.sh當(dāng)前白名單ip
[smart@iZwz9dogzz2mi9crtZ ~]$ ddos -i List of currently whitelisted ip's. =================================== 127.0.0.1設(shè)置白名單
/etc/ddos/ignore.ip.list
5.啟動(dòng)服務(wù)
在該文件下,然后編譯不需要攔截的白名單,然后重啟服務(wù)。
/etc/init.d/ddos restart or service ddos restart#查看狀態(tài) service ddos status#停止 service ddos stop#啟動(dòng) service ddos start6.修改一下郵件接收地址
7.參數(shù)說(shuō)明
##### Paths of the script and other files PROGDIR="/usr/local/ddos" PROG="/usr/local/ddos/ddos.sh" IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list" //IP地址白名單 CRON="/etc/cron.d/ddos.cron" //定時(shí)執(zhí)行程序 APF="/etc/apf/apf" IPT="/sbin/iptables" ##### frequency in minutes for running the script ##### Caution: Every time this setting is changed, run the script with --cron ##### option so that the new frequency takes effect FREQ=1 //檢查時(shí)間間隔,默認(rèn)1分鐘 ##### How many connections define a bad IP? Indicate that below. NO_OF_CONNECTIONS=150 //最大連接數(shù),超過(guò)這個(gè)數(shù)IP就會(huì)被屏蔽,一般默認(rèn)即可 ##### APF_BAN=1 (Make sure your APF version is atleast 0.96) ##### APF_BAN=0 (Uses iptables for banning ips instead of APF) APF_BAN=1 //使用APF還是iptables。推薦使用iptables,將APF_BAN的值改為0即可。 ##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script) ##### KILL=1 (Recommended setting) KILL=1 //是否屏蔽IP,默認(rèn)即可 ##### An email is sent to the following address when an IP is banned. ##### Blank would suppress sending of mails EMAIL_TO="root" //當(dāng)IP被屏蔽時(shí)給指定郵箱發(fā)送郵件,把root換成自己的郵箱即可 ##### Number of seconds the banned ip should remain in blacklist. BAN_PERIOD=600 //禁用IP時(shí)間,默認(rèn)600秒,可根據(jù)情況調(diào)整8.如何添加白名單
安裝成功后,會(huì)自動(dòng)在/etc/ddos下創(chuàng)建以下三個(gè)文件夾
8.1.直接在ignore.ip.list文件中添加白名單
vi ignore.ip.list在這里進(jìn)行編輯,新增新的ip白名單,然后可以使用命令ddos -i? 查看白名單。
ddos -i思考:編輯了新的白名單,是否需要重啟ddos服務(wù)呢?答案:不需要重啟。
service ddos restart8.2.通過(guò)iptables --list命令,查看是否有ip被禁用?
iptables --list8.3.對(duì)于已經(jīng)被禁用的ip,可以使用ddos -u xxxx取消
先去ignore.ip.list文件中添加白名單,然后使用ddos -u ip地址? 取消黑名單,即可解除ip白名單,不需要重啟服務(wù)。
ddos -u 192.168.1.19.常用的幾個(gè)命令
9.1.查看白名單
ddos -i9.2.查看ip的鏈接數(shù)
ddos -v9.3.查看已經(jīng)禁止的ip
ddos -b10.查看某個(gè)ip連接了哪個(gè)應(yīng)用進(jìn)程
詳情:
netstat -anpt | grep 119.130.121.241統(tǒng)計(jì):
netstat -anpt | grep 119.130.121.241 | wc -l總結(jié)
以上是生活随笔為你收集整理的centos7安装ddos-deflate的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 给自己立个目标
- 下一篇: 通过Idea创建spring项目,没有s