To clear the dynamic address entries from the MAC address table, use the clear mac address-table dynamic command.
clear mac address-table dynamic [[ address mac-addr ] | [ interface { ethernet slot / port | port-channel number }]] [ vlan vlan-id ]
|
address
mac-addr
|
(Optional) Specifies the MAC address to remove from the table. Use the format EEEE.EEEE.EEEE.
|
|
interface
|
(Optional) Specifies the interface for which MAC addresses should be removed from the table. The type can be either Ethernet or EtherChannel.
|
|
ethernet
slot
/
port
|
(Optional) Specifies the Ethernet interface and the slot number and port number. The slot number is from 1 to 255, and the port number is from 1 to 128.
|
|
port-channel
number
|
(Optional) Specifies the EtherChannel for which MAC addresses should be removed from the table. Use the EtherChannel number. The
number
range is from 1 to 4096.
|
|
vlan
vlan-id
|
(Optional) Specifies the VLAN from which MAC addresses should be removed from the table. The range is from 1 to 3967 and from 4049 to 4093.
|
None
EXEC mode
|
Release
|
Modification
|
|
4.0(0)N1(1a)
|
This command was introduced.
|
|
4.2(1)N1(1)
|
The command syntax is changed to
clear mac address-table dynamic
.
|
Use the clear mac address-table dynamic command with no arguments to remove all dynamic entries from the table.
To clear static MAC addresses from the table, use the no mac address-table static command.
If the clear mac address-table dynamic command is entered with no options, all dynamic addresses are removed. If you specify an address but do not specify an interface, the address is deleted from all interfaces. If you specify an interface but do not specify an address, the switch removes all addresses on the specified interfaces.
This example shows how to clear all the dynamic entries from the MAC address table:
This example shows how to clear all the dynamic entries from the MAC address table for VLAN 2:
|
Command
|
Description
|
|---|---|
|
show mac address-table
|
Displays the information about the MAC address table.
|