< Home

(Optional) Configuring the Abnormal Packet Detection Function

Context

Devices from different vendors may use different DHCP implementation mechanisms. After detecting that the UDP header checksum or magic cookie field in a received DHCP packet fails the check, a device may not allow the DHCP packet to pass through and discards the packet. As a result, DHCP becomes unavailable. In this case, you can configure the device not to check the UDP header checksum or magic cookie field in received DHCP packets, so that DHCP packets with an incorrect UDP header checksum or incorrect value of the magic cookie field can still be properly forwarded.

According to the protocol, if the UDP header checksum is 0, the peer device does not verify the checksum in DHCP packets. If the peer device does not comply with the protocol, the peer device still verifies the checksum even if the UDP header checksum in DHCP packets sent by the local device is 0. In this case, you need to configure the local device to add the UDP header checksum to DHCP packets to be sent, so that the locally sourced DHCP packets can pass the checksum verification of the peer device.

  • A device, functioning as a DHCP server, DHCP relay agent, DHCP client, or DHCP snooping-enabled device, can be configured not to check the UDP header checksum or magic cookie field in received DHCP packets.
  • Only a device functioning as a DHCP server can be configured to add the UDP header checksum to DHCP packets to be sent.
  • After DHCP is enabled on a device, the device checks the IP header checksum and UDP header checksum in received DHCP packets by default. In addition, the function of checking the IP header checksum cannot be disabled.

Procedure

  • In the system view:
    1. Run system-view

      The system view is displayed.

    2. Configure the abnormal packet detection function.

      • Run undo dhcp anti-attack check magic-cookie

        The device is configured not to check the magic cookie field in received DHCP packets.

        By default, a device does not check the magic cookie field in received DHCP packets. Instead, the device directly forwards DHCP packets with an incorrect value of the magic cookie field.

      • Run undo dhcp anti-attack check udp-checksum

        The device is configured not to check the UDP header checksum in received DHCP packets.

        By default, a device checks the UDP header checksum in received DHCP packets and discards DHCP packets with an incorrect checksum.

      • Run dhcp udp-checksum enable

        The device is enabled to add the UDP header checksum in DHCP packets to be sent.

        By default, the UDP header checksum carried in DHCP packets sent by a device is 0, and the peer device does not verify the checksum.

  • In the VLAN view:
    1. Run system-view

      The system view is displayed.

    2. Run vlan vlan-id

      The VLAN view is displayed.

    3. Configure the abnormal packet detection function.

      • Run undo dhcp anti-attack check magic-cookie

        The device is configured not to check the magic cookie field in received DHCP packets.

        By default, a device does not check the magic cookie field in received DHCP packets. Instead, the device directly forwards DHCP packets with an incorrect value of the magic cookie field.

      • Run undo dhcp anti-attack check udp-checksum

        The device is configured not to check the UDP header checksum in received DHCP packets.

        By default, a device checks the UDP header checksum in received DHCP packets and discards DHCP packets with an incorrect checksum.

  • In the interface view:
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Configure the abnormal packet detection function.

      • Run undo dhcp anti-attack check magic-cookie

        The device is configured not to check the magic cookie field in received DHCP packets.

        By default, a device does not check the magic cookie field in received DHCP packets. Instead, the device directly forwards DHCP packets with an incorrect value of the magic cookie field.

      • Run undo dhcp anti-attack check udp-checksum

        The device is configured not to check the UDP header checksum in received DHCP packets.

        By default, a device checks the UDP header checksum in received DHCP packets and discards DHCP packets with an incorrect checksum.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >