Support model and software version:
ECS4100 Series V1.2.24.182 and above.
A MAC-thrashing feature can be configured on the switch to detect traffic with identical MAC addresses being received on different physical ports. Once detected, the system can then take a configured action(stop-learning/port-disable/link-down) on a port. In this way, MAC-thrashing can detect switching loops and take an appropriate action in order to eliminate the loop condition and prevent CPU overload caused by the constant switching of the learned MAC address in the Forwarding Database (FDB).
Topology
Note: Inject the packet to the port 1 and port 2 with the same Source MAC address.
(1) When mac-thrashing is disabled (default value).
User injected the packet to the port 2 first, the switch learned the MAC address which user injected on the port 2.
The command "show mac-address-table" to make sure the switch learned the MAC address.
Then injected the packet to the port 1, the switch learned the MAC address which user injected at the port 1, and clearing the MAC address which learned before.
(2) Enable mac-thrashing on the switch.
Repeat the testing, the switch learned the MAC address at the port 2 first.
Enable the mac-thrashing at port 1.
Console#con Console(config)#mac-address-table mac-thrashing interface ethernet 1/1 ? action Responses to take action when Mac Thrashing detected enable Enables mac-thrashing to this interface Console(config)#$-table mac-thrashing interface ethernet 1/1 enable ? <cr> Console(config)#mac-address-table mac-thrashing interface ethernet 1/1 enable Console(config)#mac-address-table mac-thrashing interface ethernet 1/1 action ? link-down Disable PHY link port-disable Stops switching packets stop-learning Stops learning MAC address Console(config)#mac-address-table mac-thrashing interface ethernet 1/1 action link-down Console(config)#end
Inject the packet to the port 1.
Since the switch port 1 detect the same MAC address on port 2, then port 1 will link down by mac-thrashing.