Cisco CCNP Enterprise (ENCOR 350-401) · lesson 12 of 12 · 35 min
Why Network Automation?
Manual CLI configuration doesn’t scale. A network engineer configuring 500 switches one at a time makes mistakes, takes days, and can’t be easily audited. Automation allows consistent, repeatable, auditable configuration changes at scale. The ENCOR exam tests your understanding of automation concepts, tools, and protocols — not deep programming skills. Manual CLI is like writing 500 letters by hand. Automation is like a mail merge — you write the template once, fill in the variables, and print 500 personalized letters in minutes. The result is faster, more consistent, and easier to audit.
Automation Tools Overview
Data Formats: JSON, XML, YAML
JSON example { “interface”: { “name”: “GigabitEthernet0/0”, “ip”: “10.0.0.1”, “mask”: “255.255.255.0”, “enabled”: true } }
REST APIs
REST (Representational State Transfer) APIs use HTTP methods to interact with network devices and controllers. Cisco DNA Center, vManage, and many modern devices expose REST APIs.
NETCONF and YANG
NETCONF (Network Configuration Protocol) is a standards-based protocol for network device configuration. It uses XML for data encoding and SSH for transport. YANG (Yet Another Next Generation) is the data modeling language that defines the structure of configuration and state data. YANG model structure YANG defines modules with containers, lists, leaf-lists, and leaves. A container groups related data. A list is like a table with key-based entries. A leaf holds a single value. YANG models are used by both NETCONF and RESTCONF.
Cisco DNA Center and Intent-Based Networking
Python for Network Automation
Python is the dominant language for network automation. Key libraries:
Flashcard Drill
Ansible Agentless push automation — YAML playbooks pushed over SSH. Most popular for network automation. NETCONF Network Configuration Protocol — SSH port 830, XML data format, supports transactions with candidate datastore and commit/rollback. YANG Yet Another Next Generation — data modeling language that defines the structure of network configuration and state data. RESTCONF REST-based alternative to NETCONF — HTTPS port 443, supports JSON and XML, uses HTTP methods. REST GET HTTP GET — reads/retrieves a resource. No side effects. REST POST HTTP POST — creates a new resource. DNA Center Cisco’s intent-based networking controller — REST API, SD-Access fabric controller, AI/ML assurance. Netmiko Python library for SSH connections to network devices — simplifies multi-vendor CLI automation. Infrastructure as Code Treating network configuration like software — version-controlled, tested, and deployed automatically.
Knowledge Check — 12 Questions
Network Automation: Python, REST, NETCONF & YANG
Which automation tool uses YAML playbooks and is agentless (no software on devices)?
- Puppet
- Chef
- Ansible
- Terraform
Answer: Ansible
Ansible uses YAML playbooks pushed over SSH — no agent needs to be installed on network devices. It is the most popular tool for network automation.
Which HTTP method is used to retrieve information from a REST API?
- POST
- PUT
- GET
- DELETE
Answer: GET
HTTP GET retrieves/reads a resource. It has no side effects — it does not modify data.
What transport and port does NETCONF use?
- HTTP port 80
- HTTPS port 443
- SSH port 830
- TCP port 179
Answer: SSH port 830
NETCONF uses SSH on port 830 for transport and XML for data encoding.
What is YANG?
- A REST API framework
- A data modeling language for network configuration
- A Python library for SSH
- A Cisco proprietary protocol
Answer: A data modeling language for network configuration
YANG (Yet Another Next Generation) is a data modeling language that defines the structure of configuration and state data used by NETCONF and RESTCONF.
What HTTP status code indicates a resource was successfully created?
- 200
- 201
- 400
- 404
Answer: 201
HTTP 201 Created indicates that a new resource was successfully created in response to a POST request.
What is the key difference between NETCONF and RESTCONF?
- NETCONF uses JSON; RESTCONF uses XML
- NETCONF uses SSH/XML with transactions; RESTCONF uses HTTPS/JSON or XML
- RESTCONF is older than NETCONF
- NETCONF is Cisco-only; RESTCONF is open standard
Answer: NETCONF uses SSH/XML with transactions; RESTCONF uses HTTPS/JSON or XML
NETCONF uses SSH port 830 with XML and supports full transactions (candidate datastore, commit, rollback). RESTCONF uses HTTPS port 443 with JSON or XML and HTTP methods.
The Python library used for SSH connections to network devices is called _____.
Answer: Netmiko
Netmiko is a Python library that simplifies SSH connections to multi-vendor network devices.
What does Cisco DNA Center provide?
- A CLI for router configuration
- Intent-based networking with REST API, SD-Access control, and AI/ML assurance
- A replacement for OSPF
- A firewall management platform
Answer: Intent-based networking with REST API, SD-Access control, and AI/ML assurance
DNA Center is Cisco’s intent-based networking controller — it provides REST APIs, manages SD-Access fabric, and uses AI/ML for network assurance.
Which data format is used exclusively by NETCONF?
- JSON
- YAML
- XML
- CSV
Answer: XML
NETCONF uses XML exclusively for data encoding. RESTCONF supports both JSON and XML.
What HTTP method replaces an entire configuration object?
- GET
- POST
- PUT
- PATCH
Answer: PUT
HTTP PUT replaces an entire resource. PATCH modifies specific fields of an existing resource.
Ansible requires an agent to be installed on each network device.
- True
- False
Answer: False
Ansible is agentless — it pushes configuration over SSH without requiring any software to be installed on the managed devices.
What is Infrastructure as Code (IaC)?
- Writing code that runs on network devices
- Treating network configuration like software — version-controlled, tested, and deployed automatically
- Using Python to configure routers
- A Cisco certification track
Answer: Treating network configuration like software — version-controlled, tested, and deployed automatically
IaC means network configuration is stored in version control (Git), tested in CI/CD pipelines, and deployed automatically — the same practices used for application software.
Previous lesson: SD-WAN architecture: vEdge, vSmart, vBond, vManage; overlay/underlay, OMP, policies
Back to Cisco CCNP Enterprise (ENCOR 350-401)