Recently, I faced a challenge when replacing half of the network switches at my school. I inherited a network where the port configuration wasn’t well documented.
One way I have historically dealt with this is by plugging a networking test tool into a port and using LLDP to discover which switch port the network jack is plugged into. LLDP works by broadcasting network configuration information to each network port every 30 seconds. This typically contains the switch’s IP address, name, port number, and VLAN and Voice VLAN configuration for the port.

Screenshot of FlukeNetworks LinkIQ network test tool showing LLDP information for a network port. This is a handy tool to check the wiring and configuration information for a port, but is a tool I usually have to go back to my office to grab.
This image shows that the port the Fluke is plugged into goes to port 29 on switch S6A-C9300-21 and is in VLAN 102.
This can be super handy if I need to reconfigure a network port for a printer and put it on a different VLAN/subnet. I can unplug the printer, plug in the test tool, see the port information, and then log in to the switch and reconfigure it.
That process works well for doing a few ports, but when I had to do it in bulk the process was tedious. Instead, I wrote a Python script that:
- Uses LLDP on my laptops network port to identify the port I’m plugged in to.
- Let’s me enter data on how I want to label/identify the port.
- Allows me to pick which VLAN / Voice VLAN the port should be in.
- Uses the Meraki API to reconfigure the VLAN / Voice VLAN and label the port.
- Record the information to a Google Sheet that acts as an inventory.

Screenshot of my Python program detecting port information via LLDP and then me configuring the port name, VLAN, and Voice VLAN.
For the upgrade, I used this on the network patch panel, but now I mainly use it to configure individual wall jacks.
The script uses the Python meraki, scapy, and gspread libraries to do the heavy lifting. If there is interest, I’ll clean up the script and post it somewhere.