On a large Cisco Catalyst switch stack, almost all switchports are patched. I need to identify the ports, which are not in use, for connecting further devices.
Following switchports, cabling, patch fields and sockets to possible end devices is laborious and even then there could be temporarily used sockets. Looking at the activity of port LEDs is not reliable, since a user device can be shut off.
What's the easiest way to detect all unused switchports via IOS commands?
Best Answer
I frequently use
or the same with GigabitEthernet, whatever kind of interfaces I want to check.
sh int
(which isshow interfaces
) gives a huge list of ste status of all interfaces|
can be used for filtering, but also in search expressions| i
(forinclude
) filters the output which matches the following search expressions(...|...)
to match two conditions: the interface name and a status I like to see, we can use regular expressions here, like this "or" expressionThe output can look like:
Now I can see my candidates, with actually 0 packets input over time, even if my expression matches numbers just ending with 0. I could make it more perfect, but being easy to remember is also a benefit. The interface names right before each 0 packets input lines are my candidates.
sh int <name>
clear counters [type number]
It can be good practice, to leave unused switchports shutdown. So it's easy to identify them using
sh ip int bri
or the like. And you don't run into problems if you use a switchport which was definitly shut off before.