07-03-2025 09:05 AM
Hello, I am a student learning IoT and Digital Transformation. I want to be able to automate simple switch configurations. I would like to be able to have a standard configuration on all switches that I can modify as needed. What type of program or code would you recommend for doing something like this? Thank you!
07-03-2025 09:20 AM - edited 07-03-2025 11:16 AM
Hi VC805,
There are several ways to automate switch configurations, and no single approach is wrong. The best path often depends on the hardware and software you're working with — and your own preferences. With a bit of Googling or asking ChatGPT, you'll get far.
Personally, I started by building standard text-based configurations. These keep most settings uniform, while allowing for unique values like the hostname and IP address. If you're using Python, you can easily automate this using Jinja2 templates.
Once you’ve built the configs, the next step is having Python push them to your devices.
If your switches support protocols like RESTCONF or NETCONF (as many modern Cisco devices do), those are great tools to explore for API-based configuration.
Also, take a look around at the community and/or the DevNet website. A lot of great content is already there for you!
Good luck with your learning — you're on the right track!
07-03-2025 09:33 AM
Python is widely used for network automation because it’s simple and powerful. Libraries like Netmiko and NAPALM allow you to programmatically connect to switches via SSH and push configurations. You can create standard config templates as strings or files and dynamically modify them in your Python scripts.
09-04-2025 11:03 AM
I highly recommend Python, specifically I use this package to audit existing network devices, and to update configuration on network devices
https://github.com/superadm1n/CiscoAutomationFramework
There are a ton of utilities for analyzing configuration, dynamically generating the config needed for your change, and issuing those commands all at the same time. It also allows you to do this concurrently with hundreds of devices at the same time.
In terms of generating configuration for new builds I use a yaml file and the Jinja package in Python to turn that yaml file into configuration.
What I find useful about this stack is you can do things like have the yaml file used as your source of truth and the CiscoAutomationFramework to audit your live environment and automatically update config if you desire based on changes in the yaml file. Very powerful.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide