DDoS Deflate can prevent a small amount of DDoS and CC attacks, and it takes less time. We recommend that you use it.
1. Check whether iptables is running
service iptables status
If "iptables: Firewall is not running." is displayed, iptables is not running. You need to run "service iptables start" to run iptables. For more information, see iptables basic firewall applications.
2. Install DDoS Deflate
1. Download
wget http://soft.kwx.gd/security/ddos-Deflat.sh
2. Set permissions and run scripts
Chmod + x ddos-Deflat.sh # Set to 755 permissions./ddos-Deflat.sh
The script is automatically downloaded and installed. If the prompt is similar to an English word such as "disclaimer", Press "q" or any key to exit.
3. Set DDoS Deflate
1. modify a specified file
vi /usr/local/ddos/ddos.conf
2. Set according to the following instructions:
##### Paths of the script and other filesPROGDIR = "/usr/local/ddos" PROG = "/usr/local/ddos. sh "IGNORE_IP_LIST ="/usr/local/ddos/ignore. ip. list "// IP address whitelist file CRON ="/etc/cron. d/ddos. cron "// periodically execute the following command:"/etc/APT/apt "ept ="/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 effe CtFREQ = 1 // check the network interval, in minutes ##### How many connections define a bad IP? Indicate that below. NO_OF_CONNECTIONS = 150 // maximum number of connections from a single IP address. If the number of connections exceeds the limit, the rule is executed. The default value is #### APF_BAN = 1 (Make sure your APL version is atleast 0.96) ##### APF_BAN = 0 (Uses iptables for banning ips instead of APT) APF_BAN = 1 // whether to use apt or iptables. We recommend that you use iptables to change the value of APF_BAN to 0. ##### KILL = 0 (Bad IPs are 'nt banned, good for interactive execution of script) #### KILL = 1 (Recommended setting) KILL = 1 // whether the IP address is blocked. the default value is #### An email is sent to the following address when an IP is banned. ##### Blank wocould suppress sending of mailsEMAIL_TO = "root" // send an email to the specified email address when the IP address is blocked, if not, add "#" to the front to shield ##### Number of seconds the banned ip shoshould remain in blacklist. BAN_PERIOD = 600 // time when IP addresses are disabled. The default value is 600 seconds.
3. Save the file to take effect.