< Home

Configuring the DHCP Policy VLAN

Context

You can configure three types of DHCP policy VLAN on the device at the same time. They are listed in descending order based on priorities as follows: MAC address-based, interface-based, and generic DHCP policy VLANs. The three types of DHCP policy VLAN apply to the following scenarios respectively:

  • When a small number of hosts with known MAC addresses access the network, configure the DHCP policy VLAN based on MAC addresses.
  • When a small number of hosts access the network by connecting to the switch, configure the DHCP policy VLAN based on switch interfaces.
  • When a large number of hosts access the network, configure the generic DHCP policy VLAN. The ordinary DHCP policy VLAN is used only when the newly added host does not match the rules of the other two types of DHCP policy VLAN.

You can also configure an 802.1p priority for DHCP packets in a DHCP policy VLAN, so that traffic of DHCP packets can be scheduled through QoS.

Pre-Configuration Tasks

Before configuring the DHCP policy VLAN, complete the following task:

  • Configuring link layer protocol parameters for interfaces to ensure that the link layer protocol status on the interfaces is Up

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run dhcp enable

    Global DHCP is enabled.

    By default, DHCP is disabled.

  3. Configure the attributes of the interface connecting the device to the user host.

    For DHCP policy VLANs, you are advised to configure the interface connecting the device to the user host as a hybrid interface and enable VLAN frames to pass through the interface in untagged mode. For the interface-based DHCP policy VLAN, you must configure the interface as a hybrid interface.
    1. Run the interface interface-type interface-number command to enter the view of the interface connected to the newly added host.

    2. Run the port link-type hybrid command to set the link type of the interface to hybrid.

    3. Run the port hybrid untagged vlan { { vlan-id1 [ to vlan-id2 ] }&<1-10> | all } command to configure the VLANs for the interface. The frames of these VLANs pass through the interface in untagged mode and reach the user host.

      By default, a hybrid interface is added to VLAN1 in untagged mode.

    4. Run the quit command to return to the system view.

  4. Run vlan vlan-id

    The view of the VLAN to which the DHCP server belongs is displayed.

  5. Configure the DHCP policy VLAN in one or all of the following methods:

    • Run dhcp policy-vlan mac-address mac-address1 [ to mac-address2 ] [ priority priority ]

      The DHCP policy VLAN is configured based on MAC addresses.

      By default, no DHCP policy VLAN is configured on the switch based on MAC addresses.

    • Run dhcp policy-vlan port interface-type interface-number1 [ to interface-number2 ] &<1-10> [ priority priority ]

      The DHCP policy VLAN is configured based on switch interfaces.

      By default, no DHCP policy VLAN is configured based on switch interfaces.

    • Run dhcp policy-vlan generic [ priority priority ]

      The generic DHCP policy VLAN is configured.

      By default, no generic DHCP policy VLAN is configured on the switch.

    • If the DHCP policy VLAN based on the same MAC address is configured in multiple VLAN views, only the last configuration takes effect.
    • If the DHCP policy VLAN based on the same interface is configured in multiple VLAN views, only the last configuration takes effect.
    • If the ordinary DHCP policy VLAN is configured in multiple VLAN views, only the last configuration takes effect.

Verifying the Configuration

Run the display current-configuration | include dhcp policy-vlan command to view the configuration of the DHCP policy VLAN.

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