Configuring Clearing of Learned MAC Addresses
Use the following commands to clear learned MAC addresses from a port or list of ports, a specific VLAN, or to clear a specific MAC address from a VLAN.
Syntax
clear mac-address port <port-list>
Removes MAC addresses that were learned on the specified port or ports in <port-list> . Use all to remove all MAC addresses in the MAC address table.
switch(config)# clear mac-address port 4-7
Syntax
clear mac-address vlan <vid>
Removes all MAC addresses that were learned on the specified VLAN.
switch(config)# clear mac-address vlan 2
Syntax
clear mac-address vlan <vid> mac<mac-addr>
Removes the specified MAC address from the specified VLAN
switch(config)# clear mac-address vlan 2 mac 0001e6-b197a8
To view the results from clearing a MAC address,
use the show mac-address
command with the appropriate
option.