Switchmap

Photo by Aksonsat Uanthoeng from Pexels
Reading Time: 2 minutes

I’m often asked what my favorite tools are for networking. Today I’m going to feature one of them. Switchmap has been in my toolbox for many years. It was created as an Open Source project by Peter Siemsen. The tool is a set of Perl scripts that are run periodically, usually by a cron job.

GetArp.pl

The first script is GetArp.pl. This script uses SNMP (v2 or v3) to retrieve the ARP table from the routers or layer 3 switches listed in the configuration file. This script is key to being able to match up the IP address with the MAC address and switchport information that will be retrieved by the next script. If you have a layer 3 access layer, be sure to list every layer 3 access switch as a router as well as a switch in the configuration so that their ARP tables are retrieved.

ScanSwitch.pl

ScanSwitch.pl is the second switch to be run. This script can take awhile to run depending on how many switches are involved. It retrieves a lot of data from several different MIBs via SNMP. The core of this data is the switch’s MAC Address table. It also will retrieve the switchport status and LLDP/CDP information.

SwitchMap.pl

The namesake script is the final script to run. It takes all of the data collected by the other two scripts and creates a set of static HTML files. These files are then accessed using your choice of a web server to serve them.

Screenshot of the SwitchMap tool web page.

In the above image, you can see how the data is presented. Active ports (at the time of the scan) are highlighted in green. Inactive ports that have been inactive for less than the number of days specified in the configuration are light gray. Disabled and long term inactive ports are dark gray. The software also has an opinion that every active port should have an interface description, those that don’t will have that field highlighted in red.

One of my favorite uses of this tool is to find ports that are plugged in on a switch but that haven’t been used in over 90 days. I use this data to then clean up my patch field. Beyond that, I have used this tool on a daily basis for a quick reference of what is where. I also like to use it for switch migrations. The clean format of the data makes it easy to plan what VLANs are needed for what ports. You can even use it to check off ports as you go through the migration.

Ben’s Take

Many paid tools, that I have access to, also have this type of functionality, but the clean interface for Switchmap has brought me back to it time after time. Sometimes having a tool that loads quickly and is easy to use trumps something that has more bells and whistles. Do you have any tools that may not be as shiny as others, but that you continue to use because they’re reliable for what you need?