On a DHCP network, if an attacker sends a large number of DHCP messages to the device within a short time, the device performance may deteriorate and the device may not work normally. To prevent DHCP flood attacks, enable the device to check the rate of sending DHCP messages to the processing unit.
DHCP snooping has been enabled on the device using the dhcp snooping enable command before you configure the following functions.
If the maximum rate of sending DHCP messages is configured in the system view, the configuration takes effect for all the interfaces on the device. If the maximum rate of DHCP messages is configured in the interface view, the configuration takes effect only for the specified interface. If the maximum rate of sending DHCP messages is configured in the VLAN view, the configuration takes effect for all interfaces in the VLAN.
If the maximum rate of sending DHCP messages is configured in the system view, VLAN view, and interface view simultaneously, the smallest value takes effect.
If the alarm function is configured in the system view, the configuration takes effect for all interfaces on the device. If the alarm function is configured in the interface view, the configuration takes effect for the specified interface.
The system view is displayed.
Configure the maximum rate of sending DHCPv4 messages.
The device is enabled to check the rate of sending DHCP messages to the processing unit.
By default, the device does not check the rate of sending DHCP messages to the processing unit.
Running the dhcp snooping check dhcp-rate enable vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> command in the system view is equivalent to running the dhcp snooping check dhcp-rate enable command in the VLAN view.
The maximum rate of sending DHCP messages to the processing unit is set.
By default, the maximum rate of sending global DHCP messages to the processing unit is 100 pps, which is the same as the maximum rate of sending DHCP messages on interfaces to the processing unit.
The VLAN view is displayed.
The device is enabled to check the rate of sending DHCP messages to the processing unit.
By default, the device does not check the rate of sending DHCP messages to the processing unit.
If you run this command in the VLAN view, the command takes effect for all DHCP messages in a specified VLAN received by all the interfaces on the device.
Running the dhcp snooping check dhcp-rate enable vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> command in the system view is equivalent to running the dhcp snooping check dhcp-rate enable command in the VLAN view.
The maximum rate of sending DHCP messages to the processing unit is set.
By default, the maximum rate of sending global DHCP messages to the processing unit is 100 pps, which is the same as the maximum rate of sending DHCP messages on interfaces to the processing unit.
Return to the system view.
The interface view is displayed.
The device is enabled to check the rate of sending DHCP messages to the processing unit.
By default, the device does not check the rate of sending DHCP messages to the processing unit.
The maximum rate of sending DHCP messages to the processing unit is set.
By default, the maximum rate of sending global DHCP messages to the processing unit is 100 pps, which is the same as the maximum rate of sending DHCP messages on interfaces to the processing unit.
Return to the system view.
Alarm function:
The device is enabled to generate an alarm when the number of discarded DHCP messages reaches the alarm threshold.
If you run this command in the system view, the command takes effect for all the interfaces of the device.
By default, a device does not generate an alarm when the number of discarded DHCP messages reaches the alarm threshold.
The alarm threshold for the number of discarded DHCP messages is set on the interface.
By default, the global alarm threshold for the number of discarded DHCP packets is 100, and the threshold on an interface is the same as the configuration in system view.
The interface view is displayed.
The device is enabled to generate an alarm when the number of discarded DHCP messages reaches the alarm threshold.
If you run this command in the system view, the command takes effect for all the interfaces of the device.
By default, a device does not generate an alarm when the number of discarded DHCP messages reaches the alarm threshold.
The alarm threshold for the number of discarded DHCP messages is set on the interface.
By default, the global alarm threshold for the number of discarded DHCP packets is 100, and the threshold on an interface is the same as the configuration in system view.
Return to the system view.
Configure the maximum rate of sending DHCPv6 messages.
Run dhcp snooping check dhcpv6-rate enable
The function of checking the rate of DHCPv6 messages sent to the processing unit is enabled.
By default, the function of checking the rate of DHCPv6 messages sent to the processing unit is disabled.
Run dhcp snooping check dhcpv6-rate rate
The maximum rate of DHCPv6 messages sent to the processing unit is configured.
By default, the maximum rate of DHCPv6 messages sent to the processing unit is 100 pps.
The VLAN view is displayed.
Run dhcp snooping check dhcpv6-rate enable
The function of checking the rate of DHCPv6 messages sent to the processing unit is enabled.
By default, the function of checking the rate of DHCPv6 messages sent to the processing unit is disabled.
Run dhcp snooping check dhcpv6-rate rate
The maximum rate of DHCPv6 messages sent to the processing unit is configured.
By default, the maximum rate of DHCPv6 messages sent to the processing unit is 100 pps.
Return to the system view.
The interface view is displayed.
Run dhcp snooping check dhcpv6-rate enable
The function of checking the rate of DHCPv6 messages sent to the processing unit is enabled.
By default, the function of checking the rate of DHCPv6 messages sent to the processing unit is disabled.
Run dhcp snooping check dhcpv6-rate rate
The maximum rate of DHCPv6 messages sent to the processing unit is configured.
By default, the maximum rate of DHCPv6 messages sent to the processing unit is 100 pps.
Return to the system view.
Alarm function:
Run dhcp snooping alarm dhcpv6-rate enable
The device is enabled to generate an alarm when the number of discarded DHCPv6 messages reaches the alarm threshold.
By default, a device is disabled from generating an alarm when the number of discarded DHCPv6 messages reaches the alarm threshold.
Run dhcp snooping alarm dhcpv6-rate threshold threshold
The alarm threshold for discarded DHCPv6 messages is configured.
By default, the alarm threshold for globally discarded DHCPv6 messages is 100 packets.
The interface view is displayed.
Run dhcp snooping alarm dhcpv6-rate enable
The device is enabled to generate an alarm when the number of discarded DHCPv6 messages reaches the alarm threshold.
By default, a device is disabled from generating an alarm when the number of discarded DHCPv6 messages reaches the alarm threshold.
Run dhcp snooping alarm dhcpv6-rate threshold threshold
The alarm threshold for discarded DHCPv6 messages is configured.
By default, the alarm threshold for discarded DHCPv6 messages on an interface is the configured value in the system view.
Return to the system view.