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