To prevent MAC address flapping, set different MAC address learning priorities for interfaces. When two interfaces learn the same MAC address entries, the MAC address entries learned by the interface with a higher priority override the MAC address entries learned by the other interface.
For S5720-EI, S5720-HI, 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 switches, perform the following operations.
Run system-view
The system view is displayed.
Run interface interface-type interface-number
The interface view is displayed.
Run mac-learning priority priority-id
The MAC address learning priority of the interface is set.
By default, the MAC address learning priority of an interface is 0. A larger priority value indicates a higher MAC address learning priority.
The switch is configured to discard packets when configured to prohibit MAC address flapping.
By default, the action is forward when configured to prohibit MAC address flapping.
For S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI, perform the following operations.
Run system-view
The system view is displayed.
Run mac-spoofing-defend enable
Global MAC spoofing defense is enabled.
By default, global MAC spoofing defense is disabled.
Run interface interface-type interface-number
The interface view is displayed.
Run mac-spoofing-defend enable
MAC spoofing defense is enabled on the interface so that the interface becomes a trusted interface.
By default, MAC spoofing defense is disabled on an interface.
On the S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, and S5735S-S, after MAC spoofing defense is enabled globally, the real-time performance of MAC address flapping detection on the interfaces that are not enabled with MAC spoofing defense decreases.
Run the display current-configuration command to check the MAC address learning priorities of interfaces.