Configuring a MAC Address Learning Priority for an Interface
Context
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.Procedure
For S5720EI, S5720HI, S5730HI, S6720EI, S6720HI, and S6720S-EI 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.
- Run mac-learning
priority flapping-defend action discard
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 S1720GF, S1720GFR, S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720I-SI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720LI, S6720S-LI, S6720S-SI, and S6720SI, 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.
Verifying the Configuration
Run the display current-configuration command to check the MAC address learning priorities of interfaces.