Use DDOS deflate to defend against a small number of DDOS attacks

Source: Internet
Author: User
Tags vps email account

The Internet is rich and colorful. Basically, we can find the resources we need, because many of our friends have joined the ranks of webmasters. There will also be a fight between many webmasters. In particular, our personal webmaster, due to limited technical and financial resources, was not easy to use the host, VPS, and was attacked and unable to defend, resulting in our host or VPS provider suspending our account, the IP address is suspended. Especially for the VPS host we are using, because it is consumed by traffic, we are helpless after exhausting our traffic and encountering a large number of DDOS attacks, including the old left, we can see that we have also encountered DDOS attacks.

Can we handle these problems in VPS settings? Even a little bit of defense. The DDOS deflate script can help the VPS block the attack process. If a sustained attack from an IP address occurs, you can automatically set the IP address to an IP blacklist. We can only say that we can defend our VPS a little bit.

Step 1: Install.

Wget http://myvps-scripts.googlecode.com/files/deflate.sh chmod + x deflate. sh./deflate. sh

Step 2: configure the/usr/local/ddos. conf file.

##### Paths of the script and other filesPROGDIR="/usr/local/ddos"PROG="/usr/local/ddos/ddos.sh"IGNORE_IP_LIST="/usr/local/ddos/ignore.ip.list"CRON="/etc/cron.d/ddos.cron"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 effectFREQ=1##### How many connections define a bad IP? Indicate that below.NO_OF_CONNECTIONS=150##### 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=0##### KILL=0 (Bad IPs are'nt banned, good for interactive execution of script)##### KILL=1 (Recommended setting)KILL=1##### An email is sent to the following address when an IP is banned.##### Blank would suppress sending of mailsEMAIL_TO="root"##### Number of seconds the banned ip should remain in blacklist.BAN_PERIOD=600

Description:

NO_OF_CONNECTIONS = 150 # maximum number of connections. If the connection is exceeded, it will be blocked. The default value is APF_BAN # And the default value is 1. We recommend that you use 0 to indicate iptables limit EMAIL_TO = "" to enter the email account, at that time, some information will be sent to our mailbox. BAN_PERIOD = 600 indicates that the IP address is limited to 600 seconds.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.