Example for Configuring MAC Address Flapping Detection
Networking Requirements
As shown in Figure 2-12, a loop occurs on a user network because network cables between two LSWs are incorrectly connected. The loop causes MAC address flapping and bridge table flapping.
You can enable MAC address flapping detection on the Switch to detect MAC address flapping and discover loops.
Configuration Roadmap
The configuration roadmap is as follows:
Enable MAC address flapping detection.
Set the aging time of flapping MAC addresses.
Configure the action performed on the interface when MAC address flapping is detected on the interface to prevent loops.
Procedure
- Enable MAC address flapping detection.
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] mac-address flapping detection [*Switch] commit
- Set the aging time of flapping MAC addresses.
[~Switch] mac-address flapping aging-time 500 [*Switch] commit
- Shut down 10GE1/0/1 and 10GE1/0/2 when MAC address flapping is detected.
[~Switch] interface 10ge 1/0/1 [~Switch-10GE1/0/1] mac-address flapping trigger error-down [*Switch-10GE1/0/1] quit [*Switch] interface 10ge 1/0/2 [*Switch-10GE1/0/2] mac-address flapping trigger error-down [*Switch-10GE1/0/2] quit [*Switch] commit
- Configure automatic recovery and set the automatic recovery
time for the shutdown interface.
[~Switch] error-down auto-recovery cause mac-address-flapping interval 500 [*Switch] commit
- Verify the configuration.
After the configuration is complete, when the MAC address on 10GE1/0/1 flaps to 10GE1/0/2, 10GE1/0/2 is shut down. Run the display mac-address flapping command to view the flapping records.
[~Switch] display mac-address flapping MAC Address Flapping Configurations : ------------------------------------------------------------------------------- Flapping detection : Enable Aging time(s) : 500 Quit-VLAN Recover time(m) : -- Exclude VLAN-list : -- Security level : Middle Exclude BD-list : -- ------------------------------------------------------------------------------- S : start time E : end time (D) : error down ------------------------------------------------------------------------------- Time : S:2017-08-24 14:40:11 E:2017-08-24 14:40:23 VLAN/BD : 1/- MAC Address : 0025-9e95-7c24 Original-Port: 10GE1/0/1 Move-Ports : 10GE1/0/2(D) MoveNum : 83 ------------------------------------------------------------------------------- Total items on slot 1: 1