A colleague and I were tasked with deploying more than 600 new Meraki MS120 switches across a large campus network. The goal was to streamline the management of access switches and introduce a new networking structure—replacing several /16 networks spread across the campus with smaller, more resilient /24 networks for each department.
When we started considering the best approach, we explored several options. The first idea was to do it manually. This would require us to configure each Meraki switch with the appropriate VLANs for the department, locate the correct uplink port on the distribution switch, and adjust the configuration there as well to integrate the switch into the new /24 networks.
We tried this method and measured how long it would take to deploy a switch.
First, we needed two workers: one on-site to replace the switch, and another in the office to make the necessary configuration changes.
It took us around 10 minutes to deploy one switch. Since both of us had other tasks to attend to, each deployment effectively cost the company 20 minutes.
Scaling this to 600 switches meant:
That’s when we decided to explore automation. One of the great features Meraki offers is their API. All the configuration changes we needed to make on the Meraki side could be handled through the API. Within an hour, we had a Python program that fully configured a Meraki switch based on a few key inputs, such as its deployment location.
The program would set the hostname, configure uplink ports, configure access ports with the correct VLANs and access policies, and more.
However, this mock-up was far from production-ready—it was a simple command-line application running on a Linux server.
To increase usability and make the program accessible to more people, we decided to build a web interface.
While researching possible frameworks, I came across Flask and was amazed at how easy it was to get started. I had a website running in less than two hours.
The site featured a simple form asking for the switch location and a big Configure button. The backend logic determined the correct name, VLANs, and access policies, then pushed these settings to the Meraki cloud via the API.
Configuring new switches became easy—and even fun—but one manual step remained.
The configuration of the upstream distribution switch ports was still manual, and this was actually the most time-consuming step, mainly because it involved finding the correct port in the first place.
The process was: obtain the IP address of the existing old switch, look it up in the ARP table on our core router, obtain the MAC address, then locate the correct port across multiple large distribution switches, each consisting of multiple stacks.
This involved a lot of copying, pasting, and adjusting MAC address formats (why is there no industry standard for writing MAC addresses?!).
It was clear this had to be fully automated. It was also the hardest part of the process—but luckily, I found an awesome Python library: NAPALM.
While it may sound like a weapon or a Call of Duty killstreak, NAPALM actually stands for Network Automation and Programmability Abstraction Layer with Multivendor support.
Exactly what we needed: an abstraction layer for Python that offered simple methods to:
We made some adjustments and soon had a working module that fully configured the distribution port based on the Flask form input. After a day or so, it was running perfectly.
We then integrated the modules, creating a complete semi-automated workflow.
Using the site in production proved more challenging than expected—people sometimes made mistakes filling out the form.
We introduced input validation and added a second step in the deployment process, showing the user all gathered data and summarizing the changes before applying them.
Since then, we’ve had a fully working website our colleagues can use right from their phones at the switch replacement location.
Entering the data and validating it takes about a minute. Once the Deployment button is pressed, the site makes all configuration changes, and the switches can be replaced in about 4 minutes, depending on the installation.
In total, installing a new switch now takes around 5 minutes, requiring only minimal input. This has resulted in huge time savings and allows colleagues with no switch configuration experience to assist with deployments, thanks to the simplicity of the website.
This was my first “big” automation project—and it definitely won’t be my last. While fixing bugs and incorporating user feedback wasn’t always fun, it was incredibly satisfying to see all the different components come together to create a deployment workflow tailored to our needs.