This section describes how to set DoS attack defense parameters before enabling DDoS attack defense.
system-view
interface interface-type interface-number
anti-ddos flow-statistic enable
The interface-based traffic statistics collection function is disabled by default. Enable this function before configuring DDoS attack defense.
quit
ddos-mode { detect-clean | detect-only }
The default defense mode is detect-clean.
anti-ddos statistic sampling-fraction sampling-fraction
If sampling-fraction indicating the sampling coefficient is configured, the sampling ratio is 2sampling-fraction:1, which means one out of every 2sampling-fraction packets is sampled. For example, if sampling-fraction is set to 2, the sampling ratio is 4:1, which means one out of every four packets is sampled.
sampling-fraction is an integer ranging from 0 to 15. The default value is 0.
anti-ddos defend-time start-delay start-delay end-delay end-delay
start-delay is an integer ranging from 1 to 254, in seconds. The default value is 1.
end-delay is an integer ranging from 1 to 3600, in seconds. The default value is 600.
anti-ddos destination-ip alert-rate alert-rate
The default value is 0, indicating that all traffic enters the DDOs defence process.
After this function is configured, the FW collects the statistics on the traffic that arrives at a destination IP address. If the traffic that arrives at the destination IP address exceeds the alarm threshold, the traffic enters the DDoS defense process.
This function improves FW performance.
anti-ddos source-ip detect aging-time time
time is an integer ranging from 1 to 60000, in seconds. The default value is 1800.
If the FW determines that an IP address is real, the FW adds the address to the source IP address monitoring table, which is equivalent to a whitelist. All packets from the source IP address are considered legitimate and permitted by the FW without verification, unless the address in the monitoring table expires.
Unlike the aging mechanism of an entry in the session table, the aging time of an entry in the source IP address monitoring table starts from the time the entry was created, and the remaining keepalive time is not updated when a packet matches the entry. When the configured aging time elapses, the entry expires.