Network automation transforms manual network configuration and management into programmable, repeatable, scalable processes using tools like Python libraries (Netmiko, NAPALM, Nornir), API protocols (NETCONF, RESTCONF), and orchestration frameworks (Ansible). It replaces error-prone CLI scripting with idempotent, version-controlled infrastructure-as-code, enabling DevOps-style workflows for network operations. The key advantage is moving from device-by-device manual changes to centralized, tested, auditable deployments across hundreds or thousands of devices simultaneously, with automatic validation and rollback capabilities when issues arise.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 148 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Python SSH Automation Libraries
These are the workhorse libraries you reach for when talking to network gear over SSH from Python. They sit at different layers — Paramiko is the raw protocol foundation, Netmiko and Scrapli add per-vendor prompt handling on top, NAPALM unifies multiple vendors behind one API, Nornir orchestrates tasks across an inventory, and ncclient speaks NETCONF instead of the CLI. Knowing which one fits your problem saves you from reinventing connection logic.
| Library | Example | Description |
|---|---|---|
net_connect = ConnectHandler( device_type='cisco_ios', host='10.1.1.1', username='admin', password='pass') | • Multi-vendor SSH client library built on Paramiko • supports 80+ device types with automatic enable mode handling and config mode detection | |
driver = napalm.get_network_driver('ios')device = driver('10.1.1.1', 'admin', 'pass')device.open()device.load_merge_candidate(config='...')device.commit_config() | • Network Automation and Programmability Abstraction Layer with Multi-vendor support • provides unified API across vendors with getters for state retrieval and merge/replace config methods | |
nr = InitNornir(config_file='config.yaml')result = nr.run(task=netmiko_send_command, command_string='show version') | • Python automation framework designed for parallel task execution across network devices • uses inventory system with filtering and plugin-based architecture |