clear counters interface

Clears counters of the specified interface.

Syntax

clear counters interface ethernet [ IFNAME | all ]
clear counters interface management 0
clear counters interface port-channel [ PORANGE | all]

Parameters

ethernet
Specifies the counters of ethernet interface.
IFNAME
Specifies the ethernet interface name in slot/port format. Example: 1/1 Range: 1/1-3, 5, 7-9.
all
Clears all ethernet interface statistics.
Management 0
Specifies the management interface.
port-channel
PORANGE
Specifies the channel number or range of channel numbers. Valid range is 1 through 255.
all
Specifies all port-channel interfaces.

Modes

Exec mode

Usage Guidelines

This command is available only to users with admin role.

Table 1. Error messages
Message Reason
Error: Command supported on active interfaces only The specified interface must be active.

Examples

The following example clears counters of the ethernet interface on slot/port 1/1.

device# clear counters interface ethernet 1/1

The following example clears counters on management interface 0.

device# clear counters interface management 0

The following example clears port-channel 1 counters.

device# clear counters interface port-channel 1

device# clear counters interface port-channel 1-3,5,7-9

The following example clears counters for all ethernet interfaces.

device# clear counters interface ethernet all

The following examples show error messages that occur when the entry is out-of-range, or the wrong format.

device(config)# clear counters interface port-channel 256 
Error: port-channel wrong format or range. Valid range is 1-255: 
Example: 1     Range Example: 1-3,5,7-9 

device(config)# clear counters interface port-channel adada 
Error: port-channel wrong format or range. Valid range is 1-255: 
Example: 1     Range Example: 1-3,5,7-9 

When PORANGE is more than 255 char: 
Error: Port-channel range too long, max 255 char supported