< Home

mac-vlan mac-address

Function

The mac-vlan mac-address command associates a MAC address with a VLAN.

The undo mac-vlan mac-address command cancels the association between MAC addresses and VLANs.

By default, the MAC addresses are not associated with VLANs.

Format

mac-vlan mac-address mac-address [ mac-address-mask | mac-address-mask-length ] [ priority priority ]

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

Parameters

Parameter

Description

Value

mac-address

Specifies the MAC address to be associated with a VLAN.

The value is in H-H-H format. H is a hexadecimal number of 4 digits, for example, 00e0 and fc01. If you enter less than four digits, 0s are prefixed to the input digits. For example, if you enter e0, the system changes e0 to 00e0. The MAC address cannot be 0000-0000-0000, FFFF-FFFF-FFFF, or a multicast MAC address.

mac-address-mask

Specifies the mask of a MAC address.

The value is in H-H-H format. H is a hexadecimal number of 1 to 4 digits. The default value is FFFF-FFFF-FFFF.

mac-address-mask-length

Specifies the length of a MAC address mask.

The value is an integer that ranges from 1 to 48. The default value is 48.

priority priority

Specifies the 802.1p priority of the VLAN to be associated with a MAC address.

The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority. The default value is 0.

all

Specifies all the MAC addresses associated with a VLAN.

-

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If user devices move frequently on a network, you can use the mac-vlan mac-address command to associate MAC addresses with VLANs. The switch then assigns VLANs to packets based on source MAC addresses of packets. Before forwarding a packet, the switch tags the packet with the VLAN associated with the source MAC address. When a user device moves, you do not need to assign a VLAN to the user device again. This improves security and access flexibility on the network.

You can specify the 802.1p priority of the VLAN to be associated with the specific MAC address. In this manner, when the switching device is congested, the switching device preferentially sends frames with high priorities.

Follow-up Procedure

Add an interface to the VLAN and enable MAC address-based VLAN assignment on the interface.

Precautions

  • When the mac-vlan mac-address command with the same MAC address specified is executed multiple times, MAC-VLAN entries take effect according to the longest match principle. On the S5720-EI, S6720-EI, and S6720S-EI, MAC-VLAN entries take effect according to the longest match principle only when the subnet mask has 47 bits or less than 47 bits. A MAC-VLAN entry with a 48-bit subnet mask has the lowest priority.

  • After a MAC address is associated with a VLAN, it cannot be associated with other VLANs.

  • If you run the mac-vlan mac-address command multiple times in the same VLAN view, all the specified MAC addresses are associated with the VLAN.

  • The total number of MAC-VLAN entries is the number of configured MAC-VLAN entries multiplied by the number of interfaces where MAC-VLAN entries are delivered. On different models, the number of MAC-VLAN entries is different:
    • The S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support a maximum of 1024 MAC-VLAN entries and a maximum of 64 MAC-VLAN entries with the mask.
    • The S2720-EI, S5720S-LI, S5730-SI, S5730S-EI, S6720-SI, S6720S-SI, S6720-LI, S6720S-LI, S5720-LI, S5735-L, S5735S-L, and S5735S-L-M support a maximum of 512 MAC-VLAN entries and a maximum of 64 MAC-VLAN entries with the mask.
    • Other models support a maximum of 512 MAC-VLAN entries and a maximum of 32 MAC-VLAN entries with the mask.

Example

# Associate MAC address 22-33-44 with VLAN 100.

<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-vlan mac-address 22-33-44
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >