The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
To clear the dynamic address entries from the MAC address table in Layer 2, use the clear mac address-table dynamic command.
clear mac address-table dynamic [ address mac_addr ] [ vlan vlan_id ] [ interface { type slot/port | port-channel number } ]
address mac_addr |
(Optional) Specifies the MAC address to remove from the table. Use the format XXXX.XXXX.XXXX. |
vlan vlan_id |
(Optional) Specifies the VLAN from which the MAC address should be removed from the table. The range of valid values is from 1 to 4094. |
interface type slot/port |
(Optional) Specifies the interface. Use either t he type of interface, the slot number, or the port number. |
port-channel number |
(Optional) Specifies the port channel number. The range is from 1 to 4096. |
None
Any command mode
Supported User Roles
network-admin
vdc-admin
Release |
Modification |
---|---|
4.0 |
This command was introduced. |
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 in configuration mode.
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 device removes all addresses on the specified interfaces.
This command does not require a license.
This example shows how to clear all the dynamic Layer 2 entries from the MAC address table:
switch(config)#clear mac address-table dynamic switch(config) #
This example shows how to clear all the dynamic Layer 2 entries from the MAC address table for VLAN 20 on port 2/20:
switch(config)# clear mac address-table dynamic vlan 20 interface ethernet 2/20 switch(config)#
Command |
Description |
---|---|
show mac address-table |
Displays information about the MAC address table. |
To clear the counters for the Spanning Tree Protocol (STP), use the clear spanning-tree counters command.
clear spanning-tree counters [ vlan vlan-id ] [ interface { ethernet interface-num | port-channel channel-num } ]
vlan vlan-id |
(Optional) Specifies the VLAN. The range is from 1 to 4094. |
interface |
(Optional) Specifies the interface type. |
ethernet |
Specifies the Ethernet. |
interface-num |
Module and port number. |
port-channel channel-num |
Port-channel number. |
None
Any command mode
Supported User Roles
network-admin
vdc-admin
Release |
Modification |
---|---|
4.0 |
This command was introduced. |
You can clear all the STP counters on the entire device, per VLAN, or per interface.
This command does not require a license.
This example shows how to clear the STP counters for VLAN 5:
switch# clear spanning-tree counters vlan 5
Command |
Description |
---|---|
show spanning-tree |
Displays information about the spanning tree state. |
show spanning-tree mst |
Displays information about the MST spanning tree state. |
To restart the protocol migration, use the clear spanning-tree detected-protocol command.
clear spanning-tree detected-protocol [ interface { ethernet interface-num | port-channel channel-num } ]
interface |
(Optional) Specifies the interface type. |
ethernet |
Specifies the Ethernet. |
interface-num |
Module and port number. |
port-channel channel-num |
Port-channel number. |
None
Any command mode
Supported User Roles
network-admin
vdc-admin
Release |
Modification |
---|---|
4.0 |
This command was introduced. |
Rapid per VLAN Spanning Tree Plus (Rapid PVST+) and Multiple Spanning Tree (MST) have built-in compatibility mechanisms that allow them to interact properly with other versions of IEEE spanning tree or other regions. For example, a bridge running Rapid PVST+ can send 802.1D bridge protocol data units (BPDUs) on one of its ports when it is connected to a legacy bridge. An MST bridge can detect that a port is at the boundary of a region when it receives a legacy BPDU or an MST BPDU that is associated with a different region.
These mechanisms are not always able to revert to the most efficient mode. For example, a Rapid PVST+ bridge that is designated for a legacy 802.1D bridge stays in 802.1D mode even after the legacy bridge has been removed from the link. Similarly, an MST port assumes that it is a boundary port when the bridges to which it is connected have joined the same region.
To force the MST port to renegotiate with the neighbors, enter the clear spanning-tree detected-protocol command.
If you enter the clear spanning-tree detected-protocol command with no arguments, the command is applied to every port of the device.
This command does not require a license.
This example shows how to restart the protocol migration on a specific interface:
switch# clear spanning-tree detected-protocol interface gigabitethernet5/8
Command |
Description |
---|---|
show spanning-tree |
Displays information about the spanning tree state. |
show spanning-tree mst |
Displays information about MST spanning tree state. |
To clear the counters for a specified VLAN or all VLANs, use the clear vlan counters command.
clear vlan [ id vlan-id ] counters
id |
(Optional) Specifies the VLAN ID that you want to clear . Valid values are from 1 to 4096. |
vlan-id |
Number of the VLAN that you want to clear . |
None
Any command mode
Supported User Roles
network-admin
vdc-admin
Release |
Modification |
---|---|
4.0 |
This command was introduced. |
If you do not specify a VLAN ID, the system clears the counters for all the VLANs, including private VLANs.
This command does not require a license.
This example shows how to clear the counters for VLAN 50:
switch# clear vlan 50 counters
Command |
Description |
---|---|
show vlan counters |
Displays information on statistics for all VLANs or the specified VLAN. |
show interface counters |
Displays information about the statistics for the specified VLANs. |
To clear the Virtual Trunking Protocol (VTP) counters, use the clear vtp counters command.
clear vtp counters
This command has no arguments or keywords.
None
Any command mode
Supported User Roles
network-admin
vdc-admin
Release |
Modification |
---|---|
5.1(1) |
This command was introduced. |
This command does not require a license.
This example shows how to clear the VTP counters:
switch# clear vtp counters switch#
Command |
Description |
---|---|
show interface counters |
Displays information about the statistics for the specified VLANs. |