Free tech learning for everyone, from basics to pro

Network AutomationNetworking SecurityIntermediate

Network automation: why automate, the toolchain and model-driven APIs

In short: Automation replaces slow, error-prone manual changes with repeatable code. Tools read the intended state from a source of truth and apply it to devices over SSH or model-driven APIs such as NETCONF and RESTCONF, using structured data in YAML and JSON. Start with read-only tasks and build up.

Why automate the network

Configuring devices one at a time by hand is slow, and humans make typing mistakes: many outages start with a manual change. Automation lets you make the same change on 500 devices in minutes, exactly the same way every time. It also frees engineers from repetitive tasks such as backups, audits and VLAN changes, so they can work on design and problems.

  • Speed: changes and new sites in minutes, not days.
  • Consistency: every device follows the same standard.
  • Fewer errors: tested templates instead of copy-and-paste.
  • Compliance: automatic checks that configs match policy.
  • Documentation: the code itself records what was done.

The automation stack

The network automation stackSource of truthinventory, IPs, intended configAutomation toolsPython, Ansible, CI/CD pipelineInterfacesSSH/CLI, NETCONF, RESTCONF, gNMI, RESTNetwork devicesrouters, switches, firewalls, cloud
Figure 1. Automation reads the intended state from a source of truth and pushes it to devices through their interfaces.

How tools talk to devices

InterfaceHow it worksNotes
SSH and CLIScripts log in and type commands, then read text outputWorks everywhere; output must be parsed
NETCONFXML messages over SSH (port 830)Structured data, transactions and rollback
RESTCONFHTTPS with JSON or XMLWeb-style API using the same data models
gNMIgRPC-basedEfficient configuration and streaming telemetry
Vendor and controller REST APIsHTTPS with JSONUsed by SD-WAN, cloud and Wi-Fi controllers

Model-driven interfaces use YANG data models, which describe a device's configuration and state as structured data instead of free text.

Data formats you'll meet

# YAML: easy for people to read and write
hostname: BR1-SW1
vlans:
  - id: 10
    name: STAFF
  - id: 20
    name: GUEST

# JSON: the same data, common in APIs
# {"hostname": "BR1-SW1", "vlans": [{"id": 10, "name": "STAFF"}, {"id": 20, "name": "GUEST"}]}

Key ideas: source of truth and idempotency

  • Source of truth: one trusted place (a database, IPAM tool or Git repository) that holds what the network should look like. Automation reads it; people change the source, not the devices.
  • Idempotency: running the same automation twice gives the same result and changes nothing the second time. Safe to re-run.
  • Start small: read-only tasks first (backups, inventory, audits), then simple changes, then full deployments.

Real-world example: a VLAN change across 120 switches

A fictional hospital needed to add a new VLAN for wireless infusion pumps to 120 access switches across four buildings. Done by hand, two engineers estimated three nights of work, with a real risk of typing mistakes on a clinical network. Instead they listed the switches and their uplink ports in their source of truth and wrote a short automation job using RESTCONF where the switches supported it and SSH for the older models. The job ran first in check mode to show exactly what would change, then on ten switches in one ward, then on the rest. It finished in under an hour, and a final read-only check confirmed that every switch carried the new VLAN on the correct trunks.

Practice

What does idempotent mean in automation?
Running the same task again gives the same result and makes no further changes.
Which port does NETCONF use over SSH?
TCP 830.
Suggest a safe first automation project.
Automatic configuration backups or an inventory report, because they only read from devices.

Key takeaways

  • Manual changes are slow and cause many outages; automation is fast and consistent.
  • Tools read intent from a source of truth and push it to devices.
  • Interfaces: SSH/CLI, NETCONF, RESTCONF, gNMI and REST APIs.
  • YANG models describe configuration; YAML and JSON carry the data.
  • Start with read-only tasks, then move to changes.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.