Intermediate · Free · In your browser

Learn Network Automation

Use Python to run a multi-vendor network the way network automation teams do, on a practice network of Cisco IOS and Huawei VRP switches inside your browser. Log in with Netmiko and read show commands; turn their output into data with parsing and regular expressions; push configuration safely with error checks, Jinja2 templates and idempotent changes; back up every device, detect drift and check compliance; ask a NetBox-style inventory API; and finish by deploying a change from the source of truth, with checks before and after.

20 lessons6 modules5.2 hours of practice4 challenges
Start the Network Automation course →

No installation. Your code runs right in the browser. Python basics such as loops, functions and dictionaries, and networking basics such as IP addresses, VLANs and switch ports; the Python Foundations and Networking Foundations courses teach them. Everything runs against a practice network in your browser, so nothing you send reaches a real device.

What you will be able to do

Course outline

Module 1

First steps with automation

Log in to switches from Python, loop over many devices, and read the inventory from CSV and YAML files.

  1. Run a command on a switchNetmiko, ConnectHandler, send_command & credentials from the environment · 12 min
  2. Many devices, one loopDevice lists, for loops, find_prompt & collecting results · 12 min
  3. Read the inventory from a filecsv.DictReader, filtering rows & clean Netmiko dictionaries · 12 min
  4. Group settings in a YAML inventoryYAML, yaml.safe_load & merging defaults, groups and hosts · 14 min
Module 2

Read the network

Turn show output into data, pull facts out of free text, survive failures, and audit two vendors.

  1. Turn show output into datasplitlines, split() & parsing tables into dictionaries · 14 min
  2. Pull facts out of show versionre.search, named groups & device facts · 14 min
  3. Handle failures and write a reportNetmiko exceptions, try/except per device & csv.DictWriter · 15 min
  4. Audit VLANs on two vendorsPer-vendor commands and parsers, dispatch tables & set operations · 15 min
Module 3

Change the network

Push configuration safely, generate it from templates, make changes idempotent, and standardize a fleet.

  1. Push a configuration changesend_config_set, error_pattern, verification & save_config · 14 min
  2. Generate configuration with templatesJinja2 templates, loops, trim_blocks & data in YAML · 15 min
  3. Make changes idempotentDesired state, read before write & idempotency · 15 min
  4. Project: standardize NTP and loggingProject: compare with a standard and fix only the drift, on two vendors · 25 min
Module 4

Backups, drift and compliance

Back up every configuration, detect changes made by hand, and check devices against a standard.

  1. Back up every configurationpathlib, writing files & running-config backups · 12 min
  2. Detect configuration driftdifflib.unified_diff, noise filtering & changed lines · 15 min
  3. Check compliance rulesRules as data, required and forbidden lines, whole-line matching · 15 min
Module 5

APIs and the source of truth

Ask a NetBox-style inventory API, follow its pages, and keep secrets out of code and backups.

  1. Ask the inventory APIREST APIs, requests.get, tokens, query parameters & JSON · 14 min
  2. Follow every pagePagination, next links, status filters & building device lists · 15 min
  3. Keep secrets out of code and backupsEnvironment checks, sys.exit, re.sub & redacting configurations · 15 min
Module 6

Safe changes and the capstone

Check before and after every change, roll back automatically, and deploy from the source of truth.

  1. Check before and after, roll back on failurePre-checks, post-checks, verification & automatic rollback · 18 min
  2. Capstone: from source of truth to the networkCapstone: source of truth, idempotent deploy, verification & updating the API · 30 min

Ready for your first line?

Every lesson is short, hands-on, and checked automatically.

Start learning Network Automation →