To remove a specified address (or set of addresses) from the MAC address table, use the
clearmac-address-tablecommand inprivileged EXEC mode.
Using Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers
clear
mac-address-table
[ dynamic | restricted
static | permanent ]
[ address
mac-address ]
[ interface
type
module
port ]
clear
mac-address-table
notification
mac-move
counter
[vlan]
clear
mac-address-table
dynamic
[ address
mac-address | interface
interface-type
interface-number | vlan
vlan-id ]
Syntax Description
dynamic
|
(Optional) Clears only dynamic addresses.
|
secure
|
(Optional) Clears only secure addresses.
|
static
|
(Optional) Clears only static addresses.
|
restricted
static
|
(Optional) Clears only restricted static addresses.
|
permanent
|
(Optional) Clears only permanent addresses.
|
address
|
(Optional) Clears only a specified address.
|
mac
-address
|
(Optional) Specifies the MAC address.
|
interface
|
(Optional) Clears all addresses for an interface.
|
type
|
(Optional) Interface type: ethernet, fastethernet, fddi, atm, or port channel.
|
slot
|
(Optional) The module interface number.
|
interface-type
interface-number
|
(Optional) Module and port number. The see the “Usage Guidelines” section for valid values.
|
notification
mac-move
counter
|
Clears the MAC-move notification counters.
|
vlan
|
(Optional) Specifies the VLAN to clear the MAC-move notification counters.
|
protocol
assigned
|
(Optional) Specifies the assigned protocol accounts for such protocols such as DECnet, Banyan VINES, and AppleTalk.
|
protocol
ip
|
ipx
|
(Optional) Specifies the protocol type of the entries to clear.
|
protocol
other
|
(Optional) Specifies the protocol types (other than IP or IPX) of the entries to clear.
|
vlan
vlan-id
|
(Optional) Specifies the VLAN ID; valid values are from 1 to 4094.
|
module
|
(Optional) The module interface number:
- 0 for fixed
- 1 or A for module A
- 2 or B for module B
|
port
|
(Optional)
Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers:
Port interface number ranges based on type of Ethernet switch network module used:
- 0 to 15 for NM-16ESW
- 0 to 35 for NM-36ESW
- 0 to 1 for Gigabit Ethernet
Catalyst Switches
Port interface number ranging from 1 to 28:
- 1 to 25 for Ethernet (fixed)
- 26, 27 for Fast Ethernet (fixed)
- Port channel
|
Command Default
Using Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers
All MAC addresses on the router being configured are cleared.
Using Catalyst Switches
The dynamic addresses are cleared.
Clearing a Dynamic Address
This command has no defaults in this mode.
Command Modes
Privileged EXEC (#)
Command History
Release
|
Modification
|
12.2(2)XT
|
This command was introduced on Cisco 2600 series, Cisco 3600 series, and Cisco 3700 series routers.
|
12.2(8)T
|
This command was integrated into Cisco IOS Release 12.2(8)T on Cisco 2600 series, Cisco 3600 series, and Cisco 3700 series routers.
|
12.2(11)T
|
This command was integrated into Cisco IOS Release 12.2(11)T.
|
12.2(14)SX
|
Support for this command was introduced on the Supervisor Engine 720.
|
12.2(17d)SXB
|
Support for this command on the Supervisor Engine 2 was extended to Cisco IOS Release 12.2(17d)SXB.
|
12.2(33)SRA
|
This command was integrated into Cisco IOS Release 12.2(33)SRA.
|
12.2(33)SXI
|
This command was changed to add the
notificationmac-movecounter [vlan] keywords and argument.
|
Usage Guidelines
Using Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers
If the
clearmac-address-table command is invoked with no options, all MAC 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, all addresses on the specified interface are removed.
Using Catalyst Switches
If the
clearmac-address-table command is invoked 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, all addresses on the specified interface are removed.
If a targeted address is not present in the MAC forwarding table, the following error message appears:
MAC address not found
Clearing a Dynamic Address
The valid values for the
interface argument include thege-wan,
atm, and
pos keywords that are supported on Cisco 7600 series routers that are configured with a Supervisor Engine 2.
The
protocol {assigned |
ip |
ipx|
other} keywords are supported on Cisco 7600 series routers that are configured with a Supervisor Engine 2 only.
Enter the
clearmac-address-tabledynamic command to remove all dynamic entries from the table.
The following values are valid for
interface-type:
- fastethernet
- gigabitethernet
- port-channel
Setting the Module and Port
The
interface-number argument designates the module and port number. Valid values for
interface-number depend on the specified interface type and the chassis and module that are used. For example, if you specify a Gigabit Ethernet interface and have a 48-port 10/100BASE-T Ethernet module that is installed in a 13-slot chassis, valid values for the module number are from 1 to 13 and valid values for the port number are from 1 to 48.
Examples
Using Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers
The following example shows how to clear all dynamic addresses in the MAC forwarding table:
Router# clear mac-address-table dynamic
The following example shows how to clear the static address 0040.C80A.2F07 on Ethernet port 1:
Router# clear mac-address-table static address 0040.C80A.2F07 interface ethernet 0/1
Using Catalyst Switches
The following example shows how to clear all dynamic addresses in the MAC forwarding table:
Router# clear mac-address-table dynamic
The following example shows how to clear the MAC-move notification counters on a specific VLAN:
Router# clear mac-address-table notification mac-move counter 202
The following example shows the permanent address 0040.C80A.2F07 being cleared on Ethernet port 1:
Router# clear mac-address-table permanent address 0040.C80A.2F07 interface ethernet 0/1
Clearing a Dynamic Address on a 7600 using a Supervisor Engine 2
This example shows how to clear all dynamic Layer 2 entries for a specific interface (abc) and protocol type (IPX):
Router# clear mac-address-table dynamic interface abc protocol ipx
Related Commands
Command
|
Description
|
mac
-address-tableaging-time
|
Configures the length of time the switch keeps dynamic MAC addresses in memory before discarding.
|
mac
-address-tablepermanent
|
Associates a permanent unicast or multicast MAC address with a particular switched port interface.
|
mac
-address-tablerestrictedstatic
|
Associates a restricted static address with a particular switched port interface.
|
mac
-address-tablesecure
|
Associates a secure static address with a particular switched port interface.
|
mac-address-table
static
|
Adds static entries to the MAC-address table or configures a static MAC address with IGMP snooping disabled for that address.
|
show
mac
-address-table
|
Displays addresses in the MAC address table for a switched port or module.
|
show
mac
-address-tablesecure
|
Displays the addressing security configuration.
|
show
mac
-address-tablesecurity
|
Displays the addressing security configuration.
|