The vlan precedence command configures the device to preferentially use a VLAN assignment mode when both MAC address-based and IP subnet-based VLAN assignment modes are matched.
The undo vlan precedence command restores the default VLAN assignment mode on an interface when both MAC address-based and IP subnet-based VLAN assignment modes are matched.
By default, MAC address-based VLAN assignment takes precedence over IP subnet-based VLAN assignment.
Only the S5720-EI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-EI, S6720-LI, S6720S-EI, S6720S-LI, S6720S-SI, and S6720-SI support this command.
Parameter |
Description |
Value |
---|---|---|
ip-subnet-vlan |
Indicates that IP subnet-based VLAN assignment takes precedence over MAC address-based VLAN assignment. |
- |
mac-vlan |
Indicates that MAC address-based VLAN assignment takes precedence over IP subnet-based VLAN assignment. |
- |
system view, Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, Eth-Trunk interface view, MultiGE interface view, port group view
S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI supports the vlan precedence command only in the system view. Other switches support the vlan precedence command only in the interface view.
Usage Scenario
You can configure all the VLAN assignment methods simultaneously on the switch. By default, the priority order of VLAN assignment methods is: policy-based VLAN > MAC address-based > IP subnet-based > protocol-based > port-based.
The vlan precedence command changes the priority order of MAC address-based VLAN assignment and IP subnet-based VLAN assignment. For example, the vlan precedence ip-subnet-vlan command makes IP subnet-based VLAN assignment take precedence over MAC address-based VLAN assignment.
Currently, port-based VLAN assignment is used most widely.
Precautions
This command does not change the priority order of the other VLAN assignment methods.
Packets may be transmitted in a different VLAN after the priority order of MAC address-based VLAN assignment and IP subnet-based VLAN assignment changes. This may cause a traffic forwarding failure in the VLAN.
When the command is used on the S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720S-SI, and S6720-SI to adjust the priority, the command is valid for MAC-VLAN entries with the mask and without the mask. The command is valid for only MAC-VLAN entries without the mask on other models.
If you run the vlan precedence command multiple times in the same interface view, only the latest configuration takes effect.