03-07-2025 02:57 AM - edited 03-07-2025 02:58 AM
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.
Solved! Go to Solution.
03-07-2025 05:58 PM - edited 03-07-2025 05:59 PM
Hey @BruteForce
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
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
HTH
AshSe
03-07-2025 05:58 PM - edited 03-07-2025 05:59 PM
Hey @BruteForce
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
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
HTH
AshSe
03-07-2025 06:23 PM
If the switch is a Catalyst 9k, try "sh interface link".
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide