cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
227
Views
0
Helpful
2
Replies

What is a great 'show' command to show a clean output of unused ports?

BruteForce
Level 1
Level 1

Hello everyone,

The network I work on has some very old switches, some of which have been online for about a year, so there's a lot of data to pull from. Physically these switches look awful, and I would like to unplug some cables that haven't been used in 6+ months. Assuming I have a 6+ month uptime on my switches, do you have a suggested way to show these ports?

In the perfect world, I'd get an output like this that I can trust are completely unused ports.

GigabitEthernet1/0/1
GigabitEthernet1/0/2
GigabitEthernet1/0/11
GigabitEthernet1/0/14
GigabitEthernet1/0/17

These are my current solutions, but I would like something better.

Switch# show interfaces | in line protocol is down|Last input never,| 0 packets input| 0 packets output| 0 multicast 

GigabitEthernet1/0/1 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/2 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/3 is down, line protocol is down (notconnect)
GigabitEthernet1/0/7 is down, line protocol is down (notconnect)
GigabitEthernet1/0/11 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/12 is down, line protocol is down (notconnect)
GigabitEthernet1/0/13 is down, line protocol is down (notconnect)
GigabitEthernet1/0/14 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/17 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/18 is down, line protocol is down (notconnect)
GigabitEthernet1/0/21 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns
GigabitEthernet1/0/23 is down, line protocol is down (notconnect)
GigabitEthernet1/0/24 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
0 packets input, 0 bytes, 0 no buffer
0 watchdog, 0 multicast, 0 pause input
0 packets output, 0 bytes, 0 underruns

-----

As you can see with the output above, I can see which ports have not been touched since the device was last rebooted, but the output is not that great to read. Additionally, some of the ports that appear in the output, like GigabitEthernet1/0/3 and GigabitEthernet1/0/7, even though they've been used but are just currently down. 

Another solution is below.

Switch# sh interfaces counters | i 0 +0 +0 +0 

Gi1/0/1 0 0 0 0
Gi1/0/2 0 0 0 0
Gi1/0/11 0 0 0 0
Gi1/0/14 0 0 0 0
Gi1/0/17 0 0 0 0
Gi1/0/21 0 0 0 0
Gi1/0/24 0 0 0 0
Gi1/0/25 0 0 0 0
Gi1/0/30 0 0 0 0
Gi1/0/32 0 0 0 0
Gi1/0/35 0 0 0 0
Gi1/0/36 0 0 0 0
Gi1/0/37 0 0 0 0
Gi1/0/38 0 0 0 0
Gi1/0/41 0 0 0 0
Gi1/0/44 0 0 0 0
Gi1/0/48 0 0 0 0
Gi1/1/1 0 0 0 0
Gi1/0/1 0 0 0 0
Gi1/0/2 0 0 0 0
Gi1/0/11 0 0 0 0
Gi1/0/14 0 0 0 0
Gi1/0/17 0 0 0 0
Gi1/0/21 0 0 0 0
Gi1/0/24 0 0 0 0
Gi1/0/25 0 0 0 0
Gi1/0/30 0 0 0 0
Gi1/0/32 0 0 0 0
Gi1/0/35 0 0 0 0
Gi1/0/36 0 0 0 0
Gi1/0/37 0 0 0 0
Gi1/0/38 0 0 0 0
Gi1/0/41 0 0 0 0
Gi1/0/44 0 0 0 0
Gi1/0/48 0 0 0 0
Gi1/1/1 0 0 0 0

This solution is a lot cleaner, but I'm not 100% sure if it only displays ports that have never been used, and I don't know why the output is displayed twice. 

If anyone would like to suggest another command I'll happily try it out. I'm just going to save it as a button in SecureCRT, so it doesn't matter if it's a very long command. 

1 Accepted Solution

Accepted Solutions

AshSe
VIP
VIP

Hey @BruteForce 

 

  • Command to filter out unused ports:

 

Switch# show interfaces | include (line protocol is down|Last input never|0 packets input|0 packets output)

Switch# show interfaces counters | include 0 +0 +0 +0

 

  • Command to filter ports that are down and have no traffic history:

 

Switch# show interfaces | include (line protocol is down|Last input never|0 packets input|0 packets output)

 

  • Command to confirm that the ports have zero traffic:

 

Switch# show interfaces counters | include 0 +0 +0 +0

 

HTH

AshSe

View solution in original post

2 Replies 2

AshSe
VIP
VIP

Hey @BruteForce 

 

  • Command to filter out unused ports:

 

Switch# show interfaces | include (line protocol is down|Last input never|0 packets input|0 packets output)

Switch# show interfaces counters | include 0 +0 +0 +0

 

  • Command to filter ports that are down and have no traffic history:

 

Switch# show interfaces | include (line protocol is down|Last input never|0 packets input|0 packets output)

 

  • Command to confirm that the ports have zero traffic:

 

Switch# show interfaces counters | include 0 +0 +0 +0

 

HTH

AshSe

Leo Laohoo
Hall of Fame
Hall of Fame

If the switch is a Catalyst 9k, try "sh interface link".