mac-vlan mac-address

Use mac-vlan mac-address to configure a MAC-to-VLAN entry.

Use undo mac-vlan to delete the specified MAC-to-VLAN entries.

Syntax

mac-vlan mac-address mac-address [ mask mac-mask ] vlan vlan-id [ dot1q pri ]

undo mac-vlan { all | mac-address mac-address [ mask mac-mask ] | vlan vlan-id }

Default

No MAC-to-VLAN entries are configured.

Views

System view

Predefined user roles

network-admin

Parameters

mac-address mac-address: Specifies a MAC address.

mask mac-mask: Specifies the MAC address mask. For the mac-mask argument, the high-order bits must be consecutive 1s in binary notation or consecutive Fs in hexadecimal notation. The default value is all Fs in hexadecimal notation.

vlan vlan-id: Specifies a VLAN ID in the range of 1 to 4094.

dot1q pri: Specifies the 802.1p priority of the VLAN specific to the MAC-to-VLAN entry. The value range for the pri argument is 0 to 7, and the default value is 0.

all: Deletes all static MAC-to-VLAN entries.

Usage guidelines

For successful dynamic MAC-based VLAN assignment, use static VLANs when you create MAC-to-VLAN entries.

Different types of MAC-to-VLAN entries are created depending on whether you specify the mask keyword.

These different types of MAC-to-VLAN entries are stored separately in two tables. The system updates the two tables according to the configuration.

Examples

# Associate the MAC address 0-1-1 with VLAN 100, and specify the 802.1p priority as 7 for VLAN 100 in this entry.

<Sysname> system-view
[Sysname] mac-vlan mac-address 0-1-1 vlan 100 dot1q 7

# Associate VLAN 100 with MAC addresses whose six high-order bits are 121122, and specify the 802.1p priority as 4 for VLAN 100 in this entry.

<Sysname> system-view
[Sysname] mac-vlan mac-address 1211-2222-3333 mask ffff-ff00-0000 vlan 100 dot1q 4

Related commands

display mac-vlan