No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


Fat AP and Cloud AP V200R010C00 Command Reference

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
mac-address learning disable

mac-address learning disable


The mac-address learning disable command disables MAC address learning.

The undo mac-address learning disable command enables MAC address learning.

By default, MAC address learning is enabled.


(Interface view) mac-address learning disable [ action { discard | forward } ]

(VLAN view) mac-address learning disable

undo mac-address learning disable






Indicates the action that the interface takes after MAC address learning is disabled.

  • This parameter takes effect only in the interface view, and the specified interface must be a Layer 2 interface.

  • You can use this parameter to determine whether packets are forwarded when the specified interface does not need to learn MAC addresses.

By default, an interface forwards the packets carrying new MAC addresses after MAC address learning is disabled.



Discards the packets whose source MAC addresses do not match the MAC address table.



Forwards the packets according to the MAC address table.



VLAN view, GE interface view, Eth-Trunk interface view, XGE interface view, MultiGE interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If you want an interface to forward only packets with certain MAC addresses, use this command. For example, if an interface is connected to a server, configure a static MAC address entry with the MAC address of the server, and then disable MAC address learning and set the action to discard on the interface. The configuration prevents other servers or terminals from accessing the interface and improves network stability and security.

When an wireless access point with MAC address learning enabled receives an Ethernet frame, it records the source MAC address and inbound interface of the Ethernet frame in a MAC address entry. When receiving other Ethernet frames destined for this MAC address, the wireless access point forwards the frames through the corresponding outbound interface according to the MAC address entry. MAC address learning reduces broadcast packets on a network.

You can use the mac-address learning disable command to disable MAC address learning on an interface. The action performed on received packets can be set to discard or forward.

  • When the action is set to forward, the wireless access point forwards packets according to the MAC address table. If a packet does not match any MAC address entry, the wireless access point broadcasts the packet.
  • When the action is set to discard, the wireless access point searches for the source MAC address of the packet in the MAC address table. If the source MAC address is found in the MAC address table, the wireless access point forwards the packet according to the MAC address entry. If the source MAC address is not found, the wireless access point discards the packet. The default action is forward.


The action cannot be configured in the VLAN view.

After MAC address learning is disabled on an interface, the device does not learn new MAC addresses on the interface, but untrusted terminals can still access the network.


# Disable MAC address learning in VLAN 2.

<Huawei> system-view
[Huawei] vlan 2
[Huawei-vlan2] mac-address learning disable
Updated: 2019-11-21

Document ID: EDOC1100064352

Views: 249551

Downloads: 140

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next