< Home

mac-learning smart vlan enable

Function

The mac-learning smart vlan enable command enables flexible MAC address learning in a specified VLAN.

The undo mac-learning smart vlan enable command disables flexible MAC address learning in a specified VLAN.

By default, flexible MAC address learning is disabled in a VLAN.

Format

mac-learning smart vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> enable

undo mac-learning smart vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> enable

Parameters

Parameter Description Value
vlan-id1 Specifies the start VLAN ID. The value is an integer ranging from 1 to 4094.
to vlan-id2 Specifies the end VLAN ID. The value is an integer ranging from 1 to 4094. The value of vlan-id2 must be greater than the value of vlan-id1.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Enterprises usually adopt the ring or tree network topology to construct enterprise networks. Both network topologies require that devices at the convergence layer be able to learn a large number of MAC addresses in the case of enormous number of attached users.

As the number of attached users keeps growing, the specification of MAC entries supported by the devices cannot meet the need. As a result, MAC addresses of some users cannot be learned, and the packets of these users are broadcast in the VLAN, wasting network bandwidth and affecting the network performance.

To prevent the preceding problem, you can run the mac-learning smart vlan enable command in the system view to enable flexible MAC address learning in a VLAN. When less than three interfaces in the VLAN are Up, the system automatically disables MAC address learning in the VLAN, avoiding unnecessary resource consumption due to MAC address learning.

Prerequisites

The command takes effect only when the following operations are complete.
  1. Run the vlan command to create a VLAN. If the device supports the dynamic VLAN function, you do not need to run the vlan command to create the VLAN.
  2. Run the undo mac-address learning disable command in the VLAN view to enable MAC address learning.

Precautions

The system will delete the MAC entries after enabling flexible MAC address learning in the specified VLAN. When the number of Up interfaces in the VLAN exceeds 2, the system automatically enables MAC address learning in the VLAN. If a VLAN is configured as a MUX VLAN or is used as the outer VLAN in VLAN stacking or VLAN mapping configuration, flexible MAC address learning does not take effect in the VLAN.

If the mac-learning smart vlan command is run more than once, all configurations take effect.

Example

# Configure the system to automatically disable MAC address learning in VLAN 10.

<HUAWEI> system-view
[HUAWEI] undo mac-learning smart vlan 10 enable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >