• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Architect

  • Network Automation
    • Network Automation Courses
    • What is NetDevOps?
    • Workflow Orchestration
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Hosts File
    • Python Network Automation
      • Nornir
      • Python Network Automation Course
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox Training
      • Infrahub
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

Automating Network Configurations with Ansible and NETCONF on Nokia Routers

Home » Network Automation » NetConf

Introduction to Network Automation with Ansible

Why Use Ansible for Network Automation?

For network engineers looking to start with automation, Ansible provides a low barrier to entry while offering powerful capabilities for managing and configuring network infrastructure. It can help automate routine tasks, improve operational efficiency, and free up time for more strategic work. Ansible is easy to install and learn and whilst it’s written in Python only requires some basic understanding of YAML to write your first playbook.

What is NETCONF and How does it fit into Network Automation?

NETCONF, or Network Configuration Protocol, is a network management protocol designed to automate the configuration and management of network devices. It fits into network automation by providing a standardized method for delivering, modifying, and deleting configurations on network devices, which is essential for efficient network operations in modern environments.

Key Features of NETCONF

  1. Client-Server Architecture: NETCONF operates using a client-server model where the client (often a network management system) sends requests to the server (network devices) to perform configuration tasks.
  2. XML-Based Encoding: It uses XML for encoding configuration data and protocol messages, facilitating interoperability between devices from different vendors.
  3. Remote Procedure Calls (RPCs): NETCONF utilizes RPCs to communicate between clients and servers, allowing for precise control over configuration changes.
  4. Data Stores: NETCONF defines multiple configuration data stores, such as ‘running’, ‘startup’, and ‘candidate’, which help in managing configurations without impacting the current operational state.
  5. Transactional Capabilities: It supports transactional operations for configuration changes, ensuring that updates are applied consistently across devices.
  6. Security Features: NETCONF includes security mechanisms like authentication and authorization to ensure secure message transmission.

Advantages of NETCONF in Network Automation

  • Automated Configuration Management: NETCONF allows for automated delivery and modification of device configurations, reducing manual errors and improving efficiency.
  • Vendor Neutrality: Its use of XML and standardized APIs makes it suitable for multi-vendor environments, enhancing flexibility in diverse network setups.
  • Enhanced Reliability: The transactional nature of NETCONF ensures reliable configuration changes, minimizing the risk of network outages due to misconfigurations.
  • Support for Complex Networks: By enabling programmable control over network devices, NETCONF supports the automation needs of complex networks like data centers and service provider networks.

Overall, NETCONF plays a crucial role in modern network automation by providing a robust framework for managing network configurations efficiently and reliably.

Understanding NETCONF and YANG Models

The Role of YANG in Model-Driven Automation

YANG plays a crucial role in model-driven network automation by providing a standardized way to define and structure network device configurations and operational data. Here are the key aspects of YANG’s role in model-driven automation:

Data Modeling Language

YANG serves as a data modeling language specifically designed for network devices and protocols. It allows for the creation of structured, hierarchical models that describe:

  1. Configuration data
  2. Operational state data
  3. Remote procedure calls (RPCs)
  4. Notifications

These models provide a clear and consistent representation of network device capabilities and data.

Enabling Programmatic Interfaces

YANG models enable the use of programmatic interfaces for network management, such as:

  • NETCONF (Network Configuration Protocol)
  • RESTCONF
  • gRPC/gNMI (gRPC Network Management Interface)

These protocols use YANG models to define the structure and semantics of the data exchanged between network devices and management systems.

Standardization and Interoperability

YANG promotes standardization across different vendors and network devices:

  • Vendors can create YANG models for their specific devices
  • Standard YANG models (e.g., IETF, OpenConfig) provide a common language for network automation
  • This standardization facilitates interoperability and consistency in multi-vendor environments12

Automation Benefits

The use of YANG in model-driven automation offers several advantages:

  1. Improved reliability: Structured data models reduce errors in configuration and data retrieval.
  2. Increased scalability: Standardized models allow for more efficient automation across large networks.
  3. Enhanced programmability: YANG models provide a clear interface for developers to interact with network devices.
  4. Real-time data collection: YANG-based telemetry enables streaming of operational data for analytics and monitoring.

Supporting Network Programmability

YANG models support various aspects of network programmability:

  • Configuration management: Defining and applying network configurations consistently.
  • State retrieval: Gathering operational data from devices in a structured format.
  • Telemetry: Enabling real-time streaming of network statistics and state information.
  • Service modeling: Describing network services at a higher level of abstraction.

Facilitating DevOps and NetOps

YANG models play a crucial role in enabling DevOps and NetOps practices in networking:

  • They allow for version control of network configurations
  • Support infrastructure-as-code practices
  • Enable automated testing and validation of network changes2

In conclusion, YANG is fundamental to model-driven network automation, providing a standardized, vendor-neutral approach to describing network device capabilities and data. This standardization enables more efficient, reliable, and scalable network automation practices across diverse network environments.

How NETCONF and YANG Work Together for Configuration Management

NETCONF and YANG work together to provide a powerful framework for network configuration management. Here’s an overview of how they complement each other:

NETCONF: The Protocol

NETCONF serves as the communication protocol for network device configuration:

  1. Client-Server Model: NETCONF operates using a client-server architecture, where the client (typically a management system) communicates with the server (network device).
  2. XML-Based Communication: It uses XML for encoding configuration data and protocol messages, facilitating standardized communication.
  3. RPC Mechanism: NETCONF employs Remote Procedure Calls (RPCs) for interaction between clients and servers1.
  4. Configuration Operations: It provides operations like <get>, <get-config>, <edit-config>, <copy-config>, and <delete-config> for managing device configurations.
  5. Data Stores: NETCONF defines multiple configuration datastores (running, candidate, startup) for managing configurations.

YANG: The Data Modeling Language

YANG complements NETCONF by providing a standardized way to model network device data:

  1. Data Modeling: YANG is used to create structured, hierarchical models that describe configuration and operational data of network devices.
  2. Standardization: It offers a consistent way to represent device capabilities and data across different vendors.
  3. Validation: YANG models provide rules for data validation, ensuring that only valid configurations are applied to devices.

How They Work Together

  1. Model-Driven Approach: NETCONF uses YANG models to understand the structure and semantics of the data being exchanged.
  2. Configuration Validation: When a NETCONF client sends a configuration request, the server uses YANG models to validate the request before applying it.
  3. Structured Data Exchange: YANG models provide a clear structure for the data exchanged via NETCONF, making it easier to automate configuration tasks.
  4. Capability Negotiation: During the initial NETCONF connection, devices exchange capabilities, including supported YANG models, ensuring compatibility.
  5. Extensibility: Vendors can define custom YANG models for proprietary features while still using the standard NETCONF protocol for communication.

Benefits of the NETCONF/YANG Combination

  1. Improved Reliability: The structured nature of YANG models and NETCONF’s transactional capabilities reduce configuration errors.
  2. Vendor Neutrality: Standardized models allow for consistent configuration across multi-vendor networks.
  3. Automation: The programmatic interface provided by NETCONF and the clear structure of YANG models facilitate network automation.
  4. Scalability: The model-driven approach allows for efficient management of large-scale networks.

By leveraging NETCONF as the transport protocol and YANG for data modeling, network operators can achieve more reliable, efficient, and automated configuration management across their network infrastructure.

Setting Up a Lab Environment for Nokia Routers

Using Real Hardware vs. Virtualized Environments

Setting Up Nokia Routers in a Virtual Lab Using Containerlab

ContainerLab is an open source container orchestration tool for easily spinning up network automation labs, developed by Roman Dodin from Nokia

Configuring NETCONF on Nokia Routers

Ansible Basics for Network Automation

What is Ansible?

Key Concepts in Ansible for Network Automation

Using Ansible Collections for Network Devices

Getting Started with NETCONF on Nokia Routers Using Ansible

Automating Network Configurations with Ansible and NETCONF on Nokia Routers is a process which is not highly documented, compared to performing NETCONF tasks on Cisco routers for example. Hopefully this post will provide a reference point with all my knowledge on one page which should help someone!

Installing Ansible and Required Collections

Configuring Ansible to Connect to Nokia Routers Over NETCONF

A Simple Playbook to Retrieve Configuration via NETCONF

Working with YANG Models for Nokia Routers

Understanding YANG Models and Their Role in Device Configuration

Retrieving and Interpreting YANG Models for Nokia Routers

Writing Configuration Using YANG Models in Ansible Playbooks

Writing Ansible Playbooks for Nokia Routers

Automating Basic Configuration Tasks (e.g., Interface Configuration)

Example Playbook: Configuring Interfaces on Nokia Routers

Using Templates for Reusable and Scalable Playbooks

Leveraging the Nokia.sros Ansible Collection

What is the Nokia.sros Collection?

Installing and Using the Nokia.sros Collection

Automating Advanced Configurations with Pre-built Roles

Troubleshooting and Best Practices

Debugging NETCONF Connections with Ansible

Handling Errors in Playbooks

Best Practices for Network Automation with Ansible and NETCONF

Additional Resources

Recommended Documentation and Guides

network.developer.nokia.com/sr/learn/sr-os-ansible

docs.ansible.com/ansible/latest/collections/community/network/sros_config_module.html

Online Communities and Forums for Ansible Network Automation

Category: NetConf
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:Nautobot vs Netbox
Next Post:AWX API

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

python course for network engineers

Topics

Network Automation
Ansible
Python for Network Automation
CCIE
Cisco ISE
F5 Certification
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Python VENV Tutorial
Python for Network Engineers

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
What is Ansible?
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2025 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms