YANG
Infrastructure
The Polaris Yang Infrastructure 16.3 feature facilitates a programmatic and standards-based way of writing configurations and reading operational data from network devices.
- Finding Feature Information
- Introduction to Data Models - Programmatic and Standards-based Configuration
- NETCONF
- Configuring NETCONF Options
- Additional References
- Feature Information for YANG Infrastructure
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.
Introduction to Data Models - Programmatic and Standards-based Configuration
The traditional way of managing network devices is by using Command Line Interfaces (CLIs) for configurational (configuration commands) and operational data (show commands). For network management, Simple Network Management Protocol (SNMP) is widely used, especially for exchanging management information between various network devices. Although CLIs and SNMP are heavily used, they have several restrictions. CLIs are highly proprietary, and human intervention is required to understand and interpret their text-based specification. SNMP does not distinguish between configurational and operational data.
The solution lies in adopting a programmatic and standards-based way of writing configurations to any network device, replacing the process of manual configuration. Network devices running on Cisco IOS XE support the automation of configuration for multiple devices across the network using data models. Data models are developed in a standard, industry-defined language, that can define configuration and state information of a network.
Cisco IOS XE supports the Yet Another Next Generation (YANG) data modeling language. YANG can be used with the Network Configuration Protocol (NETCONF) to provide the desired solution of automated and programmable network operations. NETCONF (RFC 6241) is an XML-based protocol that client applications use to request information from and make configuration changes to the device. YANG is primarily used to model the configuration and state data used by NETCONF operations.
In Cisco IOS XE, model-based interfaces interoperate with existing device CLI, Syslog, and SNMP interfaces. These interfaces are optionally exposed northbound from network devices. YANG is used to model each protocol based on RFC 6020.
Note | To access Cisco YANG models in a developer-friendly way, please clone the GitHub repository https://github.com/YangModels/yang, and visit the vendor/cisco (https://github.com/YangModels/yang/tree/master/vendor/cisco) subdirectory. Models for various release of IOS-XE, IOS-XR, and NX-OS platforms are available here. |
NETCONF
NETCONF provides a simpler mechanism to install, manipulate, and delete the configuration of network devices.
It uses an Extensible Markup Language (XML)-based data encoding for the configuration data as well as the protocol messages.
NETCONF uses a simple RPC-based (Remote Procedure Call) mechanism to facilitate communication between a client and a server. The client can be a script or application typically running as part of a network manager. The server is typically a network device (switch or router). It uses Secure Shell (SSH) as the transport layer across network devices.
NETCONF also supports capability discovery and model downloads. Supported models are discovered using the ietf-netconf-monitoring model. Revision dates for each model are shown in the capabilities response. Data models are available for optional download from a device using the get-schema rpc. You can use these YANG models to understand or export the data model.
For more details, refer RFC 6241.
Configuring NETCONF
You must configure AAA in the IOS-XE device before configuring the NETCONF as follows:
-
aaa new-model
-
aaa authentication login default local
-
aaa authorization exec default local
You must configure NETCONF-YANG as follows.
1.
enable
2.
configure terminal
3.
netconf-yang
4.
exit
DETAILED STEPS
Configuring NETCONF Options
Configuring SNMP
Enable the SNMP Server in IOS to enable NETCONF to access SNMP MIB data using YANG models generated from supported MIBs, and to enable supported SNMP traps in IOS to receive NETCONF notifications from the supported traps.
Perform the following steps:
1. Enable SNMP features in IOS.
2. After NETCONF-YANG starts, enable SNMP Trap support by sending the following RPC <edit-config> message to the NETCONF-YANG port.
3. Send the following RPC message to the NETCONF-YANG port to save the running configuration to the startup configuration.
DETAILED STEPS
Step 1 | Enable SNMP features in IOS.
Example: configure terminal logging history debugging logging snmp-trap emergencies logging snmp-trap alerts logging snmp-trap critical logging snmp-trap errors logging snmp-trap warnings logging snmp-trap notifications logging snmp-trap informational logging snmp-trap debugging ! snmp-server community public RW snmp-server trap link ietf snmp-server enable traps snmp authentication linkdown linkup snmp-server enable traps syslog snmp-server manager exit |
Step 2 | After NETCONF-YANG starts, enable SNMP Trap support by sending
the following RPC <edit-config> message to the NETCONF-YANG port.
Example: <?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id=""> <edit-config> <target> <running/> </target> <config> <netconf-yang xmlns="http://cisco.com/yang/cisco-self-mgmt"> <cisco-ia xmlns="http://cisco.com/yang/cisco-ia"> <snmp-trap-control> <trap-list> <trap-oid>1.3.6.1.4.1.9.9.41.2.0.1</trap-oid> </trap-list> <trap-list> <trap-oid>1.3.6.1.6.3.1.1.5.3</trap-oid> </trap-list> <trap-list> <trap-oid>1.3.6.1.6.3.1.1.5.4</trap-oid> </trap-list> </snmp-trap-control> </cisco-ia> </netconf-yang> </config> </edit-config> </rpc> |
Step 3 | Send the following RPC message to the NETCONF-YANG port to save
the running configuration to the startup configuration.
Example: <?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id=""> <cisco-ia:save-config xmlns:cisco-ia="http://cisco.com/yang/cisco-ia"/> </rpc> |
Configuring Operational Data Manager
The NETCONF Operational Data Manager provides the ability to read operational data using YANG models. Each ODM parser polls the specified operational data according to the specified polling interval in milliseconds.
Perform the following steps:
1. After NETCONF-YANG starts, send the following RPC <edit-config> message to the NETCONF-YANG port.
2. Send the following RPC message to the NETCONF-YANG port to save the running configuration to the startup configuration.
DETAILED STEPS
Step 1 | After NETCONF-YANG starts, send the following RPC
<edit-config> message to the NETCONF-YANG port.
Example: <?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id=""> <edit-config> <target> <running/> </target> <config> <netconf-yang xmlns="http://cisco.com/yang/cisco-self-mgmt"> <cisco-odm xmlns="http://cisco.com/yang/cisco-odm"> <polling-enable>true</polling-enable> <on-demand-default-time>30000</on-demand-default-time> <on-demand-enable>false</on-demand-enable> <actions> <action-name>parse.showACL</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showArchive</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showEnvironment</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showFlowMonitor</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showInterfaces</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showIpRoute</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showMemoryStatistics</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showPlatformSoftware</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showProcessesCPU</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> <actions> <action-name>parse.showProcessesMemory</action-name> <polling-interval>120000</polling-interval> <mode>poll</mode> </actions> </cisco-odm> </netconf-yang> </config> </edit-config> </rpc>The <edit-config> can be modified to enable or disable specific actions and/or to choose a different update frequency. |
Step 2 | Send the following RPC message to the NETCONF-YANG port to save
the running configuration to the startup configuration.
Example: <?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id=""> <cisco-ia:save-config xmlns:cisco-ia="http://cisco.com/yang/cisco-ia"/> </rpc> |
Additional References
Related Documents
Related Topic |
Document Title |
---|---|
YANG data models for various release of IOS-XE, IOS-XR, and NX-OS platforms |
Clone the GitHub repository https://github.com/YangModels/yang and visit the vendor/cisco (https://github.com/YangModels/yang/tree/master/vendor/cisco) subdirectory. |
Standards and RFCs
Standard/RFC |
Title |
---|---|
RFC 6020 |
YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF) |
RFC 6241 |
Network Configuration Protocol (NETCONF) |
Technical Assistance
Description |
Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
Feature Information for YANG Infrastructure
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Feature Name |
Releases |
Feature Information |
---|---|---|
Polaris Yang Infrastructure 16.3 |
Cisco IOS XE Denali 16.3.1 |
The Polaris Yang Infrastructure 16.3 feature facilitates a programmatic and standards-based way of writing configurations and reading operational data from network devices. The following commands were introduced or modified: netconf-yang. |