Programming and Application Security
Network Automation
Automating configuration, backups and checks across many devices.
- 16 notes
- 133 minutes of reading
- Netmiko in depth: connecting to many vendors, sending commands and configHow Netmiko handles SSH sessions to Cisco, Juniper, Arista and other devices, how to send show and configuration commands, parse output, and handle credentials and errors safely. 9 min · Intermediate
- NAPALM: vendor-neutral getters, config merge, replace and compareHow NAPALM gives a common Python interface to different network operating systems, using getters for structured data and a load, compare, commit workflow for safe configuration changes. 9 min · Intermediate
- Nornir: running Python tasks across many network devices in parallelHow the Nornir framework uses an inventory, filters, tasks and a threaded runner to run Netmiko or NAPALM jobs against many devices at once, with results you can process in Python. 9 min · Intermediate
- Jinja2 templates for network configurationHow to separate data from configuration using Jinja2 templates: variables, loops, conditionals, filters and whitespace control, rendered from Python for consistent device configs. 8 min · Intermediate
- NETCONF and YANG with Python: model-driven network configurationWhat YANG data models and the NETCONF protocol are, how datastores and operations work, and how to read and change configuration from Python with ncclient. 9 min · Advanced
- RESTCONF: managing network devices over HTTPS with YANGHow RESTCONF exposes YANG-modelled device data as HTTPS resources, how to build URLs, which HTTP methods to use, and how to call it from curl and Python securely. 8 min · Intermediate
- Source of truth: IPAM and DCIM tools such as NetBox and why they matterWhy network automation needs a single source of truth, what IPAM and DCIM tools record, how NetBox fits in, and how to query it from Python with pynetbox. 8 min · Intermediate
- Network configuration compliance and drift detection with PythonHow to define golden configuration rules, collect running configurations, detect drift with rule checks and diffs in Python, and report and fix findings safely. 8 min · Intermediate
- Network automation: why automate, the toolchain and model-driven APIsWhy manual configuration doesn’t scale, the benefits of automation, the automation stack, how tools talk to devices (SSH, NETCONF, RESTCONF, gNMI, REST), YANG, YAML and JSON, sources of truth and idempotency. 8 min · Intermediate
- Ansible and NetDevOps: playbooks, inventories and CI/CD for networksWhy Ansible suits network teams, inventories and variables, an idempotent VLAN playbook using Cisco IOS modules, check mode, protecting secrets, and how Git, reviews and CI/CD pipelines make network changes safer. 9 min · Advanced
- Python for network engineers: libraries and a first automation scriptWhy Python is the language of network automation, the key libraries (Netmiko, NAPALM, ncclient, requests, Nornir, TextFSM), a complete configuration backup script with a YAML inventory, safe changes and a learning path. 9 min · Intermediate
- Python ipaddress module: subnetting, validation and IP planning in codeHow to use Python's built-in ipaddress module to validate IP addresses, calculate network, broadcast and host ranges, check subnet membership, split blocks into subnets and summarise routes, for IPv4 and IPv6. 8 min · Beginner
- YAML for network automation: inventories, variables and common mistakesHow YAML is used in network automation for inventories and variables: lists, dictionaries and nesting, reading YAML in Python with PyYAML, and the common mistakes such as tabs, indentation and unquoted values that break scripts. 7 min · Beginner
- Regular expressions for network engineers: parsing show output with PythonA practical introduction to regular expressions in Python for network engineers: the most useful patterns, capture groups, re.search and re.findall, parsing interface and IP data from show commands, and when to use a proper parser instead. 8 min · Intermediate
- Automated network configuration backups with Python and GitHow to back up network device configurations automatically with Python and Netmiko, store them in Git to get a full change history, see exactly what changed between days, handle failures and protect the secrets inside configs. 8 min · Intermediate
- Automating Cisco Meraki with the Dashboard API and PythonHow to automate cloud-managed Cisco Meraki networks with the Dashboard API and the official Python library: API keys, organisations, networks and devices, reading inventory, making safe changes, rate limits and good practice. 8 min · Intermediate