400
# Enable scanning attack protection
[Router-attack-defense-policy-1] defense scan enable
# Set the connection rate threshold that triggers scanning attack protection to 4500.
[Router-attack-defense-policy-1] defense scan max-rate 4500
# Enable the blacklist function for scanning attack protection.
[Router-attack-defense-policy-1] defense scan add-to-blacklist
[Router-attack-defense-policy-1] quit
# Apply policy 1 to GigabitEthernet 1/0/2.
[Router] interface gigabitethernet 1/0/2
[Router-GigabitEthernet1/0/2] attack-defense apply policy 1
[Router-GigabitEthernet1/0/2] quit
# Create attack protection policy 2.
[Router] attack-defense policy 2
# Enable SYN flood attack protection.
[Router-attack-defense-policy-2] defense syn-flood enable
# Configure SYN flood attack protection for the internal server 10.1.1.2, and set the action threshold to
5000 and silence threshold to 1000.
[Router-attack-defense-policy-2] defense syn-flood ip 10.1.1.2 rate-threshold high 5000
low 1000
# Configure the policy to drop the subsequent packets after a SYN flood attack is detected.
[Router-attack-defense-policy-2] defense syn-flood action drop-packet
[Router-attack-defense-policy-2] quit
# Apply policy 2 to GigabitEthernet 1/0/3.
[Router] interface gigabitethernet 1/0/3
[Router-GigabitEthernet1/0/3] attack-defense apply policy 2
[Router-GigabitEthernet1/0/3] quit
Verify the configuration
After the configuration, view the contents of attack protection policy 1 and 2 by using
display attack-
defense policy
.
If Smurf attack packets are received on GigabitEthernet 1/0/2, the device should output alarm logs. If
scanning attack packets are received on GigabitEthernet 1/0/2, the device should output alarm logs
and add the IP addresses of the attackers to the blacklist. If SYN flood attack packets are received on
GigabitEthernet 1/0/3, the device should output alarm logs and drop the subsequent attack packets.
After a period of time, use
display attack-defense statistics interface
to display the attack protection
statistics of each interface. If scanning attacks occur, use
display blacklist
to see the blacklist entries
added automatically by scanning attack protection.
Configuring the blacklist function
Network requirements
As shown in
, assume that you find an attacker (Host D) in the outside network by analyzing
the traffic statistics, and decide to configure the router to filter packets from Host D permanently. In
addition, to control Host C's access temporarily, configure the router to filter packets from Host C for 50
minutes.