Thursday 5 July 2018

find free switchports cisco switch

The best way is to maintain a list of patches / descriptions on ports. After that having a monitoring system to monitor ports would show you graphs of the port activity. If you don't have this you can try the following. Its not perfect, its still an educated guess.

Step 1: Find switch ports that are down
sh ip int br | i down

This lets us see the ports that are either admin down, or line down (no cable plugged in or PC off). However just because a PC is off at the time we check does not mean the port is free to be used. A user could be away on holiday or a PC/Printer is only booted once a week/month for a specific task.

Now we need to look at some other things

sh int | inc line protocol is|Last input

Look for ports that are down and last output is old. Last input is almost always "never".


Copy output to file

Run regular expression on it
^GigabitEthernet.*down,.*[\r\n].*[^/r/n]output\s\d.*

Find all
Copy and paste into new file


Good command:
show int | i proto.*notconnect|proto.*administratively down|Last in.* [6-9]w|Last in.*[0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never

No comments:

Post a Comment