Preventing DDOS Attack

About DDOS Attack

Denial of Service (DoS) attack does not allow the computer or network not provide normal services.

DoS attack is a simple and effective attack method which is very harmful to many network technologies. It attacks through various means to consume network bandwidth and system resources. It also attacks system defects, pralyzing the normal service of normal system. This results in the system not being able to service the users. It prevents the normal user from accessing services.

A distributed-denial-of-service (DDoS) is a form of security threat where a malicious host floods simultaneous data requests to a device or a central server. The host generates these requests from multiple compromised systems.

By flooding the device the attacker hopes to exhaust the internal RAM and affect the internet bandwidth thus disrupting the business.

You can modify the following IP packet settings to prevent a DDoS attack.

  • Based on the relevant standard, the Time to Leave (TTL) field in the IP packet header must be greater than 0. By default, if a packet with TTL field equal to 0 is received, then the device discards the message as an attack. You can enable TTL monitoring to prevent DDoS attack.

  • The number of fragments depend on the number of packets. If the number of packets is large, then the number of fragments is large and affects the performance of the system resources. Configuring a reasonable limit for the number of packets restricts the number of fragments. If the limit is exceeded, the message is discarded as an attack message. By default, an IP message has 800 fragments. You can limit the number of fragments allowed on a device to prevent a DDoS attack.

How to Prevent DDOS Attack

Enabling Time to Leave (TTL) Monitoring

To enable Time to Leave (TTL) monitoring, perform this procedure.


Note


This procedure is optional.


Procedure

  Command or Action Purpose

Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal 

Enters global configuration mode.

Step 3

[no] anti-dos ip ttl

Example:

Device(config)# anti-dos ip ttl 

Enables TTL monitoring.

By default, messages with TTL with a value of 0 are discarded

Use the no anti-dos ip ttl command to disable the anti-TTL attack. After configuration, normal messages are processed.

Step 4

show anti-dos

Example:

Device(config)# show anti-dos 

(Optional) Displays the configuration information.

Configuring Limit for IP Fragmentation

To configure limit for IP fragmentation, perform this procedure.


Note


This procedure is optional.


Procedure

  Command or Action Purpose

Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal 

Enters global configuration mode.

Step 3

[no] anti-dos ip fragment max-numbers

Example:

Device(config)#  

Allows IP fragmentations within the specified threshold value.

Use the no anti-dos ip fragment command to restore the default value of 800.

Example: Preventing DDOS Attack

The following example shows how to verify the device can communicate with two fragments of the IP message.

Device> enable
Device# configure terminal 
Device(config)# ping -l 2800 10.5.2.91
PING 10.5.2.91: with 2800 bytes of data:
reply from 10.5.2.91: bytes=2800 time<10ms TTL=64
reply from 10.5.2.91: bytes=2800 time<10ms TTL=64
reply from 10.5.2.91: bytes=2800 time<10ms TTL=64
reply from 10.5.2.91: bytes=2800 time<10ms TTL=64
reply from 10.5.2.91: bytes=2800 time<10ms TTL=64
----10.5.2.91 PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 0/0/0

The following example shows how to verify the device unable to communicate with three fragments of the IP message.

Device> enable
Device# configure terminal 
Device(config)# ping -l 3000 10.5.2.91
PING 10.5.2.91: with 3000 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
no answer from 10.5.2.91

The following example shows how to delete the IP fragmentation configuration and verify the device able to communicate with three fragments of the IP message.

Device> enable
Device# configure terminal 
Device(config)# ping -l 3000 10.5.2.91
PING 10.5.2.91: with 3000 bytes of data:
reply from 10.5.2.91: bytes=3000 time=10ms TTL=64
reply from 10.5.2.91: bytes=3000 time<10ms TTL=64
reply from 10.5.2.91: bytes=3000 time=10ms TTL=64
reply from 10.5.2.91: bytes=3000 time<10ms TTL=64
reply from 10.5.2.91: bytes=3000 time<10ms TTL=64

----10.5.2.91 PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 0/4/10