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:
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.
Before configuring the DHCP policy VLAN, complete the following task:
The system view is displayed.
Global DHCP is enabled.
By default, DHCP is disabled.
Run the interface interface-type interface-number command to enter the view of the interface connected to the newly added host.
Run the port link-type hybrid command to set the link type of the interface to hybrid.
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.
Run the quit command to return to the system view.
The view of the VLAN to which the DHCP server belongs is displayed.
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.