You just got promoted to network automation lead.
Your company has Cisco routers in one site, Juniper in another, and Arista in a third.Your first task: add a description on the WAN interface of every router.
You open your terminal, and there is the problem: each vendor speaks a different dialect.
Figure 1 – Three vendors, three CLI dialects
Same task, three incompatible syntaxes.
To automate this with the CLI, your script has to learn every vendor's dialect, and any future IOS update can break your parsing.You need a common vocabulary that every vendor agrees on.
Answer the question below
One Model, All Vendors
This is where YANG comes in.
Instead of typing vendor-specific commands, you describe the change once using a shared data schema that Cisco, Juniper, and Arista all agree on.
Figure 2 – One YANG model, three vendors
You build your payload using
ietf-interfaces, a standard YANG model published by the IETF.
Every modern device implements it.
Only the interface name changes: GigabitEthernet0/1 on Cisco, ge-0/0/1 on Juniper, Ethernet1 on Arista.Answer the question below
What is the main benefit of using a data modeling language like YANG instead of vendor-specific CLI?
YANG stands for Yet Another Next Generation. It is a data modeling language.
Think of it as a way to write down what a router's configuration looks like, in a format every vendor agrees on.Two RFCs define YANG: RFC 6020 for version 1.0 and RFC 7950 for version 1.1.
Both define the same language, with version 1.1 refining version 1.0.What a YANG Module Looks Like
A YANG file is called a module.
It lists every field a device exposes and the type of value each field accepts.
Inside a module, the value-holding fields are called leafs.Here is a simplified extract of the
ietf-interfacesmodule:module ietf-interfaces { container interfaces { list interface { key "name"; leaf name { type string; } leaf description { type string; } leaf enabled { type boolean; } } } }You do not write YANG modules yourself.
Vendors and standards bodies write them.Your job is to read them and send matching data.
Answer the question below
What is the name of a YANG file that defines fields and their data types?
Validation Before Apply
Before applying any change, the device checks your data against its YANG modules.

Figure 3 – YANG rejects the change before it applies
In the example above, the script sends
"enabled": "yes".
R1 sees thatenabledexpects a boolean, finds a string instead, and answers with400 Bad Request.
The running config stays untouched.40 % Complete: you’re making great progress
Unlock the rest of this lesson
If you’d like to continue your CCNA journey, simply create your free account.
Access all CCNA lessons
Practice with hands-on labs
Train with Practice exams and Quizzes
Progress tracking in your dashboard
Made by network engineers - CCNP certified
3714 learners globally