Replace CLI toil with code — push config with Netmiko, parse output into structured data, template configs with Jinja2, go multi-vendor with NAPALM, and use the model-driven APIs (NETCONF, RESTCONF, YANG). Then assemble it into inventory-driven, idempotent, version-controlled automation.
Before you start
You need Python 3.10+ and a few libraries the lessons install as they go — netmiko napalm jinja2 ncclient. Point the scripts at a lab (GNS3 / EVE-NG) or real gear. Comfort with Python helps — see the Python course.
Why Automate & Netmiko
Configuring 200 switches by hand is slow and error-prone. Netmiko connects to a device over SSH from Python and runs commands — your first step out of the CLI.
Pushing Configuration
Reading is safe; changing is where automation earns its keep. Send configuration sets with Netmiko, save them, and confirm what actually changed.
Parsing Device Output
CLI output is text meant for humans. Turn "show" commands into structured data your code can filter and act on — the key to real automation.
Config Templating with Jinja2
Every switch config is 90% identical. A Jinja2 template plus per-device variables generates consistent configs at scale — the heart of configuration management.
Multi-Vendor with NAPALM
Netmiko speaks each vendor’s CLI; NAPALM gives one Python API across Cisco, Juniper, Arista, and more — with structured facts and safe config replace and rollback.
NETCONF, RESTCONF & YANG
CLI scraping is fragile. Model-driven APIs — NETCONF and RESTCONF, described by YANG models — treat device config as structured data you read and write like an API.
Building an Automation Workflow
Scripts become a system when they’re inventory-driven, idempotent, safe, and version-controlled. Assemble the pieces into automation you can trust in production.