< Home

Enabling DHCP Snooping

Context

DHCP snooping ensures security of the DHCP service. Before configuring DHCP snooping functions, you need to enable DHCP snooping.

You must enable DHCP snooping first in the system view, and then on an interface or in a VLAN.

As shown in Figure 1, Switch_1 is a Layer 2 access device that forwards the DHCP Request packets from user PCs to the DHCP server. When you configure DHCP snooping, note the following (Switch_1 is used as an example):
  • Enable DHCP globally using the dhcp enable command before enabling DHCP snooping.

  • After DHCP snooping is globally enabled, enable DHCP snooping on the interfaces (such as if1, if2, and if3) connecting to users or, if there is a large number of user PCs in the same VLAN, enable DHCP snooping on the VLAN (such as VLAN 10) to which these interfaces belong.

DHCP snooping does not support the BOOTP protocol, which is used by diskless workstations. Therefore, DHCP snooping binding entries cannot be generated for diskless workstations. IPSG and DAI are implemented based on binding entries. For this reason, to use them on a diskless workstation, you must configure static binding entries by running the user-bind static command.

Figure 1 DHCP snooping networking diagram

Perform the following steps on the Layer 2 access device or the first DHCP relay agent from the device.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp snooping enable [ ipv4 | ipv6 ]

    DHCP snooping is globally enabled.

    By default, DHCP snooping is globally disabled on the device.

    The dhcp snooping enable command in the system view is the prerequisite for DHCP snooping-related functions. After the undo dhcp snooping enable command is run, all DHCP snooping-related configurations of the device are deleted. After DHCP snooping is enabled again using the dhcp snooping enable command, all DHCP snooping-related configurations of the device are restored to the default configurations.

  3. (Optional) Run dhcp snooping over-vpls enable

    DHCP snooping is enabled on the device on a VPLS network.

    By default, DHCP snooping is disabled on the device on a VPLS network.

    Only the S5720-HI, S5731-H, S5731S-H, S5732-H, S6730-H, S6730S-H, S5730-HI, and S6720-HI support this step.

    DHCPv6 snooping does not support this command.

    The device management interfaces do not support DHCP snooping on a VPLS network.

  4. Enable DHCP snooping in the system, BD, VLAN, or interface view.

    • In the system view:

    1. Run dhcp snooping enable vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>

      DHCP snooping is enabled on the device.

      By default, DHCP snooping is disabled on the device.

    • In the VLAN view or interface view:

    1. Run vlan vlan-id

      The VLAN view is displayed.

      Or run interface interface-type interface-number

      The interface view is displayed.

    2. Run dhcp snooping enable

      DHCP snooping is enabled on the interface or in a VLAN.

      By default, DHCP snooping is disabled on the device.

      If you run this command in the VLAN view, the command takes effect on all the DHCP messages received by all interfaces from the specified VLAN. If you run this command in the interface view, the command takes effect on all the DHCP messages received by the specified interface.

    • In the BD view:
      1. Run bridge-domain bd-id

        The BD view is displayed.

      2. Run dhcp snooping enable

        DHCP snooping is enabled in the BD.

        By default, DHCP snooping is disabled on a device.

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