Enabling MAC Address Learning

Packets can be forwarded according to MAC addresses only after MAC address learning is enabled.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run vsi vsi-name [ static | auto ]

    The VSI view is displayed.

  3. Run mac-learning { enable | disable }

    MAC address learning is enabled.

    If MAC address learning is disabled for a VSI, the VSI cannot automatically learn MAC addresses, causing packets to be broadcast on the network. Exercise caution when disabling the MAC address learning.

  4. Run mac-learn-style { qualify | unqualify }

    A MAC address learning mode is specified.

    Since E2E negotiation on the MAC address learning mode in a VSI is not supported, the MAC address learning modes must be consistent in an E2E scenario. If a mode inconsistency occurs, the VLAN ID-based MAC address learning may become incorrect or packets may be discarded.

    In an HVPLS scenario, you are not advised to enable MAC address learning in qualified mode on an SPE. If the qualified mode needs to be enabled, the types of access interfaces on PEs at both ends must be consistent. The interface type can only be the dot1q VLAN tag termination sub-interface, QinQ mapping sub-interface, or QinQ stacking sub-interface. When the qualified mode is configured on an SPE, the type of VLAN tag used to learn MAC addresses must be specified. That is, the outer-vlan or inner-vlan parameter must be specified in the mac-learn-style qualify { outer-vlan | inner-vlan } command.

    • outer-vlan: learns MAC addresses based on outer VLAN tags.
    • inner-vlan: learns MAC addresses based on inner VLAN tags.

    In an HVPLS scenario, after a remote PE is bound to a dot1q VLAN tag termination sub-interface, to enable the SPE to learn MAC addresses in qualified mode, run the mac-learn-style qualify outer-vlan command. After a QinQ mapping or stacking sub-interface is bound to a remote PE, to enable the SPE to learn MAC addresses in qualified mode, run the mac-learn-style qualify inner-vlan or mac-learn-style qualify command on the SPE.

    After the mac-learn-style qualify command is run for a VSI, only a dot1q VLAN tag termination sub-interface, QinQ mapping sub-interface, or QinQ stacking sub-interface can be bound to the VSI. If outer-vlan is specified, only a dot1q VLAN tag termination sub-interface can be bound to the VSI. If inner-vlan is specified, only a QinQ mapping or QinQ stacking sub-interface can be bound to the VSI.

    After a dot1q VLAN tag termination sub-interface is bound to a VSI, MAC address learning in qualify mode cannot be configured. Therefore, you need to run the mac-learn-style qualify command before binding the sub-interface to a VSI. After a dot1q VLAN tag termination sub-interface is bound to a VSI, MAC address learning in qualify mode cannot be disabled. To restore the default MAC address learning mode of the VSI, unbind the dot1q VLAN tag termination sub-interface from the VSI first.

  5. Run mac-address aging-time { interval | [ local local-seconds | remote remote-seconds ] }

    The aging time is set for dynamic MAC addresses.

    If the interval value is set to 0s, MAC address entries never age.

    An aging timer is started for each dynamic MAC address entry. If the MAC address entries are not updated within the aging time, the entries will be deleted after the aging time elapses.

  6. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >