No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Command Reference

S1720, S2700, S5700, and S6720 V200R011C10

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DHCP Policy VLAN Configuration Commands

DHCP Policy VLAN Configuration Commands

Command Support

Only the S1720X, S1720X-E, S5720EI, S5720HI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720S-SI, and S6720SI support the DHCP policy VLAN configuration commands.

dhcp policy-vlan generic

Function

The dhcp policy-vlan generic command configures the generic DHCP policy VLAN.

The undo dhcp policy-vlan generic command deletes the generic DHCP policy VLAN.

By default, the function of generic DHCP policy VLAN is disabled on the device.

Format

dhcp policy-vlan generic [ priority priority ]

undo dhcp policy-vlan generic

Parameters

Parameter

Description

Value

priority priority

Specifies the 802.1p priority of DHCP messages.

The value is an integer that ranges from 0 to 7. The default value is 0.

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

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:
  • DHCP policy VLAN based on MAC addresses
  • DHCP policy VLAN based on interfaces
  • Generic DHCP policy VLAN

On a network supporting VLAN assignment based on IP subnets, upon receiving an untagged packet from a host, a switch adds a VLAN ID to the packet based on the source IP address of the packet. A host that accesses the network for the first time does not have a valid IP address. Therefore, the switch cannot add the host to the VLAN and the host cannot obtain a valid IP address or network settings. To make the host obtain a valid IP address from the DHCP server, run the dhcp policy-vlan generic command to configure the generic policy VLAN.

Hosts that access the network for the first time apply the generic DHCP policy VLAN only when they cannot apply DHCP policy VLAN based on MAC addresses or interfaces.

Prerequisites

DHCP has been enabled globally using the dhcp enable command in the system view.

Precautions

If you run this command in multiple VLAN views, only the latest configuration takes effect.

Example

# Configure the generic DHCP policy VLAN, associate DHCP packets that match no MAC address or interface to VLAN 100, and set the 802.1p priority of the packets to 5.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] dhcp policy-vlan generic priority 5

dhcp policy-vlan mac-address

Function

The dhcp policy-vlan mac-address command configures the MAC address-based DHCP policy VLAN.

The undo dhcp policy-vlan mac-address command deletes the MAC address-based DHCP policy VLAN.

By default, the function of DHCP policy VLAN based on MAC addresses is disabled on the device.

Format

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

undo dhcp policy-vlan mac-address mac-address1 [ to mac-address2 ]

Parameters

Parameter

Description

Value

mac-address1 [ to mac-address2 ]

Specifies the MAC addresses of user hosts that access the network for the first time.
  • mac-address1 specifies the start MAC address.
  • to mac-address2 specifies the end MAC address. mac-address2 must be greater than mac-address1. mac-address2 and mac-address1 specify the MAC address range. If to mac-address2 is not specified, DHCP policy VLAN based on only the MAC address specified by mac-address1 is configured.

mac-address1 and mac-address2 are in the format of H-H-H. An H contains one to four hexadecimal numbers.

NOTE:
The range specified by mac-address1 and mac-address2 cannot contain multicast MAC addresses, broadcast MAC addresses, and all 0 address. The number of MAC addresses cannot exceed 512.

priority priority

Specifies the 802.1p priority of DHCP messages.

The value is an integer that ranges from 0 to 7. The default value is 0.

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

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:
  • DHCP policy VLAN based on MAC addresses
  • DHCP policy VLAN based on interfaces
  • Generic DHCP policy VLAN

On a network supporting VLAN assignment based on IP subnets, upon receiving an untagged packet from a host, a switch adds a VLAN ID to the packet based on the source IP address of the packet. A host that accesses the network for the first time does not have a valid IP address. Therefore, the switch cannot add the host to the VLAN and the host cannot obtain a valid IP address or network settings. To make the host obtain a valid IP address from the DHCP server, run the dhcp policy-vlan mac-address command to configure the MAC address-based DHCP policy VLAN.

Prerequisites

DHCP has been enabled globally using the dhcp enable command in the system view.

Precautions

If you run this command based on the same MAC address in multiple VLAN views, only the latest configuration takes effect.

Example

# Configure the MAC address-based DHCP policy VLAN, associate DHCP packets from the host with the MAC address 0001-0001-0001 to VLAN 100, and set the 802.1p priority of the packets to 5.

<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] dhcp policy-vlan mac-address 1-1-1 priority 5

dhcp policy-vlan port

Function

The dhcp policy-vlan port command configures the interface-based DHCP policy VLAN.

The undo dhcp policy-vlan port command deletes the interface-based DHCP policy VLAN.

By default, the function of DHCP policy VLAN based on interfaces is disabled on the device.

Format

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

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

Parameters

Parameter

Description

Value

interface-type interface-number1 [ to interface-number2 ] &<1-10>

Specifies the interface type and interface number.
  • interface-type specifies the type of an interface.
  • interface-number1 specifies the number of the start interface.
  • to interface-number2 specifies the number of the end interface. interface-number2must be greater than interface-number1. interface-number2 and interface-number1 specify the interface range. If to interface-number2 is not specified, DHCP policy VLAN based on only the interface specified by interface-number1 is configured.
NOTE:

The interface cannot be a stack interface.

-

priority priority

Specifies the 802.1p priority of DHCP messages.

The value is an integer that ranges from 0 to 7. The default value is 0.

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

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:
  • DHCP policy VLAN based on MAC addresses
  • DHCP policy VLAN based on interfaces
  • Generic DHCP policy VLAN

On a network supporting VLAN assignment based on IP subnets, upon receiving an untagged packet from a host, a switch adds a VLAN ID to the packet based on the source IP address of the packet. A host that accesses the network for the first time does not have a valid IP address. Therefore, the switch cannot add the host to the VLAN and the host cannot obtain a valid IP address or network settings. To make the host obtain a valid IP address from the DHCP server, run the dhcp policy-vlan port command to configure the interface-based policy VLAN.

Prerequisites

DHCP has been enabled globally using the dhcp enable command in the system view.

Precautions

If you run this command on an interface in multiple VLAN views, only the latest configuration takes effect.

NOTE:

The interface-based DHCP policy VLAN takes effect only for hybrid interfaces. If an interface is not hybrid, run the port link-type hybrid command to configure it as a hybrid interface.

Example

# Configure the interface-based DHCP policy VLAN, associate DHCP packets received on GigabitEthernet0/0/1 with VLAN 100, and set the 802.1p priority of the packets to 5.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI--GigabitEthernet0/0/1] port link-type hybrid
[HUAWEI--GigabitEthernet0/0/1] quit
[HUAWEI] dhcp enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] dhcp policy-vlan port gigabitethernet 0/0/1 priority 5
Translation
Download
Updated: 2019-04-18

Document ID: EDOC1000178165

Views: 41807

Downloads: 1101

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next