How to list the free ports on a switch, and across the fleet
To list the free ports on a switch, read the status of every physical port and keep the ones that are not up. Doing it on one switch takes one command; doing it for a hundred switches is where the time goes. NacTrack reads the port status at every collection, so the same answer comes for one device or for the whole fleet, with a per-device count of ports in use and free in the Capacity report. A port that is down today is a candidate, not a certainty.
What you need
- Licence module: inventory.
- Role permission: view the inventory.
- Every collected platform. The Capacity report also needs the reporting module and the view_reporting permission.
In NacTrack
- 1
Open Inventory, then Ports
The Ports page lists every collected port. Pick one switch in the device filter, or leave it on All devices to search the whole fleet at once. Only physical ports is ticked by default, which keeps VLAN interfaces and loopbacks out of the count.
Screen: app.nactrack.com/inventory/interfaces
- 2
Filter the Status column
Type in the search box of the Status column. The match is on part of the text, so "down" also returns ports that are administratively down: type the exact value the vendor uses when you want only one of them. Export the result to Excel or CSV; the full export fetches every matching row, up to ten thousand.
Screen: app.nactrack.com/inventory/interfaces
- 3
Open the Capacity report for the fleet
Under Reporting, the Capacity report counts physical ports per device: total, in use, free, administratively down, and utilisation. In use means the port is up. Everything else, administratively down and err-disabled included, counts as free capacity.
Screen: app.nactrack.com/reporting
By hand, without NacTrack
On a Cisco IOS or IOS XE switch, "show interfaces status" prints one line per port with a Status column: connected, notconnect, disabled or err-disabled. Cisco's errdisable note uses this same command to find err-disabled ports. To judge how long a port has been idle, "show interfaces" gives a Last input value per port.
On Huawei VRP, "display interface brief" gives the physical and protocol state of each port. Either way, the command answers for one switch at a time: the fleet answer is the same command run on every switch and merged by hand.
Further reading
Network device inventory: models, serials, free ports
Models, software versions, serial numbers, used and free ports, across a heterogeneous estate. Collected over SSH, with no agent and no manual entry.
How-to guideHow to record the serial number and version of every network device
Serial number and software version of every network device in one exportable table, plus stack members and modules, and the Cisco commands by hand.
How-to guideHow to tell whether a VLAN still has any ports on a switch
Before removing a VLAN, the answerable question is not whether it is used but whether this switch still has ports assigned to it.
How to tell whether an IP belongs to a user device or to network equipment
IP Finder heads each block of results with the source that matched, and that heading tells you whether the address is an endpoint or a device.
Next guideHow to record the serial number and version of every network device
Serial number and software version of every network device in one exportable table, plus stack members and modules, and the Cisco commands by hand.
