Clearing the counters for a port on a Cisco switch

You can view the counters for a port on a Cisco switch using the show interfaces command. E.g., if I want to check on whether cyclic redundancy check (CRC) errors have been occurring on port fa0/16, I can issue the command shown below:

Cisco Networking Fundamentals
Cisco Networking Fundamentals
1x1 px

Layer 2 Switching and VLANs for Cisco
Layer 2 Switching and
VLANs for Cisco
1x1 px

Huron>show interfaces fa0/16
FastEthernet0/16 is up, line protocol is up (connected)
  Hardware is Fast Ethernet, address is 0009.e897.d290 (bia 0009.e897.d290)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 19/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 10Mb/s, media type is 100BaseTX
  input flow-control is unsupported output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output 00:00:00, output hang never
  Last clearing of "show interface" counters 2d17h
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 24000 bits/sec, 40 packets/sec
  5 minute output rate 756000 bits/sec, 64 packets/sec
     46168 packets input, 4608074 bytes, 0 no buffer
     Received 1250 broadcasts (1161 multicast)
     0 runts, 0 giants, 0 throttles
     121 input errors, 16 CRC, 105 frame, 0 overrun, 0 ignored
     0 watchdog, 1161 multicast, 0 pause input
     0 input packets with dribble condition detected
     255151 packets output, 119141892 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out
Huron>

I can see that 16 CRC errors have occurred since the counters for this port were last reset 2 days and 17 hours ago. I can tell the counters for the port were reset that long ago from the line below that appears in the output of the "show interface" command.

Last clearing of "show interface" counters 2d17h

I can reset the counters by entering privileged EXEC mode by isssuing the enable command. I can then clear the counters for just the one particular port by the command clear counters port_designator. When you enter the command you will be prompted to confirm that you wish the counters on the interface to be reset. You can enter y to confirm that you wish that action taken. E.g.:

Udemy - April2516-25off-sitewide120x600
Huron>enable
Password:
Huron#clear counters fa0/16
Clear "show interface" counters on this interface [confirm]y
Huron#show interface fa0/16
FastEthernet0/16 is up, line protocol is up (connected)
  Hardware is Fast Ethernet, address is 0009.e897.d290 (bia 0009.e897.d290)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 10Mb/s, media type is 100BaseTX
  input flow-control is unsupported output flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output 00:00:01, output hang never
  Last clearing of "show interface" counters 00:01:27
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 multicast)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     80 packets output, 7161 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out
Huron#

In addition to resetting the error counters, the clear counters command also resets the input and output counters.

Huron>show interfaces fa0/16 counters

Port            InOctets   InUcastPkts   InMcastPkts   InBcastPkts
Fa0/16            386867          1624           294            21

Port           OutOctets  OutUcastPkts  OutMcastPkts  OutBcastPkts
Fa0/16           2527937          2352           671            39
Huron>enable
Password:
Huron#clear counters fa0/16
Clear "show interface" counters on this interface [confirm]y
Huron#show interfaces fa0/16 counters

Port            InOctets   InUcastPkts   InMcastPkts   InBcastPkts
Fa0/16                 0             0             0             0

Port           OutOctets  OutUcastPkts  OutMcastPkts  OutBcastPkts
Fa0/16               192             0             3             0
Huron#