Modern networks are managed through APIs, not CLI sessions. The protocols, NETCONF and gNMI, are well-documented. The gap is everything in between: understanding YANG data models well enough to construct valid configuration payloads, navigating multi-vendor inconsistencies, and knowing why the same OpenConfig path behaves differently on Nokia SR Linux and Arista cEOS.
This tutorial closes that gap. It is a hands-on, lab-based guide to configuring real network devices using YANG models — not scripts, not automation frameworks, just you, the models, and the devices.
- How YANG modules are structured and how to read them with
pyang - How NETCONF and gNMI work at the protocol level, and how they differ
- How to discover what models a device supports and fetch them directly from the device
- How to construct XML and JSON configuration payloads from scratch
- Why multi-vendor environments are harder than the standards suggest, and how to handle it
- Configuring interfaces, IP addressing, network instances, and OSPF across a mixed Nokia/Arista topology
Most network automation tutorials skip straight to Python libraries and abstraction frameworks. This one deliberately does not. Understanding the model layer, before any automation tool is involved, is what separates engineers who can debug broken automation from those who cannot.
The lab uses real vendor images (Nokia SR Linux and Arista cEOS) running in Containerlab on your laptop. Every task exposes a real challenge: revision mismatches between vendors, modules that advertise support but cannot be used for configuration, augmentation-only modules that break naive tooling assumptions. These are not edge cases — they are everyday realities in multi-vendor deployments.
This tutorial does not replace vendor documentation or the broader network automation community's work. It synthesizes them into a single, sequenced learning path. The Further Reading section points to the primary sources this tutorial draws from and resources worth exploring once you have completed the lab.
- Networking fundamentals: IP addressing, routing protocols
- Linux command line basics
- Basic knowledge of YANG
- No NETCONF/gNMI experience required
git clone https://github.com/martimy/model-driven-configuration-tutorial.git
cd model-driven-configuration-tutorialYou will need Docker and Containerlab installed, as well as the Arista cEOS and Nokia SR Linux container images. See the Setup guide for details.
├── docs/ # Tutorial content (source for GitHub Pages)
├── topology/ # Containerlab topology file and device configs
└── scripts/ # Python scripts for NETCONF and gNMI interaction
This tutorial builds on the work of many contributors to the network automation community. The following are some recommended sources:
- OpenConfig working group
- YANG models repository
- Network to Code blog: practical network automation writing
- Packet Coders: network automation training and tutorials
MIT License, see LICENSE for details.