Configuring static MAC-based VLAN assignment

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Create a MAC-to-VLAN entry.

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

N/A

3. Enter Layer 2 Ethernet interface view.

interface interface-type interface-number

N/A

4. Configure the link type of the port as hybrid.

port link-type hybrid

By default, all ports are access ports.

5. Configure the hybrid port to forward packets from the MAC-based VLANs.

port hybrid vlan vlan-id-list { tagged | untagged }

By default, a hybrid port is an untagged member of the VLAN to which the port belongs when its link type is access.

6. Enable the MAC-based VLAN feature.

mac-vlan enable

By default, this feature is disabled.

7. (Optional.) Configure VLAN matching order.

vlan precedence { mac-vlan | ip-subnet-vlan }

By default, the system assigns VLANs based on the MAC address preferentially.