Configure a MAC Address-Based VLAN
MAC address-based VLANs, also called MAC VLANs, are classified according to the source MAC addresses of the packets. After a MAC VLAN is configured, if the port receives an Untag packet and the source MAC address of the packet matches a MAC VLAN entry, the system adds a VLAN tag for the packet, in which the VLAN ID matches the VLAN ID in the MAC VLAN entry.
After the physical location of the user is changed, if the MAC address of the user is not changed, the VLAN to which the user port belongs need not be re-configured.
Configuration Condition
None
Configure a MAC Address-Based VLAN
Table 3-9 Configuring a MAC Address-Based VLAN
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Configure a MAC VLAN entry.
|
mac-vlan mac-address mac-address vlan vlan-id
|
Mandatory.
By default, no MAC VLAN entry is configured.
|
Enter the L2 Ethernet interface configuration mode.
|
interface interface-name
|
Either
After entering the L2 Ethernet interface configuration mode, the subsequent configuration takes effect only on the current port. After entering the aggregation group configuration mode, the subsequent configuration takes effect only on the aggregation group.
|
Enter the aggregation group configuration mode.
|
interface link-aggregation link-aggregation-id
|
Enable the MAC VLAN function of the port.
|
mac-vlan enable
|
Mandatory.
By default, the MAC VLAN function is disabled on the port.
|
![note](/storage/images/Document/Maipu/note-icon.jpg)
-
The port on which the MAC VLAN function is enabled must be added into the VLAN that matches the entry; otherwise, the port cannot forward packets of the VLAN, and the packets that match the source MAC address will be discarded.