How to disable MAC address learning on S series switches

5

For S series switches (except the S1700), you can use the following methods to disable MAC address learning:
1. Disable MAC address learning on an interface.
[HUAWEI] interface gigabitethernet0/0/3
[HUAWEI-GigabitEthernet0/0/3] mac-address learning disable
2. Disable MAC address learning in a VLAN.
[HUAWEI] vlan 2
[HUAWEI-vlan2] mac-address learning disable

Other related questions:
Is MAC address of virtual machine learned by S series switch correct?
It is normal that S series switches (except S1700 switches) can learn MAC addresses of VMs. MAC address learning is the prerequisite for communication.

Disabling the MAC address learning function when configuring remote mirroring on S series switches
For S series switches, after Layer 2 remote port mirroring is configured, mirrored packets are forwarded to intermediate devices through a VLAN and then to the monitoring device by following the general Layer 2 forwarding process. The mirrored packets cannot be forwarded according to the MAC address tables on the intermediate devices because their destination MAC addresses are the same as those of the original packets but not the MAC address of the monitoring device. The mirrored packets must be treated as unknown unicast packets and broadcast to all interfaces in the VLAN. The mirrored packets can be forwarded to the monitoring device in broadcast mode as long as the MAC address table of the VLAN contains no entry matching the destination MAC addresses of the mirrored packets. If the mirrored packets cannot reach the monitoring device, the MAC address tables on the intermediate devices may contain entries matching the destination MAC addresses of the mirrored packets. If this occurs, the mirrored packets are forwarded according to the MAC address tables and cannot reach the monitoring device. In this case, you need to run the mac-address learning disable command in the VLAN view to disable the MAC address learning function.

How can I configure the limit on MAC address learning on CE switches
Run the mac-address limit maximum max-num command in the interface or VLAN view to change the maximum number of MAC addresses learned by an interface or VLAN. By default, no limit on MAC address learning is configured. The value of max-num ranges from 0 to 32767. 0 indicates that the number of MAC addresses learned by an interface or VLAN is not limited. # Configure 10GE1/0/1 to learn a maximum of 30 MAC addresses.
system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] mac-address limit maximum 30 [*HUAWEI-10GE1/0/1] commit
# Configure VLAN 10 to learn a maximum of 20 MAC addresses.
system-view [~HUAWEI] vlan 10
[*HUAWEI-vlan10] mac-address limit maximum 20 [*HUAWEI-vlan10] commit Description: After a limit on MAC address learning is configured on an interface of a CE12800 switch, the number of VLAN, VXLAN, and VSI packets received on the interface is limited by the number of learned MAC addresses. For CE8800&CE7800&CE6800&CE5800 series switches, only VXLAN packets received on an interface are not limited by the number of learned MAC addresses.

Why Is one MAC address learned in multiple VLANs on S series switch
On S series switches (except S1700), MAC addresses are learned based on MAC addresses+VLANs. If multiple VLANs receive packets with the same MAC address, these VLANs will learn the same MAC address.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top