124Step Command Remarks4. Configure the link type ofthe port as hybrid. port link-type hybrid By default, all ports are accessports.5. Assign the hybrid port tothe MAC-based VLANs.port hybrid vlan vlan-id-list { tagged |untagged }By default, a hybrid port is anuntagged member of the VLANto which the port belongs whenits link type is access.6. Enable the MAC-basedVLAN feature. mac-vlan enable By default, this feature isdisabled.7. (Optional.) Configure thesystem to assign VLANsbased on the MACaddress preferentially.vlan precedence mac-vlanBy default, the system assignsVLANs based on the MACaddress preferentially when boththe MAC-based VLAN and IPsubnet-based VLAN areconfigured on a port.Configuring dynamic MAC-based VLAN assignmentConfiguration restrictions and guidelinesWhen you configure dynamic MAC-based VLAN assignment, follow these restrictions and guideline:• As a best practice to ensure correct operation of 802.1X and MAC authentication, do not usedynamic MAC-based VLAN assignment with 802.1X or MAC authentication.• When dynamic MAC-based VLAN assignment is enabled on a port, the configuration of MAClearning limit and disabling of MAC address learning do not take effect.• For successful dynamic MAC-based VLAN assignment, use static VLANs when you createMAC-to-VLAN entries.• As a best practice, do not use dynamic MAC-based VLAN assignment with MSTP. In MSTPmode, if a port is blocked in the MSTI of its target VLAN, the port drops the received packetsinstead of delivering them to the CPU. As a result, the port will not be dynamically assigned tothe target VLAN.• As a best practice, do not use dynamic MAC-based VLAN assignment with PVST. In PVSTmode, if the target VLAN of a port is not permitted on the port, the port is placed in blocked state.The port drops the received packets instead of delivering them to the CPU. As a result, the portwill not be dynamically assigned to the target VLAN.• As a best practice, do not configure both dynamic MAC-based VLAN assignment and automaticvoice VLAN assignment mode on a port. They can have a negative impact on each other.Configuration procedureTo configure dynamic MAC-based VLAN assignment:Step Command Remarks1. Enter system view. system-view N/A2. Create a MAC-to-VLANentry.mac-vlan mac-addressmac-address vlan vlan-id[ dot1q priority ]By default, no MAC-to-VLAN entryexists.3. Enter Layer 2 Ethernetinterface view.interface interface-typeinterface-number N/A4. Configure the link type ofthe port as hybrid. port link-type hybrid By default, all ports are accessports.