R-Ts NetWorks

Server the Best

How to prevent or stop DOS or DDOS or SYN attack on linux server


How to prevent or stop DOS or DDOS or SYN attack on linux server

If there are lots of hits coming from particular IP address then there is a chances of DDOS attack. Below are some tweak     settings  in the csf firewall for DDOS or SYN_ATTACK.

First check hits are coming from which port. Mostly DDOS attack done on port 80 i.e in Apache port. Please note that you are using correct timing and values otherwise lots of IP get blocked on the server firewall.

Login to the server via ssh

Open the csf.conf file with vi /etc/csf/csf.conf

Search for “PORTFLOOD”

Add PORTFLOOD = “80;tcp;20;300”

Save the file.

Restart csf service (service csf restart)

This rule will block IPs that connects to port 80 via TCP more than 20 times within 300 seconds.  Once the attack is normal then remove this rule from the csf firewall.

Advertisements

May 7, 2012 - Posted by | Installation, Security | , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: