B 1612 Programmability CG
B 1612 Programmability CG
x
First Published: 2019-07-31
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,
INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH
THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,
CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of
the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS.
CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network
topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional
and coincidental.
All printed copies and duplicate soft copies of this document are considered uncontrolled. See the current online version for the latest version.
Cisco has more than 200 offices worldwide. Addresses and phone numbers are listed on the Cisco website at www.cisco.com/go/offices.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:
https://www.cisco.com/c/en/us/about/legal/trademarks.html. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a
partnership relationship between Cisco and any other company. (1721R)
© 2019 Cisco Systems, Inc. All rights reserved.
CONTENTS
PART I Provisioning 19
CHAPTER 3 iPXE 49
Day Zero Guest Shell Provisioning Using Front-Panel Port or Fiber Uplink 71
Cisco IOx Overview 71
IOx Tracing and Logging Overview 72
IOXMAN Structure 72
Logging and Tracing System Flow 73
Logging and Tracing of Messages 75
How to Enable the Guest Shell 76
Managing IOx 76
Managing the Guest Shell 78
Managing the Guest Shell Using Application Hosting 79
Accessing the Python Interpreter 81
Configuration Examples for the Guest Shell 82
Example: Managing the Guest Shell 82
Sample VirtualPortGroup Configuration 82
Example: Guest Shell Usage 83
Example: Guest Shell Networking Configuration 84
Sample DNS Configuration for Guest Shell 84
Example: Configuring Proxy Environment Variables 84
Example: Configuring Yum and PIP for Proxy Settings 85
Additional References for Guest Shell 85
Feature Information for Guest Shell 86
Using Python 89
Cisco Python Module 89
Cisco Python Module to Execute IOS CLI Commands 91
Provisioning
iPXE Cisco IOS XE Denali 16.3.2 and Cisco IOS XE Everest 16.5.1a
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3650 Series Switches
Model-Driven Programmability
Application Hosting
OpenFlow
OpenFlow Cisco IOS XE Fuji 16.9.1
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches and Cisco Catalyst
9500-High Performance Series Switches
Note In case Zero-Touch Provisioning fails, the device falls back to AutoInstall to load configuration files. For
more information, see Using AutoInstall and Setup.
After receiving these DHCP options, the device connects to the HTTP/TFTP server, and downloads the Python
script. The device, at this point does not have any route to reach the HTTP/TFTP server, so it uses the default
route provided by the DHCP server.
DHCPv6 Support
In Cisco IOS XE Fuji 16.9.1, Dynamic Host Control Protocol Version 6 (DHCPv6) support is added to the
Zero-touch provisioning feature. DHCPv6 is enabled by default, and will work on any device that boots
without a startup configuration.
Note DHCPv6 is only supported on Catalyst 9300 and 9500 Series Switches.
DHCPv6 is supported by both TFTP and HTTP download of Python scripts. If the HTTP or TFTP download
of Python scripts fail, the device will revert to the start (without any configuration). For both DHCPv4, and
DHCPv6 to work, the correct HTTP file path must be available in the DHCP configuration.
There can be scenarios where the same interface can have both IPv4 and IPv6 addresses, or two different
interfaces in the network - one can receive IPv4 traffic and the other IPv6 traffic. We recommend that you
use either the DHCPv4 or DHCPv6 option in your deployment.
The following is a sample DHCPv4: /etc/dhcp/dhcpd.conf:
host <hostname> {
hardware ethernet xx:xx:xx:xx:xx:xx;
option dhcp-client-identifier "xxxxxxxxxxxxxx";
option host-name "<hostname>".
option log-servers x.x.x.x;
fixed-address x.x.x.x;
if option vendor-class-identifier = "..." {
option vendor-class-identifier "...";
if exists user-class and option user-class = "iPXE" {
filename "http://x.x.x.x/…/<image>";
} else {
filename "http://x.x.x.x/…/<script-name>";
}
}
}
Device> enable
Device# configure terminal
Device(config)# ip dhcp excluded-address 10.1.1.1
Device(config)# ip dhcp excluded-address vrf Mgmt-vrf 10.1.1.1 10.1.1.10
Device(config)# ip dhcp pool pnp_device_pool
Device(config-dhcp)# vrf Mgmt-vrf
Device(config-dhcp)# network 10.1.1.0 255.255.255.0
Device(config-dhcp)# default-router 10.1.1.1
Device(config-dhcp)# option 150 ip 203.0.113.254
Device(config-dhcp)# option 67 ascii /sample_python_dir/python_script.py
Device(config-dhcp)# exit
Device(config)# interface gigabitethernet 1/0/2
Device(config-if)# no ip dhcp client request tftp-server-address
Device(config-if)# end
Device> enable
Device# configure terminal
Device(config)# ip dhcp pool pnp_device_pool
Device(config-dhcp)# vrf Mgmt-vrf
Device(config-dhcp)# network 10.1.1.0 255.255.255.0
Device(config-dhcp)# default-router 10.1.1.1
Device(config-dhcp)# option 67 ascii http://198.51.100.1:8000/sample_python_2.py
Device(config-dhcp)# end
Device> enable
Device# configure terminal
Device(config)# ip dhcp excluded-address 10.1.1.1
Device(config)# ip dhcp pool pnp_device_pool
Device(config-dhcp)# network 10.1.1.0 255.255.255.0
Device(config-dhcp)# default-router 10.1.1.1
Device(config-dhcp)# option 150 ip 203.0.113.254
Device(config-dhcp)# option 67 ascii /sample_python_dir/python_script.py
Device(config-dhcp)# exit
Device(config)# interface gigabitethernet 1/0/2
Device(config-if)# no ip dhcp client request tftp-server-address
Device(config-if)# end
Device> enable
Device# configure terminal
Device(config)# ip dhcp excluded-address 10.1.1.1
Device(config)# ip dhcp pool pnp_device_pool
Device(config-dhcp)# network 10.1.1.0 255.255.255.0
Device(config-dhcp)# default-router 10.1.1.1
Device(config-dhcp)# option 67 ascii http://192.0.2.1:8000/sample_python_2.py
Device(config-dhcp)# end
The following sample DHCP configuration shows that a Python script is copied from an HTTP server to the
device:
Day0_with_mgmt_port_http
-------------------------
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.255;
host C2-3850 {
fixed-address 192.168.1.246 ;
hardware ethernet CC:D8:C1:85:6F:00;
option bootfile-name "http://192.168.1.46/sample_python_2.py";
}
}
Once the DHCP server is running, boot a management-network connected device, and the rest of the
configuration is automatic.
Device> enable
Device# configure terminal
Device(config)# ipv6 dhcp pool ztp
Device(config-dhcpv6)# address prefix 2001:DB8::1/64
Device(config-dhcpv6)# domain-name cisco.com
Device(config-dhcpv6)# bootfile-url tftp://[2001:db8::46]/sample_day0_script.py
Device(config-dhcpv6)# exit
Device(config)# interface vlan 20
Device(config-if)# ipv6 dhcp server ztp
Device(config-if)# end
print "\n\n *** Sample ZTP Day0 Python Script *** \n\n"
print "\n\n *** ZTP Day0 Python Script Execution Complete *** \n\n"
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
The Day Zero provisioning is complete, and the IOS prompt is accessible.
...
The section shows how to configure the device for Day Zero provisioning:
Initializing Hardware...
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
*Sep 4 20:36:19.562: [IOX DEBUG] Setting up chasfs for iox related activity
*Sep 4 20:36:19.562: [IOX DEBUG] Setting up for iox pre-clean activity if needed
*Sep 4 20:36:19.562: [IOX DEBUG] Waiting for iox pre-clean setup to take affect
*Sep 4 20:36:19.562: [IOX DEBUG] Waited for 1 sec(s) for iox pre-clean setup to take affect
*Sep 4 20:36:19.563: [IOX DEBUG] Waiting for CAF and ioxman to be up, in that order
*Sep 4 20:36:34.564: [IOX DEBUG] Waited for 16 sec(s) for CAF and ioxman to come up
*Sep 4 20:36:34.564: [IOX DEBUG] Validating if CAF and ioxman are running
*Sep 4 20:36:34.564: [IOX DEBUG] CAF and ioxman are up and running
*Sep 4 20:36:34.564: [IOX DEBUG] Building the simple mgmt-intf enable command string
*Sep 4 20:36:34.564: [IOX DEBUG] Enable command is: request platform software iox-manager
*Sep 4 20:36:34.564: [IOX DEBUG] Issuing guestshell enable command and waiting for it to
be up
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
Would you like to enter the initial configuration dialog? [yes/no]: The process for the
command is not
responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
guestshell installed successfully
Current state is: DEPLOYED
guestshell activated successfully
Current state is: ACTIVATED
guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully
The section shows how to configure the device for Day Zero provisioning:
Cisco IOS Software [Fuji], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.9.4, RELEASE
SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Thu 22-Aug-19 18:14 by mcpre
Your use of the Software is subject to the Cisco End User License Agreement
(EULA) and any relevant supplemental terms (SEULA) found at
http://www.cisco.com/c/en/us/about/legal/cloud-and-software/software-terms.html.
You hereby acknowledge and agree that certain Software and/or features are
licensed for a particular term, that the license to such Software and/or
features is valid only for the applicable term and that such Software and/or
features may be shut down or otherwise terminated by Cisco after expiration
of the applicable license term (e.g., 90-day trial period). Cisco reserves
the right to terminate any such Software feature electronically or by any
other means available. While Cisco may provide alerts, it is your sole
responsibility to monitor your usage of any such term Software feature to
ensure that your systems and networks are prepared for a shutdown of the
Software feature.
FIPS: Flash Key Check : Key Not Found, FIPS Mode Not Enabled
cisco C9300-48UXM (X86) processor with 1419044K/6147K bytes of memory.
Processor board ID FCW2144L045
2048K bytes of non-volatile configuration memory.
8388608K bytes of physical memory.
1638400K bytes of Crash Files at crashinfo:.
11264000K bytes of Flash at flash:.
0K bytes of WebUI ODM Files at webui:.
Would you like to enter the initial configuration dialog? [yes/no]: The process for the
command is not
responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
The process for the command is not responding or is otherwise unavailable
guestshell installed successfully
Current state is: DEPLOYED
guestshell activated successfully
Current state is: ACTIVATED
guestshell started successfully
Any interface listed with OK? value "NO" does not have a valid configuration
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned NO unset up up
GigabitEthernet0/0 10.127.128.5 YES DHCP up up
Tw1/0/1 unassigned YES unset down down
Tw1/0/2 unassigned YES unset down down
Tw1/0/3 unassigned YES unset down down
Tw1/0/4 unassigned YES unset down down
Tw1/0/5 unassigned YES unset down down
Tw1/0/6 unassigned YES unset down down
Tw1/0/7 unassigned YES unset down down
Tw1/0/8 unassigned YES unset down down
Tw1/0/9 unassigned YES unset down down
Tw1/0/10 unassigned YES unset down down
Tw1/0/11 unassigned YES unset down down
Tw1/0/12 unassigned YES unset down down
Tw1/0/13 unassigned YES unset down down
Tw1/0/14 unassigned YES unset down down
Tw1/0/15 unassigned YES unset down down
However, type 0 passwords will soon be deprecated. Migrate to a supported password type
Line 2 SUCCESS: ip domain name domain
Line 3 SUCCESS: line vty 0 15
Line 4 SUCCESS: login local
Line 5 SUCCESS: transport input all
Line 6 SUCCESS: end
Would you like to enter the initial configuration dialog? [yes/no]: day0guestshell installed
successfully
Current state is: DEPLOYED
day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
Guestshell enabled successfully
...
The section shows how to configure the device for Day Zero provisioning:
Cisco IOS Software [Gibraltar], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.12.3a,
This software version supports only Smart Licensing as the software licensing mechanism.
Your use of the Software is subject to the Cisco End User License Agreement
(EULA) and any relevant supplemental terms (SEULA) found at
http://www.cisco.com/c/en/us/about/legal/cloud-and-software/software-terms.html.
You hereby acknowledge and agree that certain Software and/or features are
licensed for a particular term, that the license to such Software and/or
features is valid only for the applicable term and that such Software and/or
features may be shut down or otherwise terminated by Cisco after expiration
of the applicable license term (e.g., 90-day trial period). Cisco reserves
the right to terminate any such Software feature electronically or by any
other means available. While Cisco may provide alerts, it is your sole
responsibility to monitor your usage of any such term Software feature to
ensure that your systems and networks are prepared for a shutdown of the
Software feature.
FIPS: Flash Key Check : Key Not Found, FIPS Mode Not Enabled
Would you like to enter the initial configuration dialog? [yes/no]: day0guestshell installed
successfully
Current state is: DEPLOYED
day0guestshell activated successfully
Current state is: ACTIVATED
day0guestshell started successfully
Current state is: RUNNING
However, type 0 passwords will soon be deprecated. Migrate to a supported password type
Line 2 SUCCESS: ip domain name domain
Line 3 SUCCESS: line vty 0 15
Line 4 SUCCESS: login local
Zero-Touch Provisioning: Cisco IOS XE Fuji 16.8.1 Zero-Touch Provisioning supports HTTP and
HTTP Download TFTP file download.
Cisco IOS XE Fuji 16.8.1a
In Cisco IOS XE Everest 16.8.1, this feature
was implemented on the following platforms:
• Cisco 4000 Series Integrated Services
Routers
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9500 Series Switches
DHCPv6 Support for Cisco IOS XE Fuji 16.9.1 In Cisco IOS XE Fuji 16.9.1, this feature was
Zero-Touch Provisioning implemented on the following platforms
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9500 Series Switches
Netboot Requirements
The following are the primary requirements for netbooting:
• DHCP server with proper configuration.
• Boot image available on the FTP/HTTP/TFTP server.
• Device configured to boot from a network-based source.
iPXE Overview
Network bootloaders support booting from a network-based source. The bootloaders boot an image located
on an HTTP, FTP, or TFTP server. A network boot source is detected automatically by using an iPXE-like
solution.
iPXE enables network boot for a device that is offline. The following are the three types of boot modes:
• iPXE Timeout—Boots through iPXE network boot. Configures a timeout in seconds for iPXE network
boot by using the IPXE_TIMEOUT rommon variable. Use the boot ipxe timeout command to configure
iPXE timeout. When the timeout expires, device boot is activated.
• iPXE Forever—Boots through iPXE network boot. The device sends DHCP requests forever, when the
boot ipxe forever command is configured. This is an iPXE-only boot (which means that the bootloader
will not fall back to a device boot or a command prompt, because it will send DHCP requests forever
until it receives a valid DHCP response.)
• Device—Boots using the local device BOOT line configured on it. When device boot is configured, the
configured IPXE_TIMEOUT rommon variable is ignored. You can activate device boot as specified
below:
• If BOOTMODE=ipxe-forever, device boot is not activated without user intervention (this is possible
only if ENABLE_BREAK=yes).
• If BOOTMODE=ipxe-timeout, device boot is activated when the specified IPXE_TIMEOUT variable
(in seconds) has elapsed.
• If BOOTMODE=device, device boot is activated. This is the default active mode.
• Device boot can also be activated through the CLI.
Note Manual boot is another term used in this document. Manual boot is a flag that determines whether to do a
rommon reload or not. When the device is in rommon mode, you have to manually issue the boot command.
If manual boot is set to YES, the rommon or device prompt is activated. If manual boot is set to NO, the
autoboot variable is executed; this means that the value set in the BOOT variable is followed.
1. Bootloader sends a DHCP discover message, and when the server replies, the Bootloader sends a DHCP
request.
2. The DHCP response includes the IP address and boot file name. The boot file name indicates that the boot
image is to be retrieved from a TFTP server (tftp://server/filename), FTP server
(ftp://userid:password@server/filename), or an HTTP server (http://server/filename).
3. Bootloader downloads and boots the image from the network source.
4. If no DHCP response is received, the bootloader keeps sending DHCP requests forever or for a specified
period of time, based on the boot mode configured. When a timeout occurs, the bootloader reverts to a
device-based boot. The device sends DHCP requests forever only if the configured boot mode is
ipxe-forever. If the ipxe-timeout boot mode command is configured, DHCP requests are sent for the
specified amount of time, and when the timeout expires, device boot mode is activated.
Note Because the current iPXE implementation works only via the management port (GigabitEthernet0/0), DHCP
requests sent through the front panel ports are not supported.
When using a static network configuration to network boot, ROMMON uses the following environment
variables (and all of them are required):
• BOOT—URLs separated by semicolon (;) to boot from.
• IP_ADDRESS—Statically assigned IP address of a device.
• DEFAULT_GATEWAY—Default gateway of the device.
• IP_SUBNET_MASK—IPv4 or IPv6 prefix information.
IPv4—Subnet mask of the device in the format WWW.XXX.YYY.ZZZ eg. 255.255.255.0.
IPv6—Subnet prefix length of the device in the format NNN eg. 64 or 112.
When manual boot is disabled, the bootloader determines whether to execute a device boot or a network boot
based on the configured value of the rommon iPXE variable. Irrespective of whether manual boot is enabled
or disabled, the bootloader uses the BOOTMODE variable to determine whether to do a device boot or a
network boot. Manual boot means that the user has configured the boot manual switch command. When
manual boot is disabled, and when the device reloads, the boot process starts automatically.
When iPXE is disabled, the contents of the existing BOOT variable are used to determine how to boot the
device. The BOOT variable may contain a network-based uniform resource identifier (URI) (for example,
http://, ftp://, tftp://), and a network boot is initiated; however DHCP is not used to get the network image
path. The static network configuration is taken from the IP_ADDRESS, DEFAULT_GATEWAY, and
IP_SUBNET_MASK variables. The BOOT variable may also contain a device filesystem-based path, in
which case, a device filesystem-based boot is initiated.
The DHCP server used for booting can identify a device through the Product ID (PID) (available in DHCP
Option 60), chassis serial number (available in DHCP option 61), or the MAC address of the device. The
show inventory and show switch commands also display these values on the device.
The following is sample output from the show inventory command:
Device# show inventory
Note In this illustration, the IPv6 booting device, the supporting device, and the DHCP
server are on the same subnet. However; if the supporting device and the DHCP
server are on different subnets, then there must be a relay agent in the network.
3. The device sends a DHCPv6 solicit message to the multicast group address of ff02::1:2 for all DHCP
agents.
The following sample displays the fields in a DHCPv6 solicit packet during iPXE boot:
DHCPv6
Message type: Solicit (1)
Transaction ID: 0x36f5f1
Client Identifier
Vendor Class
Identity Association for Non-Temporary Address
Option Request
User Class
Vendor-specific Information
4. If the DHCPv6 server is configured, it responds with a DHCPv6 advertise packet that contains the 128
Bit IPv6 address, the boot file Uniform Resource Identifier (URI), the Domain Name System (DNS) server
and domain search list, and the client and server IDs. The client ID contains the DUID of the client (In
this illustration, the IPv6 Booting Device), and the Server ID contains the DUID of the DHCPv6 server.
5. The client then sends a DHCPv6 request packet to the multicast group address ff02::1:2, requesting for
advertised parameters.
6. The server responds with a unicast DHCPv6 reply to the Link Local (FE80::) IPv6 address of the client.
The following sample displays the fields in a DHCPv6 reply packet:
DHCPv6
Message type: Reply (7)
Transaction ID: 0x790950
Identity Association for Non-Temporary Address
Client Identifier
Server Identifier
DNS recursive name server
Boot File URL
Domain Search List
7. The device then sends an HTTP GET request to the web server.
8. If the requested image is available at the specified path, the web server responds with an OK for the HTTP
GET request.
9. The TCP image transfer copies the image, and the device boots up.
The device uses the DHCP server-assigned address to boot an image. If the DHCPv6 server fails to assign an
address, the device tries to use the SLAAC address. If both the DHCP server-assigned address and the SLAAC
address are not available, the device uses the link-local address. However, the remote FTP/HTTP/TFTP servers
must be on the same local subnet as that of the device for the image copy to succeed.
If the first three addresses are not available, the device uses the automatically generated site-local address.
Note Catalyst 9000 Series Switches support DHCP Option 60, Option 77, DHCPv6 Options 1, Option 15, and
Option 16. DHCP Option 61 is only supported on Catalyst 9300 and 9500 Series Switches.
• DHCP Option 60—Vendor Class Identifier. This option is populated with the value of the ROMMON
environment variable MODEL_NUM.
• DHCP Option 61—Client Identifier. This option is populated with the value of theROMMON environment
variable SYSTEM_SERIAL_NUM.
• DHCP Option 77—User Class Option. This option is added to a DHCP Discover packet, and contains
the value equal to the string iPXE. This option helps to isolate iPXE DHCP clients looking for an image
to boot from a DHCP server.
The following is sample DHCPv4 configuration from the ISC DHCP Server that displays the use of
Option 77. The if condition in this sample implies that if Option 77 exists, and is equal to the string iPXE,
then advertise the Boot File URI for the image.
host Switch2 {
fixed-address 192.168.1.20 ;
hardware ethernet CC:D8:C1:85:6F:11 ;
#user-class = length of string + ASCII code for iPXE
if exists user-class and option user-class = 04:68:50:58:45 {
filename "http://192.168.1.146/test-image.bin"
}
}
• DHCPv6 Option 1—Client Identifier Option. This option is populated with the value of the ROMMON
environment variable SYSTEM_SERIAL_NUM as specified in RFC 3315. The recommended format
for the ROMMON environment variable is MAC_ADDR.
• DHCPv6 Option 15—User Class Option. This option is the IPv6 User Class option in a DHCPv6 solicit
message, and is populated with the string, iPXE. The following sample shows Option 15 defined in the
ISC DHCP server:
The following is a sample DHCP Server configuration that uses the DHCPv6 Option 15:
#Client-specific parameters
host switch1 {
#assigning a fixed IPv6 address
fixed-address6 2001:DB8::CAFE ;
#Client DUID in hexadecimal format contains: DUID-type"2" + "EN=9" + "Chassis
serial number"
host-identifier option dhcp6.client-id 00:02:00:00:00:09:46:4F:43:31:38:33:
31:58:31:41:53;
#User class 00:04:69:50:58:45 is len 4 + "iPXE"
if option dhcp6.user-class = 00:04:69:50:58:45 {
option dhcp6.bootfile-url
"http://[2001:DB8::461/platform-pxe/edi46/test-image.bin";
}
}
• DHCPv6 Option 16—Vendor Class Option. Contains the device product ID (PID). The PID can be
determined from the output of the show inventory command or from the MODEL_NUM rommon
variable. Option 16 is not a default option in the ISC DHCP Server and can be defined as follows:
The following sample configuration illustrates the use of DHCPv6 Option 16:
# Source: dhcpd6ConfigPD
host host1-ipxe6-auto-host1 {
fixed-address6 2001:DB8::1234;
host-identifier option dhcp6.client-id 00:02:00:00:00:09:46:4F:
43:31:38:33:31:58:31:41:53;
if option dhcp6.vendor-class-data = 00:00:00:09:00:0E:57:53:2D:
43:33:38:35:30:2D:32:34:50:2D:4D {
option dhcp6.bootfile-url
"http://[2001:DB8::46]/platform-pxe/host1/17jan-polaris.bin";
The table below describes the significant fields shown in the display.
Field Description
Cisco devices that support this feature use the DUID-EN (DUID Type 2) to identify the DHCP client (that is
the device in the DHCPv6 Solicit packet). Catalyst 9000 Series Switches support not only DUID-EN, but also
DUID-LL (DUID Type 3). DUID-EN is the preferred type; however, if switches are unable to create it, then
DUID-LL is constructed and used.
DETAILED STEPS
Step 3 • boot ipxe forever [switch number] Configures the BOOTMODE rommon variable.
• boot ipxe timeout seconds [switch number] • The forever keyword configures the BOOTMODE
Example: rommon variable as IPXE-FOREVER.
Device(config)# boot ipxe forever switch 2 • The timeout keyword configures the BOOTMODE
Example: rommon variable as IPXE-TIMEOUT.
Device(config)# boot ipxe timeout 30 switch 2
Step 4 boot system {switch switch-number | all} {flash: | ftp: | Boots an image from the specified location.
http: | usbflash0 | tftp:}
• You can either use an IPv4 or an IPv6 address for the
Example: remote FTP/HTTP/TFTP servers.
Device(config)# boot system switch 1
http://192.0.2.42/image-filename
• You must enter the IPv6 address inside the square
brackets (as per RFC 2732); if not the device will not
or boot.
Device(config)# boot system switch 1
http://[2001:db8::1]/image-filename
SUMMARY STEPS
1. enable
2. configure terminal
3. • no boot ipxe
• default boot ipxe
4. end
DETAILED STEPS
Step 3 • no boot ipxe Configures device boot. The default bot mode is device
• default boot ipxe boot.
Example: Enables default configuration on the device.
Device(config)# no boot ipxe
Example:
Device(config)# default boot ipxe
The following example shows how to configure the boot mode to ipxe-timeout. The configured
timeout is 200 seconds. If an iPXE boot failure occurs after the configured timeout expires, the
configured device boot is activated. In this example, the configured device boot is
http://[2001:db8::1]/image-filename.
Device# configure terminal
Device(config)# boot ipxe timeout 200 switch 2
Device(config)# boot system http://[2001:db8::1]/image-filename
Device(config)# end
Default-least-time 600;
max-lease-time-7200;
log-facility local7;
#Global configuration
#domain search list
option dhcp6.domain-search "cisco.com" ;
#User-defined options:new-name code new-code = definition ;
option dhcp6.user-class code 15 = string ;
option dhcp6.vendor-class-data code 16 = string;
subnet6 2001:db8::/64 {
#subnet range for clients requiring an address
range6 2001:db8:0000:0000::/64;
}
#Client-specific parameters
host switch1 {
#assigning a fixed IPv6 address
fixed-address6 2001:DB8::CAFE ;
#Client DUID in hexadecimal that contains: DUID-type "2" + "EN=9" + "Chassis serial
number"
host-identifier option dhcp6.client-id 00:02:00:00:00:09:46:4F:43:31:38:33:
31:58:31:41:53;
option dhcp6.bootfile-url "http://[2001:DB8::461/platform-pxe/edi46/test-image.bin";
}
For more information on DHCP server commands, see the ISC DHCP Server website.
In this sample configuration, the dhcp6.client-id option identifies the switch, and it is followed by
the Enterprise Client DUID. The client DUID can be broken down for understanding as 00:02 +
00:00:00:09 + chassis serial number in hexadecimal format, where 2 refers to the Enterprise Client
DUID Type, 9 refers to the reserved code for Cisco’s Enterprise DUID, followed by the ASCII code
for the Chassis serial number in hexadecimal format. The chassis serial number for the switch in this
sample is FOC1831X1AS.
The Boot File URI is advertised to the switch only using the specified DUID.
The DHCPv6 Vendor Class Option 16 can also be used to identify the switch on the DHCP Server.
To define Option 16 as a user-defined option, configure the following:
The following is a sample DHCP server configuration that identifies the switch based on the DHCPv6
Vendor Class Option 16 that is formed by using the switch Product ID:
# Source: dhcp6ConfigPID
host edi-46-ipxe6-auto-edi46 {
fixed-address6 2001:DB8::1234;
host-identifier option dhcp6.client-id 00:02:00:00:00:09:
46:4F:43:31:38:33:31:58:31:58:31:41:53;
if option dhcp6.vendor-class-data = 00:00:00:09:00:0E:57:
53:2D:43:33:38:35:30:2D:32:34:50:2D:4C {
option dhcp6.bootfile-url "http://[2001:DB8::461/platform-pxe/edi46/17jan-dev.bin";
}
}
In this sample configuration, the dhcp6.vendor-class-data option refers to the DHCPv6 Option 16.
In the dhcp6.vendor-class-data, 00:00:00:09 is Cisco’s Enterprise DUID, 0E is the length of the PID,
and the rest is the PID in hexadecimal format. The PID can also be found from the output of the
show inventory command or from the CFG_MODEL_NUM rommon variable. The PID used in
this sample configuration is WS-C3850-24P-L.
DHCPv6 options and DUIDs in the server configuration must be specified in the hexadecimal format,
as per the ISC DHCP server guidelines.
Note We recommend the use of ISC DHCP server. This feature has not been verified
on IOS DHCP.
• To test the HTTP server connectivity, use HTTP copy to copy a small sample file from your HTTP server
to your device. For example, at the rommon prompt, enter copy http://192.168.1.1/test null: (the flash
is normally locked and you need to use the null device for testing) or http://[2001:db8::99]/test.
• When manual boot is enabled, and boot mode is ipxe-timeout, the device will not automatically boot on
power up. Issue the boot command in rommon mode. To automate the boot process on power up, disable
manual boot.
• Use the net6-show command to display the current IPv6 parameters, including IPv6 addresses and the
default router in rommon mode
Note On Catalyst 9000 Series Switches, use the net-show show command.
• Use the net-dhcp or the net6-dhcp commands based on your configuration, The net-dhcp command is
a test command for DHCPv4 and the net6-dhcp command is for DHCPv6.
Note On Catalyst 9000 Series Switches, use the net-dhcp -6 command for DHCPv6.
Note On Catalyst 9000 Series Switches, use the dns-lookup commmand to resolve
names.
• Enable HTTP debug logs to view the HTTP response code from the web server.
• If Stateless Address Auto-Configuration (SLAAC) addresses are not generated, there is no router that is
providing IPv6 RA messages. iPXE boot for IPv6 can still work but only with link or site-local addresses.
Standard/RFC Title
RFC 3315 Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
iPXE Cisco IOS XE Denali 16.5.1a Network Bootloaders support booting from an
IPv4/IPv6 device-based or network-based
source. A network boot source must be
detected automatically by using an iPXE-like
solution.
This feature was implemented on the following
platforms:
• Catalyst 3650 Series Switches
• Catalyst 3850 Series Switches
Cisco IOS XE Denali 16.6.1 In Cisco IOS XE Denali 16.6.1, this feature
was implemented on the following platforms:
• Catalyst 9300 Series Switches
• Catalyst 9500 Series Switches
Cisco IOS XE Everest 16.6.2 In Cisco IOS XE Everest 16.6.2, this feature
was implemented on Cisco Catalyst 9400
Series Switches.
Cisco IOS XE Fuji 16.9.2 In Cisco IOS XE Fuji 16.9.2, this feature was
implemented on the following platforms.
• Cisco Catalyst 9200 Series Switches
• Cisco Catalyst 9300L SKUs
Cisco IOS XE Gibraltar 16.11.1 In Cisco IOS XE Gibraltar 16.11.1, this feature
was implemented on Cisco Catalyst 9600
Series Switches.
IPXE IPv6 Support Cisco IOS XE 16.8.1a IPXE supports the IPv6 protocol.
This feature was implemented on the following
platforms:
• Catalyst 9300 Series Switches
• Catalyst 9400 Series Switches
• Catalyst 9500 Series Switches
Guest Shell Lite (Limited LXC Container) Guest Shell (LXC Container)
Supported Rootfs Busybox, SSH, and Python PIP install SSH, Yum install, and Python PIP
install
CSR 1000v 4 GB
Cisco ISRv 4 GB
All other platforms ship from the factory with sufficient resources to support Guest Shell.
Note Virtual-service installed applications and Guest Shell container cannot co-exist.
Note A Guest Shell installed via bootflash does not allow you to do resource resizing using application hosting
configuration commands.)
During Guest Shell installation, if enough hard disk space is not available, an error message is displayed.
The following is a sample error message on an ISR 4000 Series router:
Bootflash or hard disk space can be used to store additional data by Guest Shell. On Cisco Catalyst 3850
Series Switches, Guest Shell has 18 MB of storage space available and on Cisco 4000 Series Integrated
Services Routers, Guest Shell has 800 MB of storage space available. Because Guest Shell accesses the
bootflash, it can use the entire space available.
CPU 1% 1/100%
Note 1% is not standard; 800
CPU units/ total system
CPU units.
Note IOx must be configured before the guestshell enable command is used.
The guestshell run bash command opens the Guest Shell bash prompt. Guest Shell must already be enabled
for this command to work.
Note If the following message is displayed on the console, it means that IOx is not enabled; check the output of
the show iox-service command to view the status of IOx.
For more information on how to enable Guest Shell, see the "Configuring the AppGigabitEthernet Interface
for Guest Shell" and "Enabling Guest Shell on the Management Interface" sections.
executed through the Guest Shell are executed with the same privilege that a user has when logged into the
IOS terminal.
At the Guest Shell prompt, you can execute standard Linux commands.
Note For platforms without a management port, a VirtualPortGroup can be associated with Guest Shell in the IOS
configuration. For more information, see the Sample VirtualPortGroup Configuration section.
Day Zero Guest Shell Provisioning Using Front-Panel Port or Fiber Uplink
On Day Zero, when the device has no management connectivity, and the only connectivity is either through
the front-panel port or fibre uplink port, Guest Shell is internally configured to use the available port. The
AppGigEthernet interface connects Guest Shell to the server.
When Guest Shell is connected to the server, the device downloads the configuration script, and configures
the device. This configuration also include downloading, setting, and starting of the virtual machine (VM).
After the day zero configuration is complete, based on your configuration the system may reboot. Ensure that
the system boots with only the user-specific configuration.
applications and data. IOx services also include application distribution and management tools that help users
discover and deploy applications to the IOx framework.
Cisco IOx application hosting provides the following features:
• Hides network heterogeneity.
• Cisco IOx application programming interfaces (APIs) remotely manage the life cycle of applications
hosted on a device.
• Centralized application life cycle management.
• Cloud-based developer experience.
IOXMAN Structure
Each guest application, a system LXC or a KVM instance is configured with its own syslogd and logfiles
stored within a visible file system and are not accessible to the host device. To support logging data to IOS
syslog and tracing data to IOx tracelog on the host, two serial devices, /dev/ttyS2 and /dev/ttyS3, are designated
on the guest application for delivering data to the host as shown in the following figure.
IOXMAN is a process to establish the tracing infrastructure to provide logging or tracing services for guest
application, except Libvert that emulates serial devices. IOXMAN is based on the lifecycle of the guest
application to enable and disable tracing service, to send logging data to IOS syslog, to save tracing data to
IOx tracelog, and to maintain IOx tracelog for each guest application.
LXC Logging
1. Guest OS enables /dev/ttyS2 on Guest application.
2. Guest application writes data to /dev/ttyS2.
3. Libvert emulates /dev/ttyS2 to /dev/pts/x on the host.
4. IOXMAN gets the emulated serial device, /dev/pts/x from the XML file.
5. IOXMAN listens and reads available data from /dev/pts/x, sets the severity for the message, filters, parses
and queues the message.
6. Start timer to send the message to /dev/log device on the host using errmsg.
7. Data is saved to IOS syslog.
KVM Logging
1. Guest OS enables /dev/ttyS2 on Guest application.
2. Guest application writes data to /dev/ttyS2.
3. Libvert emulates /dev/ttyS2 to /dev/pts/x on the host.
4. IOXMAN gets the emulated TCP path from the XML file.
5. IOXMAN opens an unix socket, and connects to the remote socket.
6. IOXMAN reads available data from the socket, sets the severity for the message, filters, parses, and queues
the message.
7. Start timer to send the message to /dev/log device on the host using errmsg.
8. Data is saved to IOS syslog.
LXC Tracing
1. Guest OS enables /dev/ttyS3 on Guest application.
2. Configures syslogd to copy message to /dev/ttyS3.
3. Guest application writes data to /dev/ttyS3.
4. Libvert emulates /dev/ttyS3 to /dev/pts/y on the host.
5. IOXMAN gets the emulated serial device, /dev/pts/y from the XML file.
6. IOXMAN listens and reads available data from /dev/pts/y, filters, parses, and saves the message to IOx
tracelog.
7. If IOx tracelog is full, IOXMAN rotates the tracelog file to /bootflash/tracelogs.
KVM Tracing
1. Guest OS enables /dev/ttyS3 on Guest application.
2. Configures syslogd to copy message to /dev/ttyS3.
3. Guest application writes data to /dev/ttyS3.
4. Libvert emulates /dev/ttyS3 to TCP path on the host.
5. IOXMAN gets the emulated TCP path from the XML file.
6. IOXMAN opens an unix socket, and connects to the remote socket.
7. IOXMAN reads available data from the scoket, sets the severity for the message, filters, parses, and saves
the message to IOx tracelog.
8. If IOx tracelog is full, IOXMAN rotates the tracelog file to /bootflash/tracelogs.
Perform the following steps to report logging data from Guest Application to IOS syslog:
1. If you are using C programming, use write() to send logging data to host.
#define SYSLOG_TEST “syslog test”
int fd;
fd = open("/dev/ttyS2", O_WRONLY);
write(fd, SYSLOG_TEST, strlen(SYSLOG_TEST));
close(fd);
2. If you are using Shell console, use echo to send logging data to host.
echo “syslog test” > /dev/ttyS2
2. If you are using C programming, use syslog() to send tracing message to host.
#define SYSLOG_TEST “tracelog test”
3. If you are using Shell console, use echo to send tracing data to host.
echo “tracelog test” > /dev/ttyS3
or
logger “tracelog test”
SUMMARY STEPS
1. enable
2. configure terminal
3. iox
4. exit
5. show iox-service
6. show app-hosting list
DETAILED STEPS
Step 6 show app-hosting list Displays the list of app-hosting services enabled on the
device.
Example:
Device# show app-hosting list
What to do next
The following is sample output from the show iox-service command on an ISR 4000 Series Router:
Device# show iox-service
The following is truncated sample output from the show iox-service command:
The following is sample output from the show app-hosting list command:
App id State
------------------------------------------------------
guestshell RUNNING
SUMMARY STEPS
1. enable
2. guestshell enable
3. guestshell run linux-executable
4. guestshell run bash
5. guestshell disable
6. guestshell destroy
DETAILED STEPS
Step 3 guestshell run linux-executable Executes or runs a Linux program in the Guest Shell.
Example: Note In Cisco IOS XE Amsterdam 17.3.1 and later
Device# guestshell run python releases, only Python version 3 is supported.
or
Device# guestshell run python3
Step 4 guestshell run bash Starts a Bash shell to access the Guest Shell.
Example:
Device# guestshell run bash
Step 6 guestshell destroy Deactivates and uninstalls the Guest Shell service.
Example:
Device# guestshell destroy
Note This section is applicable to Cisco routing platforms. VirtualPortGroups are not supported on Cisco Catalyst
Switching platforms.
IOx must be configured and running for Guest Shell access to work. If IOx is not configured, a message to
configure IOx is displayed. Removing IOx removes access to the Guest Shell, but the rootfs remains unaffected.
Note Use this procedure (Managing the Guest Shell Using Application Hosting) to enable the Guest Shell in Cisco
IOS XE Fuji 16.7.1 and later releases. For Cisco IOS XE Everest 16.6.x and previous releases, use the procedure
in Managing the Guest Shell, on page 78.
For front panel networking, you must configure the GigabitEthernet and VirtualPortGroup interfaces as shown
above. The Guest Shell uses a Virtualportgroup as the source interface to connect to the outside network
through NAT.
The following commands are used to configure inside NAT. They allow the Guest Shell to reach the internet;
for example, to obtain Linux software updates:
ip nat inside source list
ip access-list standard
permit
The guestshell run command in the example above, runs a python executable. You can also use the guestshell
run command to run other Linux executables; for example, see the example guestshell run bash command,
which starts a Bash shell or the guestshell disable command which shuts down and disables the Guest Shell.
If the system is later reloaded, the Guest Shell remains disabled.
Note In releases prior to Cisco IOS XE Amsterdam 17.3.1, Python V2 is the default. Python V3 is supported in
Cisco IOS XE Amsterdam 17.1.1, and Cisco IOS XE Amsterdam 17.2.1. In Cisco IOS XE Amsterdam 17.3.1
and later releases, Python V3 is the default.
The following example shows how to enable Python on a Cisco Catalyst 3650 Series Switch or a Cisco Catalyst
3850 Series Switch:
The following example shows how to enable Python on a Cisco ISR 4000 Series Integrated Services Router:
Device> enable
Device# guestshell enable
[guestshell@guestshell ~]$
When using the VirtualPortGroup interface for Guest Shell networking, the VirtualPortGroup interface
must have a static IP address configured. The front port interface must be connected to the Internet
and Network Address Translation (NAT) must be configured between the VirtualPortGroup and the
front panel port.
Device> enable
Device# configure terminal
Device(config)# interface VirtualPortGroup 0
Device(config-if)# ip address 192.168.35.1 255.255.255.0
Device(config-if)# ip nat inside
Device(config-if)# no mop enabled
Device(config-if)# no mop sysid
Device(config-if)# exit
Device(config)# interface GigabitEthernet 0/0/3
Device(config-if)# ip address 10.0.12.19 255.255.0.0
Device(config-if)# ip nat outside
Device(config-if)# negotiation auto
Device(config-if)# exit
Device(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.1
Device(config)# ip route 10.0.0.0 255.0.0.0 10.0.0.1
!Port forwarding to use ports for SSH and so on.
Device(config)# ip nat inside source static tcp 192.168.35.2 7023 10.0.12.19 7023 extendable
Device(config)# ip nat outside source list NAT_ACL interface GigabitEthernet 0/0/3 overload
Device(config)# ip access-list standard NAT_ACL
Device(config-std-nacl)# permit 192.168.0.0 0.0.255.255
Device(config-std-nacl)# exit
! App-hosting configuration
Device(config)# app-hosting appid guestshell
Device(config-app-hosting)# app-vnic gateway1 virtualportgroup 0 guest-interface 0
guest-ipaddress 192.168.35.2
netmask 255.255.255.0 gateway 192.168.35.1 name-server 8.8.8.8 default
Device(config-app-hosting)# app-resource profile custom cpu 1500 memory 512
Device(config-app-hosting)# end
From the Guest Shell prompt, you can run Linux commands. The following example shows the usage
of some Linux commands.
[guestshell@guestshell~]$ pwd
/home/guestshell
[guestshell@guestshell~]$ whoami
guestshell
[guestshell@guestshell~]$ uname -a
Linux guestshell 3.10.101.cge-rt110 #1 SMP Sat Feb 11 00:33:02
PST 2017 mips64 GNU/Linux
Catalyst 3650 and Catalyst 3850 Series Switches have a defined set of Linux executables that are
provided by BusyBox and Cisco 4000 Series Integrated Services Routers have commands provided
by CentOS Linux release 7.1.1503.
The following example shows the usage of the dohost command on a Catalyst 3850 Series Switch.
Note The dohost command requires the ip http server command to be configured on the device.
Other Options:
[guestshell@guestshell ~]$ cat/etc/resolv.conf
domain cisco.com
search cisco.com
nameserver 192.0.2.1
search cisco.com
nameserver 198.51.100.1
nameserver 172.16.0.6
domain cisco.com
nameserver 192.0.2.1
nameserver 172.16.0.6
nameserver 192.168.255.254
If your network is behind a proxy, configure proxy variables in Linux. If required, add these variables
to your environment.
The following example shows how to use Yum for setting proxy environment variables:
PIP install picks up environment variable used for proxy settings. Use sudo with -E option for PIP
installation. If the environment variables are not set, define them explicitly in PIP commands as
shown in following example:
The following example shows how to use PIP install for Python:
MIBs
MB
I MIBs Link
To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco
MIB Locator found at the following URL:
http://www.cisco.com/go/mibs
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
Guest Shell Cisco IOS XE Everest 16.5.1a Guest Shell is a secure container
that is an embedded Linux
Cisco IOS XE Everest 16.5.1b
environment that allows customers
to develop and run Linux and
custom Python applications for
automated control and management
of Cisco switches. It also includes
the automated provisioning of
systems. This container shell
provides a secure environment,
decoupled from the host device, in
which users can install scripts or
software packages and run them.
In Cisco IOS XE Everest 16.5.1a,
this feature was implemented on
the following platforms:
• Cisco Catalyst 3650 Series
Switches
• Cisco Catalyst 3850 Series
Switches
• Cisco Catalyst 9300 Series
Switches
• Cisco Catalyst 9500 Series
Switches
Using Python
Cisco Python Module
Cisco provides a Python module that provides access to run EXEC and configuration commands. You can
display the details of the Cisco Python module by entering the help() command. The help() command displays
the properties of the Cisco CLI module.
The following example displays information about the Cisco Python module:
configure(configuration)
Apply a configuration (set of Cisco IOS CLI config-mode commands) to the device
and return a list of results.
Args:
configuration (str or iterable): Configuration commands, separated by newlines.
Returns:
list(ConfigResult): A list of results, one for each line.
Raises:
CLISyntaxError: If there is a syntax error in the configuration.
>>> help(configurep)
Help on function configurep in module cli:
configurep(configuration)
Apply a configuration (set of Cisco IOS CLI config-mode commands) to the device
and prints the result.
Args:
configuration (str or iterable): Configuration commands, separated by newlines.
>>> help(execute)
Help on function execute in module cli:
execute(command)
Execute Cisco IOS CLI exec-mode command and return the result.
Args:
command (str): The exec-mode command to run.
Returns:
str: The output of the command.
Raises:
CLISyntaxError: If there is a syntax error in the command.
>>> help(executep)
Help on function executep in module cli:
executep(command)
Execute Cisco IOS CLI exec-mode command and print the result.
executep("show version")
Args:
command (str): The exec-mode command to run.
>>> help(cli)
Help on function cli in module cli:
cli(command)
Execute Cisco IOS CLI command(s) and return the result.
Args:
command (str): The exec or config CLI command(s) to be run.
Returns:
string: CLI output for show commands and an empty string for
configuration commands.
Raises:
errors.cli_syntax_error: if the command is not valid.
errors.cli_exec_error: if the execution of command is not successful.
>>> help(clip)
Help on function clip in module cli:
clip(command)
Execute Cisco IOS CLI command(s) and print the result.
clip("show version")
clip("show version ; show ip interface brief")
clip("configure terminal ; interface gigabitEthernet 0/0 ; no shutdown")
Args:
command (str): The exec or config CLI command(s) to be run.
Note Guest Shell must be enabled for Python to run. For more information, see the Guest Shell chapter.
The Python programming language uses six functions that can execute CLI commands. These functions are
available from the Python CLI module. To use these functions, execute the import cli command. The ip http
server command must be enabled for these functions to work.
Arguments for these functions are strings of CLI commands. To execute a CLI command through the Python
interpreter, enter the CLI command as an argument string of one of the following six functions:
• cli.cli(command)—This function takes an IOS command as an argument, runs the command through
the IOS parser, and returns the resulting text. If this command is malformed, a Python exception is raised.
The following is sample output from the cli.cli(command) function:
>>>import cli
>>>cli.clip('configure terminal; interface loopback 10; ip address
10.10.10.10 255.255.255.255')
*Mar 13 18:39:48.518: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback10, changed
state to up
>>> cli.clip('show clock')
'\n*18:11:53.989 UTC Mon Mar 13 2017\n'
>>> output=cli.cli('show clock')
>>> print(output)
• cli.clip(command)—This function works exactly the same as the cli.cli(command) function, except
that it prints the resulting text to stdout rather than returning it. The following is sample output from the
cli.clip(command) function:
>>>cli
>>>cli.clip('configure terminal; interface loopback 11; ip address
10.11.11.11 255.255.255.255')
*Mar 13 18:42:35.954: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback11, changed
state to up
*Mar 13 18:42:35.954: %LINK-3-UPDOWN: Interface Loopback11, changed state to up
>>> cli.clip('show clock')
*18:13:35.313 UTC Mon Mar 13 2017
>>> output=cli.clip('show clock')
*18:19:26.824 UTC Mon Mar 13 2017
>>> print (output)
None
• cli.execute(command)—This function executes a single EXEC command and returns the output; however,
does not print the resulting text No semicolons or newlines are allowed as part of this command. Use a
Python list with a for-loop to execute this function more than once. The following is sample output from
the cli.execute(command)
function:
• cli.executep(command)—This function executes a single command and prints the resulting text to stdout
rather than returning it. The following is sample output from the cli.executep(command) function:
The command parameters can be in multiple lines and in the same format that is displayed in the output
of the show running-config command. The following is sample output from the cli.configure(command)
function:
Device#
Python Script
Python scripts can run in non-interactive mode by providing the Python script name as an argument in the
Python command. Python scripts must be accessible from within the Guest Shell. To access Python scripts
from the Guest Shell, save the scripts in bootflash/flash that is mounted within the Guest Shell.
Note The ip http server command must be configured for the import cli in Python to work.
The following sample Python script uses different CLI functions to configure and print show commands:
Device# more flash:sample_script.py
import sys
import cli
intf= sys.argv[1:]
intf = ''.join(intf[0])
print "\n\n *** Configuring interface %s with 'configurep' function *** \n\n" %intf
cli.configurep(["interface loopback55","ip address 10.55.55.55 255.255.255.0","no
shut","end"])
print "\n\n *** Configuring interface %s with 'configure' function *** \n\n"
cmd='interface %s,logging event link-status ,end' % intf
cli.configure(cmd.split(','))
print "\n\n *** Printing show cmd with 'executep' function *** \n\n"
cli.executep('show ip interface brief')
print "\n\n *** Printing show cmd with 'execute' function *** \n\n"
output= cli.execute('show run interface %s' %intf)
print (output)
print "\n\n *** Configuring interface %s with 'cli' function *** \n\n"
cli.cli('config terminal; interface %s; spanning-tree portfast edge default' %intf)
print "\n\n *** Printing show cmd with 'clip' function *** \n\n"
cli.clip('show run interface %s' %intf)
To run a Python script from the Guest Shell, execute the guestshell run python
/flash/script.py command
at the device prompt.
The following example shows how to run a Python script from the Guest Shell:
The following example shows how to run a Python script from the Guest Shell:
Building configuration...
Current configuration : 93 bytes
!
interface Loopback55
ip address 10.55.55.55 255.255.255.0
logging event link-status
end
Building configuration...
Current configuration : 93 bytes
!
interface Loopback55
ip address 10.55.55.55 255.255.255.0
logging event link-status
end
Python Version 2.7.5 All supported platforms except for Cisco Catalyst
3650 Series Switches and Cisco Catalyst 3850 Series
Switches.
Platforms with CentOS 7 support the installation of Redhat Package Manager (RPM) from the open source
repository.
Note When you update to Python Version 3 on a device that already has Python Version 2, both versions of Python
exist on the device. Use one of the following IOS commands to run Python:
• The guestshell run python2 command enables Python Version 2.
• The guestshell run python3 command enables Python Version 3.
• The guestshell run python command enables Python Version 2.
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
CLI Python Module Cisco IOS XE Everest Python programmabilty provides a Python
16.5.1a module that allows users to interact with IOS
using CLIs.
In Cisco IOS XE Everest 16.5.1a, this feature
was implemented on the following platforms:
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9500 Series Switches
Note The EEM Python package is available only within the EEM Python script (The package can be registered
with EEM, and has the EEM event specification in the first line of the script.) and not in the standard Python
script (which is run using the Python script name).
The Python package includes the following application programming interfaces (APIs):
• Action APIs—Perform EEM actions and have default parameters.
• CLI-execution APIs—Run IOS commands, and return the output. The following are the list of
CLI-execution APIs:
• eem_cli_open()
• eem_cli_exec()
• eem_cli_read()
• eem_cli_read_line()
• eem_cli_run()
• eem_cli_run_interactive()
• eem_cli_read_pattern()
• eem_cli_write()
• eem_cli_close()
• Environment variables-accessing APIs—Get the list of built-in or user-defined variables. The following
are the environment variables-accessing APIs:
• eem_event_reqinfo ()-Returns the built-in variables list.
• eem_user_variables()-Returns the current value of an argument.
The EEM Python package exposes the interfaces for executing EEM actions. You can use the Python script
to call these actions, and they are forwarded from the Python package via Cisco Plug N Play (PnP) to the
action handler.
EEM Variables
An EEM policy can have the following types of variables:
• Event-specific built-in variables—A set of predefinied variables that are populated with details about
the event that triggered the policy. The eem_event_reqinfo () API returns the builtin variables list. These
variables can be stored in the local machine and used as local variables. Changes to local variables do
not reflect in builtin variables.
• User-defined variables—Variables that can be defined and used in policies. The value of these variables
can be referred in the Python script. While executing the script, ensure that the latest value of the variable
is available. The eem_user_variables() API returns the current value of the argument that is provided in
the API.
DETAILED STEPS
Step 3 event manager directory user policy path Specifies a directory to use for storing user library files or
user-defined EEM policies.
Example:
Device(config)# event manager directory user policy Note You must have a policy in the specified path.
flash:/user_library For example, in this step, the eem_script.py
policy is available in the flash:/user_library
folder or path.
Step 6 show event manager policy registered Displays the registered EEM policies.
Example:
Device# show event manager policy registered
Step 7 show event manager history events Displays EEM events that have been triggered.
Example:
Device# show event manager history events
Example
The following is sample output from the show event manager policy registered command:
Device# show event manager policy registered
not available in the standard Python script. The standard Python script in IOS has a package named
from cli import cli,clip and this package can be used to execute IOS commands.
import sys
from cli import cli,clip,execute,executep,configure,configurep
intf= sys.argv[1:]
intf = ''.join(intf[0])
print ('This script is going to unshut interface %s and then print show ip interface
brief'%intf)
if intf == 'loopback55':
configurep(["interface loopback55","no shutdown","end"])
else :
cmd='int %s,no shut ,end' % intf
configurep(cmd.split(','))
This following is sample output from the guestshell run python command.
Device# guestshell run python /flash/eem_script.py loop55
This script is going to unshut interface loop55 and then print show ip interface brief
Line 1 SUCCESS: int loop55
Line 2 SUCCESS: no shut
Line 3 SUCCESS: end
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES NVRAM administratively down down
GigabitEthernet0/0 5.30.15.37 YES NVRAM up up
GigabitEthernet1/0/1 unassigned YES unset down down
GigabitEthernet1/0/2 unassigned YES unset down down
GigabitEthernet1/0/3 unassigned YES unset down down
GigabitEthernet1/0/4 unassigned YES unset up up
GigabitEthernet1/0/5 unassigned YES unset down down
GigabitEthernet1/0/6 unassigned YES unset down down
GigabitEthernet1/0/7 unassigned YES unset down down
GigabitEthernet1/0/8 unassigned YES unset down down
GigabitEthernet1/0/9 unassigned YES unset down down
GigabitEthernet1/0/10 unassigned YES unset down down
GigabitEthernet1/0/11 unassigned YES unset down down
GigabitEthernet1/0/12 unassigned YES unset down down
GigabitEthernet1/0/13 unassigned YES unset down down
GigabitEthernet1/0/14 unassigned YES unset down down
GigabitEthernet1/0/15 unassigned YES unset down down
GigabitEthernet1/0/16 unassigned YES unset down down
GigabitEthernet1/0/17 unassigned YES unset down down
GigabitEthernet1/0/18 unassigned YES unset down down
GigabitEthernet1/0/19 unassigned YES unset down down
GigabitEthernet1/0/20 unassigned YES unset down down
GigabitEthernet1/0/21 unassigned YES unset down down
GigabitEthernet1/0/22 unassigned YES unset down down
GigabitEthernet1/0/23 unassigned YES unset up up
GigabitEthernet1/0/24 unassigned YES unset down down
GigabitEthernet1/1/1 unassigned YES unset down down
GigabitEthernet1/1/2 unassigned YES unset down down
GigabitEthernet1/1/3 unassigned YES unset down down
GigabitEthernet1/1/4 unassigned YES unset down down
Te1/1/1 unassigned YES unset down down
Te1/1/2 unassigned YES unset down down
Te1/1/3 unassigned YES unset down down
Device#
Jun 7 12:51:20.549: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback55,
changed state to up
Jun 7 12:51:20.549: %LINK-3-UPDOWN: Interface Loopback55, changed state to up
The following is a sample script for printing messages to the syslog. This script must be stored in a
file, copied to the file system on the device, and registered using the event manager policy file.
import eem
import time
The following is sample script to print EEM environment variables. This script must be stored in a
file, copied to the file system on the device, and registered using the event manager policy file.
import eem
import time
c = eem.env_reqinfo()
DETAILED STEPS
Step 3 event manager applet applet-name Registers an applet with the Embedded Event Manager
(EEM) and enters applet configuration mode.
Example:
Device(config)# event manager applet
interface_Shutdown
Step 4 event [tag event-tag] syslog pattern regular-expression Specifies a regular expression to perform the syslog message
pattern match.
Example:
Device(config-applet)# event syslog pattern
"Interface Loopback55,
changed state to administratively down"
Step 5 action label cli command cli-string Specifies the IOS command to be executed when an EEM
applet is triggered.
Example:
Device(config-applet)# action 0.0 cli command "en"
Step 6 action label cli command cli-string [ pattern pattern-string Specifies the action to be specified with the pattern
] keyword.
Example: • Specify a regular expression pattern string that will
Device(config-applet)# action 1.0 cli command match the next solicited prompt.
"guestshell run python3 /bootflash/eem_script.py
loop55"
Step 8 show event manager policy active Displays EEM policies that are executing.
Example:
Device# show event manager policy active
Step 9 show event manager history events Displays the EEM events that have been triggered.
Example:
Device# show event manager history events
What to do next
The following example shows how to trigger the Python script configured in the task:
Device(config)# interface loopback 55
Device(config-if)# shutdown
Device(config-if)# end
Device#
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
EEM Python Module Cisco IOS XE Everest This feature supports Python scripts as EEM
16.5.1a policies.
Cisco IOS XE Everest No new commands were introduced.
16.5.1b
In Cisco IOS XE Everest 16.5.1a, this feature
was implemented on the following platforms:
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
•
In Cisco IOS XE Everest 16.5.1b, this feature
was implemented on the following platforms:
• Cisco ISR 4000 Series Integrated Service
Routers
Cisco IOS XE Everest 16.6.2 In Cisco IOS XE Everest 16.6.2, this feature
was implemented on Cisco Catalyst 9400
Series Switches.
Cisco IOS XE Fuji 16.8.1a In Cisco IOS XE Fuji 16.8.1a, this feature was
implemented on Cisco Catalyst 9500-High
Performance Series Switches
Note To access Cisco YANG models in a developer-friendly way, clone the GitHub repository, and navigate to
the vendor/cisco subdirectory. Models for various releases of IOS-XE, IOS-XR, and NX-OS platforms are
available here.
NETCONF
NETCONF provides a 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 Remote Procedure Call (RPC) based mechanism to facilitate communication between
a client and a server. The client can be a script or application 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. It uses SSH port number 830 as the default port. The port number is a configurable option.
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 on NETCONF, see RFC 6241.
In releases prior to Cisco IOS XE Fuji 16.8.1, an operational data manager (based on polling) was enabled
separately. In Cisco IOS XE Fuji 16.8.1 and later releases, operational data works on platforms running
NETCONF (similar to how configuration data works), and is enabled by default. For more information on
the components that are enabled for operational data queries or streaming, see the GitHub respository, to view
*-oper in the naming convention.
the owner to make changes without interaction with other NETCONF clients, non-NETCONF clients (such
as, SNMP and CLI scripts), and human users.
A global lock held by an active session is revoked when the associated session is killed. The lock gives the
session holding the lock exclusive write access to the configuration. When a configuration change is denied
due to a global lock, the error message will specify that a NETCONF global lock is the reason the configuration
change has been denied.
The <lock> operation takes a mandatory parameter, <target> that is the name of the configuration datastore
that is to be locked. When a lock is active, the <edit-config> and <copy-config> operations are not allowed.
If the clear configuration lock command is specified while a NETCONF global lock is being held, a full
synchronization of the configuration is scheduled and a warning syslog message is produced. This command
clears only the parser configuration lock.
The following is a sample RPC that shows the <lock> operation:
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<lock>
<target>
<running/>
</target>
</lock>
</rpc>
NACM is a group-based access control mechanism. When users are authenticated, they are automatically
placed in an NACM privilege group based on their configured privilege level. Users can also be manually
placed in other user-defined groups. The default privilege level is 1. There are 16 privilege levels, PRIV00
to PRIV15.
If a user authenticates via the public-key; but does not have a corresponding Authentication, Authorization,
and Accounting (AAA) configuration, this user is rejected. If a user authenticates via a public-key; but the
AAA configuration for NETCONF is using a AAA source other than the local, this user is also rejected. Local
and TACACS+ AAA authorization are supported.
Token-based RESTCONF authentication is not supported. SSH user certificates are not supported.
Note It must be kept in mind that candidate datastore is a shared data store. Multiple NETCONF sessions can
modify it contents simultaneously. Therefore, it is important to lock the datastore before modifying its contents,
to prevent conflicting commits which can eventually lead to losing any configuration changes.
Note The information in this section has been referenced from section 8.3.4 of RFC6241. Please refer to the RFC
for more details and the exact RPCs.
Lock
A <lock> RPC is used to lock the target data store. This prevents others users from modifying the configuration
in the locked data store. Both candidate and running data can be locked through the lock operation.
Note Locking the candidate datastore does not affect Cisco IOS config lock or running config lock and vice versa.
Commit
A <commit> RPC, copies the candidate configuration to the device’s running configuration. A commit operation
must be performed after you have updated the candidate configuration to push the configuration to the device.
If either the Running or the Candidate datastore is locked by another NETCONF session, the <commit> RPC
will fail with an RPC Error Reply. The <error-tag> should be <in-use> and <error-info> should have the
session ID of the NETCONF session holding the lock. You can also lock the running config by using the
Global lock by entering the conf t lock mode, but, the commit operation will fail with an RPC Error Reply,
with error-tag value <in-use> and the session-id will be “0”.
Edit-config
Candidate configuration can be used as a target for edit-config operation to modify a configuration. This
provides you the ability to stage configuration changes in candidate without affecting the running configuration
on the device.
Discard
To remove the changes made to candidate configuration, perform a discard operation to revert the candidate
configuration to running configuration.
If the contents of candidate datastore have already been modified by NETCONF session A, and session B
tries to lock the Candidate, the lock will fail. NETCONF session B must perform a <discard> operation to
remove any outstanding configurations on candidate from other NETCONF sessions before locking a candidate.
Unlock
After working on candidate configuration, such as, lock, edit-config, or commit operations, you can unlock
the data store, by specifying candidate as target in the Unlock RPC. Candidate is now available for all operations
in other sessions.
If failure occurs with outstanding changes to candidate datastore, it can be challenging to recover the
configuration and creates problems for other sessions. To avoid any issues, outstanding changes are discarded
in candidate when the lock is released—either implicitly on “NETCONF session failure” or explicitly on
Unlock operation.
If the selection of candidate or running is made after NETCONF-YANG or RESTCONF confd process starts,
the following apply:
• If the netconf-yang feature candidate-datastore command is configured, the command enables the
candidate datastore and prints the following warning:
“netconf-yang and/or restconf is transitioning from running to candidate netconf-yang
and/or restconf will now be restarted,
and any sessions in progress will be terminated”.
• If the netconf-yang feature candidate-datastore command is removed, the command disables the
candidate datastore, enables the running datastore and prints the following warning:
netconf-yang and/or restconf is transitioning from candidate to running netconf-yang
and/or restconf will now be restarted,
and any sessions in progress will be terminated”.
Note Candidate data store is a shared data store, that is, multiple NETCONF sessions can modify the contents
simultaneously. Therefore, it is important for a user to lock the data store before modifying its contents, to
prevent conflicting commits which can eventually lead to losing any configuration changes; wherein another
user overwrites the configuration by modifying the configuration and issuing a commit.
SUMMARY STEPS
1. enable
2. configure terminal
3. username name privilege level password password
4. aaa new-model
5. aaa authentication login default local
6. aaa authorization exec default local
7. end
DETAILED STEPS
Step 3 username name privilege level password password Establishes a user name-based authentication system.
Configure the following keywords:
Example:
Device(config)# username example-name privilege 15 • privilege level: Sets the privilege level for the user.
password example_password For the NETCONF protocol, it must be 15.
• password password: Sets a password to access the
CLI view.
Step 5 aaa authentication login default local Sets the login authentication to use the local username
database.
Example:
Device(config)# aaa authentication login default Note Only the default AAA authentication login
local method is supported for the NETCONF protocol.
Step 6 aaa authorization exec default local Configures user AAA authorization, check the local
database, and allows the user to run an EXEC shell.
Example:
Device(config)# aaa authorization exec default • For a remote AAA server, replace local with your
local AAA server.
• The default keyword applies the local user database
authentication to all ports.
Configuring NETCONF-YANG
If the legacy NETCONF protocol is enabled on your device, the RFC-compliant NETCONF protocol does
not work. Disable the legacy NETCONF protocol by using the no netconf legacy command.
SUMMARY STEPS
1. enable
2. configure terminal
3. netconf-yang
4. netconf-yang feature candidate-datastore
5. exit
DETAILED STEPS
SUMMARY 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
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>
SUMMARY STEPS
1. enable
2. configure terminal
3. ip ssh pubkey-chain
4. username username
5. key-string
6. end
DETAILED STEPS
Step 3 ip ssh pubkey-chain Configures SSH-RSA keys for user and server
authentication on the SSH server and enters public-key
Example:
configuration mode.
Device(config)# ip ssh pubkey-chain
• The user authentication is successful if the RSA public
key stored on the server is verified with the public or
the private key pair stored on the client.
Step 4 username username Configures the SSH username and enters public-key user
configuration mode.
Example:
Device(conf-ssh-pubkey)# username user1
Step 5 key-string Specifies the RSA public key of the remote peer and enters
public-key data configuration mode.
Example:
Device(conf-ssh-pubkey-user)# key-string Note You can obtain the public key value from an
open SSH client; that is, from the .ssh/id_rsa.pub
file.
SUMMARY STEPS
1. show netconf-yang datastores
2. show netconf-yang sessions
3. show netconf-yang sessions detail
4. show netconf-yang statistics
5. show platform software yang-management process
DETAILED STEPS
Example:
Device# show netconf-yang sessions detail
Number of sessions : 1
session-id : 19
transport : netconf-ssh
username : admin
source-host : 2001:db8::1
login-time : 2018-10-26T12:37:22+00:00
in-rpcs : 0
in-bad-rpcs : 0
out-rpc-errors : 0
out-notifications : 0
global-lock : None
netconf-start-time : 2018-01-15T12:51:14-05:00
in-rpcs : 0
in-bad-rpcs : 0
out-rpc-errors : 0
out-notifications : 0
in-sessions : 10
dropped-sessions : 0
in-bad-hellos : 0
confd : Running
nesd : Running
syncfd : Running
ncsshd : Running
dmiauthd : Running
vtyserverutild : Running
opdatamgrd : Running
nginx : Running
ndbmand : Running
Note The process nginx runs if ip http secure-server or ip http server is configured on the device. This process is
not required to be in the running state for NETCONF to function properly. However, the nginx process is
required for RESTCONF.
Field Description
Standard/RFC Title
RFC 6020 YANG - A Data Modeling Language for the Network Configuration
Protocol (NETCONF)
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, http://www.cisco.com/support
including documentation and tools for troubleshooting and resolving
technical issues with Cisco products and technologies.
To receive security and technical information about your products,
you can subscribe to various services, such as the Product Alert Tool
(accessed from Field Notices), the Cisco Technical Services
Newsletter, and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a
Cisco.com user ID and password.
NETCONF Protocol Cisco IOS XE Denali 16.3.1 The NETCONF Protocol feature facilitates a
programmatic and standards-based way of
writing configurations and reading operational
data from network devices.
The following command was introduced:
netconf-yang.
This feature was implemented on the
following platforms:
• Cisco 4000 Series Integrated Services
Routers
• Cisco ASR 1000 Series Aggregation
Services Routers
• Cisco Cloud Services Router 1000V
Series
NETCONF and RESTCONF Cisco IOS XE Fuji 16.8.1a IPv6 support for the NETCONF and
IPv6 Support RESTCONF protocols. This feature was
implemented on the following platforms:
• Cisco 4000 Series Integrated Services
Routers
• Cisco ASR 1000 Series Aggregation
Services Routers
• Cisco ASR 900 Series Aggregation
Services Routers
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
• Cisco CBR-8 Series Routers
• Cisco Cloud Services Router 1000V
Series
NETCONF Global Lock and Cisco IOS XE Fuji 16.8.1a The NETCONF protocol supports a global
Kill Session lock, and the ability to kill non-responsive
sessions. This feature is implemented on the
following platforms:
• Cisco 1100 Series Integrated Services
Routers
• Cisco 4000 Series Integrated Services
Routers
• Cisco ASR 1000 Series Aggregation
Services Routers
• Cisco ASR 900 Series Aggregation
Services Routers
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
• Cisco CBR-8 Series Routers
• Cisco Cloud Services Router 1000v
Series
NETCONF: Candidate Cisco IOS XE Fuji 16.9.1 The Candidate Config Support feature enables
Configuration Support support for candidate capability by
implementing RFC 6241 with a simple commit
option.
This feature was implemented on the
following platforms:
• Cisco 4000 Series Integrated Services
Routers
• Cisco ASR 1000 Series Aggregation
Services Routers
• Cisco ASR 900 Series Aggregation
Services Routers
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
• Cisco CBR-8 Series Routers
• Cisco Cloud Services Router 1000V
Series
NETCONF-YANG SSH Cisco IOS XE Gibraltar This feature was implemented on the
Server Support 16.12.1 following platforms:
• Cisco 1000 Series Integrated Services
Routers
• Cisco 4000 Series Integrated Services
Routers
• Cisco ASR 900 Series Aggregation
Services Routers
• Cisco ASR 920 Series Aggregation
Services Routers
• Cisco ASR 1000 Aggregation Services
Routers
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9200 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
• Cisco Catalyst 9600 Series Switches
• Cisco Catalyst 9800 Series Wireless
Controllers
• Cisco cBR-8 Converged Broadband
Router
• Cisco Cloud Services Router 1000V
Series
• Cisco Network Convergence System 520
Series
• Cisco Network Convergence System
4200 Series
In releases prior to Cisco IOS XE Fuji 16.8.1, an operational data manager (based on polling) was enabled
separately. In Cisco IOS XE Fuji 16.8.1 and later releases, operational data works on platforms running
NETCONF (similar to how configuration data works), and is enabled by default. For more information on
the components that are enabled for operational data queries or streaming, see the GitHub respository, and
view *-oper in the naming convention.
HTTPs Methods
The HTTPS-based RESTCONF protocol (RFC 8040), is a stateless protocol that uses secure HTTP methods
to provide CREATE, READ, UPDATE, and DELETE (CRUD) operations on a conceptual datastore containing
YANG-defined data, which is compatible with a server that implements NETCONF datastores.
The following table shows how the RESTCONF operations relate to NETCONF protocol operations:
GET Read
PATCH Update
Example:
Example returning /restconf:
HTTP/1.1 200 OK
Content-Type: application/xrd+xml
Content-Length: nnn
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<Link rel='restconf' href='/restconf'/>
</XRD>
Example of URIs:
• GigabitEthernet0/0/2 -
https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0%2F2
• fields=name –
https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0%2F2?fields=name
• depth=1 -
https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet?depth=1
• Name and IP -
https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet/ip/address/primary;name
• MTU (fields) -
https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(mtu)
• MTU -
https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=3/mtu
• Port-Channel -
https://10.85.116.59/restconf/data/Cisco-IOS-XE-native:native/interface/Port-channel
• “Char” to “Hex” conversion chart: http://www.columbia.edu/kermit/ascii.html
Note Media is the type of YANG formated RPC that is sent to the RESCONF server (XML or JSON).
• Application/YANG-Data+XML OR Application/YANG-Data+JSON
• The API resource contains the RESTCONF root resource for the RESTCONF DATASTORE and
OPERATION resources. For example:
The client may then retrieve the top-level API resource, using the
root resource "/restconf".
HTTP/1.1 200 OK
Date: Thu, 26 Jan 2017 20:56:30 GMT
Server: example-server
Content-Type: application/yang-data+json
{
"ietf-restconf:restconf" : {
"data" : {},
"operations" : {},
"yang-library-version" : "2016-06-21"
}
}
Methods
Methods are HTTPS operations (GET/PATCH/POST/DELETE/OPTIONS/PUT) performed on a target
resource. A YANG-formated RPC invokes a particular method on a given resource that pertains to a target
YANG model residing in the RESTCONF server. The uniform resource identifier (URI) acts as a location
identification for a given resource, so that the client RESTCONF method can locate that particular resource
to take an action specified by an HTTPS method or property.
For more information, see RFC 8040 - RESTCONF Protocol
SUMMARY STEPS
1. enable
2. configure terminal
3. aaa new-model
4. aaa group server radius server-name
5. server-private ip-address key key-name
6. ip vrf forwarding vrf-name
7. exit
8. aaa authentication login default group group-name local
9. aaa authentication login list-name none
10. aaa authorization exec default group group-name local
11. aaa session-id common
12. line console number
13. login authentication authentication-list
14. end
DETAILED STEPS
Step 4 aaa group server radius server-name Adds the RADIUS server and enters server group RADIUS
configuration mode.
Example:
Device(config)# aaa group server radius ISE • The server-name argument specifies the RADIUS
server group name.
Step 5 server-private ip-address key key-name Configures a IP address and encryption key for a private
RADIUS server.
Example:
Device(config-sg-radius)# server-private
172.25.73.76 key Cisco123
Step 6 ip vrf forwarding vrf-name Configures the virtual routing and forwarding (VRF)
reference of a AAA RADIUS or TACACS+ server group.
Example:
Device(config-sg-radius)# ip vrf forwarding
Mgmt-intf
Step 8 aaa authentication login default group group-name local Sets the specified group name as the default local AAA
authentication during login.
Example:
Step 9 aaa authentication login list-name none Specifies that no authentication is required while logging
into a system.
Example:
Device(config)# aaa authentication login NOAUTH
none
Step 10 aaa authorization exec default group group-name local Runs authorization to determine if an user is allowed to
run an EXEC shell.
Example:
Device(config)# aaa authorization exec default
group ISE local
Step 11 aaa session-id common Ensures that session identification (ID) information that
is sent out for a given call will be made identical.
Example:
Device(config)# aaa session-id common
Step 12 line console number Identifies a specific line for configuration and enter line
configuration mode.
Example:
Device(config)# line console 0
SUMMARY STEPS
1. enable
2. configure terminal
3. restconf
4. ip http secure-server
5. end
DETAILED STEPS
Step 5 end Exits global configuration mode and enters privileged EXEC
mode
Example:
Device(config)# end
NGINX is an internal webserver that acts as a proxy webserver. It provides Transport Layer Security
(TLS)-based HTTPS. RESTCONF request sent via HTTPS is first received by the NGINX proxy web serve,r
and the request is transferred to the confd web server for further syntax/semantics check.
The following sample output from the show platform software yang-management process command shows
the status of the all processes when a device is booted with the startup-configuration:
The nginx process gets restrated and DMI process are started, when the restconf command is configured.
The following sample output from the show platform software yang-management process command shows
that the nginx process and DMI processes are up and running:
Device# show platform software yang-management process
confd : Running
nesd : Running
syncfd : Running
ncsshd : Not Running ! NETCONF-YANG is not configured, hence ncsshd process is
in not running.
dmiauthd : Running
vtyserverutild : Running
opdatamgrd : Running
nginx : Running ! nginx process is up due to the HTTP configuration, and it is
restarted when RESTCONF is enabled.
ndbmand : Running
The following sample output from the show platform software yang-management process monitor command
displays detailed information about all processes:
Device#show platform software yang-management process monitor
COMMAND PID S VSZ RSS %CPU %MEM ELAPSED
confd 28728 S 860396 168496 42.2 4.2 00:12
confd-startup.s 28448 S 19664 4496 0.2 0.1 00:12
dmiauthd 29499 S 275356 23340 0.2 0.5 00:10
ndbmand 29321 S 567232 65564 2.1 1.6 00:11
nesd 29029 S 189952 14224 0.1 0.3 00:11
nginx 29711 S 332288 18420 0.6 0.4 00:09
nginx 29717 S 337636 12216 0.0 0.3 00:09
pubd 28237 S 631848 68624 2.1 1.7 00:13
syncfd 28776 S 189656 16744 0.2 0.4 00:12
After AAA and the RESTCONF interface is configured, and nginx process and relevant DMI processes are
running; the device is ready to receive RESTCONF requests.
Use the show netconf-yang sessions command to view the status of NETCONF/RESTCONF sessions:
Device# show netconf-yang sessions
Number of sessions : 1
Use the show netconf-yang sessions detail command to view detailed information about
NETCONF/RESTCONF sessions:
Device# show netconf-yang sessions detail
Number of sessions : 1
session-id : 19
transport : netconf-ssh
username : admin
source-host : 2001:db8::1
login-time : 2018-10-26T12:37:22+00:00
in-rpcs : 0
in-bad-rpcs : 0
out-rpc-errors : 0
out-notifications : 0
global-lock : None
ConfigurationExamplesforRESTCONFProgrammableInterface
Example: Configuring the RESTCONF Protocol
RESTCONF Requests (HTTPS Verbs):
The following is a sample RESTCONF request that shows the HTTPS verbs allowed on a targeted resource.
In this example, the logging monitor command is used..
root:~#
The POST operation creates a configuration which is not present in the targeted device.
Note Ensure that the logging monitor command is not availabel in the running configuration.
The following sample POST request uses the logging monitor alerts command.
Device:~#
If the specified command is not present on the device, the POST request creates it ; however, if it is
already present in the running configuration, the command will be replaced by this request.
The following sample PUT request uses the logging monitor warnings command.
Device:~# curl -i -k -X "PUT"
"https://10.85.116.30:443/restconf/data/Cisco-IOS-XE-native:native/logging/monitor/severity"
\
> -H 'Content-Type: application/yang-data+json' \
> -H 'Accept: application/yang-data+json' \
> -u 'admin:admin' \
> -d $'{
> "severity": "warnings"
> }'
HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 23 Apr 2018 14:58:36 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Last-Modified: Mon, 23 Apr 2018 14:57:46 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1524-495466-326956
Pragma: no-cache
Device:~#
The following sample PATCH request uses the logging monitor informational command.
Device:~# curl -i -k -X "PATCH"
"https://10.85.116.30:443/restconf/data/Cisco-IOS-XE-native:native" \
> -H 'Content-Type: application/yang-data+json' \
> -H 'Accept: application/yang-data+json' \
> -u 'admin:admin' \
> -d $'{
> "native": {
> "logging": {
> "monitor": {
> "severity": "informational"
> }
> }
> }
> }'
HTTP/1.1 204 No Content
Server: nginx
Date: Mon, 23 Apr 2018 15:07:56 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Last-Modified: Mon, 23 Apr 2018 15:07:56 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1524-496076-273016
Pragma: no-cache
Device:~#
The following sample GET request uses the logging monitor informational command.
Device:~# curl -i -k -X "GET"
"https://10.85.116.30:443/restconf/data/Cisco-IOS-XE-native:native/logging/monitor/severity"
\
> -H 'Accept: application/yang-data+json' \
> -u 'admin:admin'
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 23 Apr 2018 15:10:59 GMT
Content-Type: application/yang-data+json
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Pragma: no-cache
{
"Cisco-IOS-XE-native:severity": "informational"
}
Device:~#
Connection: keep-alive
Last-Modified: Mon, 23 Apr 2018 15:26:05 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1524-497165-473206
Pragma: no-cache
linux_host:~#
YANG data models for various releases To access Cisco YANG models in a developer-friendly way, please
of IOS XE, IOS XR, and NX-OS clone the GitHub repository, and navigate to the
platforms vendor/ciscosubdirectory. Models for various releases of IOS-XE,
IOS-XR, and NX-OS platforms are available here.
Standard/RFC Title
RFC 6020 YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)
Technical Assistance
Description Link
Cisco IOS XE Fuji In Cisco IOS XE Fuji 16.8.1a, this feature was implemented on the
16.8.1a following platforms:
• Cisco 1000 Series Integrated Services Routers
• Cisco ASR 900 Series Aggregation Services Routers
• Cisco ASR 920 Series Aggregation Services Router
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 and 9500-High Performance Series Switches
• Cisco cBR-8 Converged Broadband Router
• Cisco Network Convergence System 4200 Series
Cisco IOS XE Fuji In Cisco IOS XE Fuji 16.9.2, this feature was implemented on the
16.9.2 following platforms:
• Cisco Catalyst 9200 and 9200L Series Switches
• Cisco Catalyst 9300L SKUs
Cisco IOS XE
Gibraltar 16.11.1
Cisco IOS XE In Cisco IOS XE Gibraltar 16.12.1, this feature was implemented on
Gibraltar 16.12.1 Cisco Catalyst 9800-L Wireless Controllers.
InformationAboutNETCONFandRESTCONFService-LevelACLs
Overview of NETCONF and RESTCONF Service-Level ACLs
You can configure an IPv4 or IPv6 access control list (ACL) for NETCONF and RESTCONF sessions. Clients
that do not conform to the configured ACLs are not allowed to access the NETCONF or RESTCONF
subsystems. When service-level ACLs are configured, NETCONF-YANG and RESTCONF connection
requests are filtered based on the source IP address.
If no service-level ACLs are configured, all NETCONF-YANG and RESTCONF connection requests are
permitted into the subsystems.
Note Only named ACLs are supported; numbered ACLs are not supported.
SUMMARY STEPS
1. enable
2. configure terminal
3. • ip access-list {standard | extended} access-list-name
• ipv6 access-list access-list-name
4. permit {host-address | host-name | any} [wildcard]
5. deny {host-address | host-name | any} [wildcard]
6. exit
7. netconf-yang ssh {{ipv4 | ipv6 }access-list name access-list-name} | port port-number}
8. end
DETAILED STEPS
Step 3 • ip access-list {standard | extended} access-list-name • Specifies a standard IP access list and enters standard
• ipv6 access-list access-list-name access-list configuration mode.
Example: • Specifies an IPv6 access list and enters IPv6 access-list
Device(config)# ip access-list standard acl1_permit configuration mode.
Step 4 permit {host-address | host-name | any} [wildcard] Sets conditions in an IP/IPv6 access list that will permit
packets.
Example:
Device(config-std-nacl)# permit 192.168.255.0
0.0.0.255
Step 5 deny {host-address | host-name | any} [wildcard] Sets conditions in an IP or IPv6 access list that will deny
packets.
Example:
Device(config-std-nacl)# deny any
Step 7 netconf-yang ssh {{ipv4 | ipv6 }access-list name Configures an ACL for the NETCONF-YANG session.
access-list-name} | port port-number}
Example:
SUMMARY STEPS
1. enable
2. configure terminal
3. • ip access-list {standard | extended} access-list-name
• ipv6 access-list access-list-name
4. permit {protocol-number | ipv6-source-address | ipv6-source-prefix | protocol}any
5. deny {protocol-number | ipv6-source-address | ipv6-source-prefix | protocol}any any
6. exit
7. restconf {ipv4 | ipv6 }access-list name access-list-name
8. end
DETAILED STEPS
Step 3 • ip access-list {standard | extended} access-list-name • Specifies a standard IP access list and enters standard
• ipv6 access-list access-list-name access-list configuration mode.
Example: • Specifes an IPv6 access list and enters IPv6 access list
Device(config)# ip access-list standard acl1_permit configuration mode.
Step 4 permit {protocol-number | ipv6-source-address | Sets conditions in an IPv6 access list that will permit
ipv6-source-prefix | protocol}any packets.
Example:
Step 5 deny {protocol-number | ipv6-source-address | Sets conditions in an IPv6 access list that will deny packets.
ipv6-source-prefix | protocol}any any
Example:
Device(config-ipv6-acl)# deny ipv6 any any
Step 6 exit Exits IPv6 access list configuration mode and returns to
global configuration mode.
Example:
Device(config-ipv6-acl)# exit
Step 7 restconf {ipv4 | ipv6 }access-list name access-list-name Configures an ACL for the RESTCONF session.
Example:
Device(config)# restconf ipv6 access-list name
ipv6-acl1_permit
Device# enable
Device# configure terminal
Device(config)# ip access-list standard acl1_permit
Device(config-std-nacl)# permit 192.168.255.0 0.0.0.255
Device(config-std-nacl)# deny any
Device(config-std-nacl)# exit
Device(config)# netconf-yang ssh ipv4 access-list name acl1_permit
Device(config)# end
Device# enable
Device# configure terminal
Device(config)# ipv6 access-list ipv6-acl1_permit
Device(config-ipv6-acl)# permit ipv6 2001:db8::1/32 any
Device(config-ipv6-acl)# deny ipv6 any any
Device(config-ipv6-acl)# exit
Device(config)# restconf ipv6 access-list name ipv6-acl1_permit
Device(config)# end
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
Table 15: Feature Information for NETCONF and RESTCONF Service-Level ACLs
NETCONF and Cisco IOS XE You can configure an access control list (ACL) for NETCONF and
RESTCONF Everest RESTCONF sessions. Clients that do not conform to the configured ACL
Service-Level 16.11.1 are not allowed to access the NETCONF or RESTCONF subsystems.
ACLs
The following commands were introduced or modified: netconf-yang
ssh access-list and restconf access-list
• Cisco ASR 900 Series Aggregation Services Routers
• Cisco ASR 920 Series Aggregated Services Routers (RSP2)
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
• Cisco Catalyst 9200 Series Switches
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
• Cisco Catalyst IE 3200, 3300, 3400 Rugged Series
• Cisco Embedded Services 3300 Series Switches
• Cisco IR1101 Integrated Services Router Rugged
• Cisco Network Convergence System 4200 Series
• Cisco Network Convergence System 520 Series
• GetResponse:
• Alias is not supported. It is a string that provides an alias for a prefix specified within the notification
message.
• Delete is not supported. It is a set of paths that are to be removed from a data tree.
GetResponse
encoding: JSON_IETF
++++++++ Received get response: ++++++++
notification {
timestamp: 1521699434792345469
update {
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "\"Loopback111\""
}
}
}
val {
json_ietf_val: "{\n\t\"openconfig-interfaces:name\":\t\
"Loopback111\",\n\t\
"openconfig-interfaces:config\":\t{\n\t\t\
"openconfig-interfaces:type\":\t\"ianaift:
softwareLoopback\",\n\t\t\
"openconfig-interfaces:name\":\t\"Loopback111\",\n\t\t\
"openconfig-interfaces:enabled\":\t\"true\"\n\t},\n\t\
"openconfig-interfaces:state\":\t{\n\t\t\
"openconfig-interfaces:type\":\t\"ianaift:
softwareLoopback\",\n\t\t\
"openconfig-interfaces:name\":\t\"Loopback111\",\n\t\t\
"openconfig-interfaces:enabled\":\t\"true\",\n\t\t\
"openconfig-interfaces:ifindex\":\t52,\n\t\t\
"openconfig-interfaces:admin-status\":\t\"UP\",\n\t\t\
"openconfig-interfaces:oper-status\":\t\"UP\",\n\t\t\
"openconfig-interfaces:last-change\":\t2018,\n\t\t\
"openconfig-interfaces:counters\":\t{\n\t\t\t\
"openconfig-interfaces:in-octets\":\t0,\n\t\t\t\
"openconfig-interfaces:in-unicast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:in-broadcast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:in-multicast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:in-discards\":\t0,\n\t\t\t\
"openconfig-interfaces:in-errors\":\t0,\n\t\t\t\
"openconfig-interfaces:in-unknown-protos\":\t0,\n\t\t\t\
"openconfig-interfaces:out-octets\":\t0,\n\t\t\t\
"openconfig-interfaces:out-unicast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:out-broadcast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:out-multicast-pkts\":\t0,\n\t\t\t\
"openconfig-interfaces:out-discards\":\t0,\n\t\t\t\
"openconfig-interfaces:out-errors\":\t0,\n\t\t\t\
"openconfig-interfaces:last-clear\":\t2018\n\t\t},\n\t\t\
"openconfig-platform:hardware-port\":\t\
"Loopback111\"\n\t},\n\t\
"openconfig-interfaces:subinterfaces\":\t{\n\t\t\
"openconfig-interfaces:index\":\t0,\n\t\t\
"openconfig-interfaces:config\":\t{\n\t\t\t\
"openconfig-interfaces:index\":\t0,\n\t\t\t\
"openconfig-interfaces:name\":\t\"Loopback111\",\n\t\t\t\
"openconfig-interfaces:enabled\":\t\"true\"\n\t\t},\n\t\t\
"openconfig-interfaces:state\":\t{\n\t\t\t\
"openconfig-interfaces:index\":\t0,\n\t\t\t\
"openconfig-interfaces:name\":\t\"Loopback111.0\",\n\t\t\t\
"openconfig-interfaces:enabled\":\t\"true\",\n\t\t\t\
"openconfig-interfaces:admin-status\":\t\"UP\",\n\t\t\t\
"openconfig-interfaces:oper-status\":\t\"UP\",\n\t\t\t\
"openconfig-interfaces:last-change\":\t2018,\n\t\t\t\
"openconfig-interfaces:counters\":\t{\n\t\t\t\t\
"openconfig-interfaces:in-octets\":\t0,\n\t\t\t\t\
"openconfig-interfaces:in-unicast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:in-broadcast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:in-multicast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:in-discards\":\t0,\n\t\t\t\t\
"openconfig-interfaces:in-errors\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-octets\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-unicast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-broadcast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-multicast-pkts\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-discards\":\t0,\n\t\t\t\t\
"openconfig-interfaces:out-errors\":\t0,\n\t\t\t\t\
"openconfig-interfaces:last-clear\":\
t2018\n\t\t\t}\n\t\t},\n\t\t\
"openconfig-if-ip:ipv6\":\t{\n\t\t\t\
"openconfig-if-ip:config\":\t\"false\",\n\t\t\t\
"openconfig-if-ip:state\":\t\"false\"\n\t\t}\n\t}\n}"
}
}
}
GetResponse
encoding: JSON_IETF
++++++++ Received get response: ++++++++
notification {
timestamp: 1521699326012374332
update {
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "\"Loopback111\""
}
}
elem {
name: "state"
}
elem {
name: "oper-status"
}
}
val {
json_ietf_val: "\"UP\""
}
}
}
gNMI SetRequest
The Set RPC specifies how to set one or more configurable attributes associated with a supported model. A
SetRequest is sent from a client to a target to update the values in the data tree.
SetRequests also support JSON keys, and must contain a YANG-prefix, in which the namespace of the element
differs from parent.
For example, the routed-vlan element derived from augmentation in openconfig-vlan.yang must be entered
as oc-vlan:routed-vlan, because it is different from the namespace of the parent node (The parent node prefix
is oc-if.).
The total set of deletes, replace, and updates contained in any one SetRequest is treated as a single transaction.
If any subordinate element of the transaction fails; the entire transaction is disallowed and rolled back. A
SetResponse is sent back for a SetRequest.
SetRequest SetResponse
++++++++ Sending set request: ++++++++ ++++++++ Received set response: ++++++++
update { response {
path { path {
elem { elem {
name: "interfaces" name: "interfaces"
} }
elem { elem {
name: "interface" name: "interface"
key { key {
key: "name" key: "name"
value: "Loopback111" value: "Loopback111"
} }
} }
elem { elem {
name: "config" name: "config"
} }
} }
val { op: UPDATE
json_ietf_val: }
"{\"openconfig-interfaces:enabled\":\"false\"}" timestamp: 1521699342123890045
}
}
SetRequest SetResponse
++++++++ Sending set request: ++++++++ ++++++++ Received set response: ++++++++
update { response {
path { path {
elem { elem {
name: "interfaces" name: "interfaces"
} }
elem { elem {
name: "interface" name: "interface"
key { key {
key: "name" key: "name"
value: "Loopback111" value: "Loopback111"
} }
} }
elem { elem {
name: "config" name: "config"
} }
elem { elem {
name: "description" name: "description"
} }
} }
val { op: UPDATE
json_ietf_val: "\"UPDATE DESCRIPTION\"" }
} timestamp: 1521699342123890045
}
gNMI Namespace
A namespace specifies the path prefixing to be used in the origin field of a message.
This section describes the namespaces used in Cisco IOS XE Gibraltar 16.10.1 and later releases:
• RFC 7951-specified namespaces: Path prefixes use the YANG module name as defined in RFC 7951.
The RFC 7951-specified value prefixing uses the YANG module name.
Value prefixing is not affected by the selected path prefix namespace. The following example shows an
RFC 7951-specified value prefix:
val {
json_ietf_val:"{
"openconfig-interfaces:config": {
“openconfig-interfaces:description":
“DESCRIPTION”
}
}"
}
An RFC 7951-specified namespace prefixing also uses the YANG module name. For example, the
openconfig path to a loopback interface will be
/openconfig-interfaces:interfaces/interface[name=Loopback111]/
name: "openconfig-interface:interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "Loopback111"
}
}
}
• Openconfig: No path prefixes are used. These can only be used with a path to an openconfig model.
The behavior of the Openconfig namespace prefixing is the same when no origin or namespace is provided.
For example, the openconfig path to a loopback interface will be
/interfaces/interface[name=Loopback111]/
This section describes the path prefixing used in releases prior to Cisco IOS XE Gibraltar 16.10.1.
Here, path prefixing uses the YANG module prefix as defined in the YANG module definition. For example,
the openconfig path to a loopback interface will be
/oc-if:interfaces/interface[name=Loopback111]/
The following example shows a gNMI Path with with legacy namespacing:
path {
origin: “legacy"
elem {
name: "oc-if:interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "Loopback111"
}
}
}
gNMI Wildcards
The gNMI protocol supports wildcards for Get paths. This is the ability to use a wildcards in a path to match
multiple elements. These wildcards indicate all elements in a given subtree in the schema.
An elem is an element, and it is a value between / characters in an xPath. An elem is also available in a gNMI
path. For example, the position of a wildcard relative to elem names implies that the wildcard stands for an
interface, and is interpreted as all interfaces.
There are two types of wildcards; implicit and explicit, and both are supported. Get paths support all types
and combinations of path wildcards.
• Implicit wildcards: These expand a list of elements in an element tree. Implicit wildcard occurs when a
key value is not provided for elements of a list.
The following is a sample path implicit wildcard. This wildcard will return the descriptions of all interfaces
on a device:
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
}
elem {
name: "config"
}
elem {
name: "description"
}
}
}
elem {
name: "description"
}
}
The following sample shows a path asterisk wildcard as the path name. This wildcard will return
the description for all elements that are available in the Loopback111 interface.
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "Loopback111"
}
}
elem {
name: "*"
}
elem {
name: "description"
}
}
• Specifying an ellipsis (...) or a blank entry as element names. These wildcards can expand to multiple
elements in a path.
The following sample shows a path ellipsis wildcard. This wildcard returns all description fields
available under /interfaces.
path {
elem {
name: "interfaces"
}
elem {
name: "..."
}
elem {
name: "description"
}
}
The following is a sample GetRequest with an implicit wildcard. This GetRequest will return the oper-status
of all interfaces on a device.
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
}
elem {
name: "state"
}
elem {
name: "oper-status"
}
},
type: 0,
encoding: 4
notification {
timestamp: 1520627877608777450
update {
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "\"FortyGigabitEthernet1/1/1\""
}
}
elem {
name: "state"
}
elem {
name: "oper-status"
}
}
val {
json_ietf_val: "\"LOWER_LAYER_DOWN\""
}
},
<snip>
…
</snip>
update {
path {
elem {
name: "interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "\"Vlan1\""
}
}
elem {
name: "state"
}
elem {
name: "oper-status"
}
}
val {
json_ietf_val: "\"DOWN\""
}
}
}
The following sample error message is displayed when the data element is empty:
2. Connect the gNMI client using client and root certificates configured in previous steps.
# Send:
Device# configure terminal
Device(config)# crypto pki import trustpoint1 pem terminal password password1
# Receive:
% Enter PEM-formatted CA certificate.
% End with a blank line or "quit" on a line by itself.
# Send:
# Contents of rootCA.pem, followed by newline + 'quit' + newline:
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
quit
# Receive:
% Enter PEM-formatted encrypted private General Purpose key.
% End with "quit" on a line by itself.
# Send:
# Contents of device.des3.key, followed by newline + 'quit' + newline:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,D954FF9E43F1BA20
<snip>
-----END RSA PRIVATE KEY-----
quit
# Receive:
% Enter PEM-formatted General Purpose certificate.
# Send:
# Contents of device.crt, followed by newline + 'quit' + newline:
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
quit
# Receive:
% PEM files import succeeded.
Device(config)#
# Send:
Device(config)# crypto pki trustpoint trustpoint1
Device(ca-trustpoint)# revocation-check none
Device(ca-trustpoint)# end
Device#
Note This task is applicable in Cisco IOS XE Fuji 16.8.1 through Amsterdam 17.2.x.
In a Day Zero setup, first enable the device in insecure mode, then disable it, and enable the secure mode. To
stop gNMI in insecure mode, use the no gnmi-yang server command.
SUMMARY STEPS
1. enable
2. configure terminal
3. gnmi-yang
4. gnmi-yang server
5. gnmi-yang port port-number
6. end
7. show gnmi-yang state
DETAILED STEPS
Step 5 gnmi-yang port port-number Sets the gNMI port to listen to.
Example: • The default insecure gNMI port is 9339.
(Optional) Device(config)# gnmi-yang port 50000
Example
The following is sample output from the show gnmi-yang state command:
State Status
--------------------------------
Enabled Up
Note This task is applicable in Cisco IOS XE Fuji 16.8.1 through Amsterdam 17.2.x.
SUMMARY STEPS
1. enable
2. configure terminal
3. gnmi-yang
4. gnmi-yang secure-server
5. gnmi-yang secure-trustpoint trustpoint-name
6. gnmi-yang secure-client-auth
7. gnmi-yang secure-port
8. end
9. show gnmi-yang state
DETAILED STEPS
Step 5 gnmi-yang secure-trustpoint trustpoint-name Specifies the trustpoint and cert set that gNMI uses for
authentication.
Example:
Device(config)# gnmi-yang secure-trustpoint
trustpoint1
Step 6 gnmi-yang secure-client-auth (Optional) The gNMI process authenticates the client
certificate against the root certificate.
Example:
Device(config)# gnmi-yang secure-client-auth
Step 7 gnmi-yang secure-port (Optional) Sets the gNMI port to listen to.
Example: • The default insecure gNMI port is 9339.
Example
The following is sample output from the show gnmi-yang state command:
State Status
--------------------------------
Enabled Up
Note This example is applicable in Cisco IOS XE Fuji 16.8.1 through Amsterdam 17.2.x.
gNMI https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md
Standard/RFC Title
RFC 7951 JSON Encoding of Data Modeled with YANG
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
gNMI Protocol Cisco IOS XE Fuji 16.8.1a This feature describes the model-driven
configuration and retrieval of operational data
using the gNMI capabilities, GET and SET
RPCs.
This feature was implemented on the
following platforms:
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9400 Series Switches
• Cisco Catalyst 9500 Series Switches
gNMI Username and Cisco IOS XE Gibraltar The Username and Password Authentication
Password Authentication 16.12.1 feature was added to the gNMI protocol. This
feature is supported on all IOS XE platforms
that support gNMI.
Initial Operation
Upon enabling the NETCONF and/or RESTCONF services, a device that has no prior configuration of the
/nacm subtree will deny read, write, and execute access to all operations and data other than the users of
privilege level 15. This is described in the following configuration of the /nacm subtree:
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<enable-nacm>true</enable-nacm>
<read-default>deny</read-default>
<write-default>deny</write-default>
<exec-default>deny</exec-default>
<enable-external-groups>true</enable-external-groups>
<rule-list>
<name>admin</name>
<group>PRIV15</group>
<rule>
<name>permit-all</name>
<module-name>*</module-name>
<access-operations>*</access-operations>
<action>permit</action>
</rule>
</rule-list>
</nacm>
Group Membership
The group membership of a user can come from two sources- first, from the privilege level of the user as
configured on the AAA server used for authorization, and second, from those configured in the /nacm/groups
subtree. The names of the groups that correspond to each privilege level are as follows:
0 PRIV00
1 PRIV01
2 PRIV02
3 PRIV03
4 PRIV04
5 PRIV05
6 PRIV06
7 PRIV07
8 PRIV08
9 PRIV09
10 PRIV10
11 PRIV11
12 PRIV12
13 PRIV13
14 PRIV14
15 PRIV15
Note Traditional IOS command authorization, such as those based on privilege level, does not apply to NETCONF
or RESTCONF.
Note Access granted to a NACM group based on a privilege level do not inherently apply to NACM groups with
higher privilege level. For example, rules that apply to PRIV10 do not automatically apply to PRIV11, PRIV12,
PRIV13, PRIV14, and PRIV15 as well.
Note The NACM rules that apply to a NETCONF session are those that are configured in the /nacm subtree at the
time of session establishment. Modifying the /nacm subtree has no effect on NETCONF sessions as they are
already established. The <kill-session> RPC or the clear netconf-yang session EXEC command can be used
to forcibly end an unwanted NETCONF session. See NETCONF Kill Session, on page 117.
Note Care should be taken when crafting rules to deny access to certain data as the same data may be exposed
through multiple YANG modules and data node paths. For example, interface configuration is exposed through
both Cisco-IOS-XE-native and ietf-interface. Rules that may apply to one representation of the same
underlying data may not apply to other representations of that data.
Note The examples in this section are for illustrative purposes only.
</group>
<group>
<name>limited-permission</name>
<user-name>alice</user-name>
<user-name>bob</user-name>
</group>
</groups>
</nacm>
Parameter Description
Table 20: Description of the Configuration Paramenters for Creating Module Rules
Parameter Description
<action>deny</action> Permit/deny
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>only-get</name>
<group>limited-permission</group>
<rule>
<name>deny-edit-config</name>
<module-name>ietf-netconf</module-name>
<rpc-name>edit-config</rpc-name>
<access-operations>exec</access-operations>
<action>deny</action>
</rule>
<rule>
<name>allow-get</name>
<module-name>ietf-netconf</module-name>
<rpc-name>get</rpc-name>
<access-operations>exec</access-operations>
<action>permit</action>
</rule>
</rule-list>
</nacm>
Table 21: Description of the Configuration Paramenters for Creating Protocol Operation Rules
Parameter Description
<action>deny</action> Permit/deny
<rule>
<name>deny-enable-passwords</name>
<path xmlns:ios="http://cisco.com/ns/yang/Cisco-IOS-XE-native>/ios:native/enable
</path>
<access-operations>*</access-operations>
<action>deny</action>
</rule>
</rule-list>
</nacm>
Table 22: Description of the Configuration Paramenters for Creating Data Node Rules
Parameter Description
<action>deny</action> Permit/deny
The following is an example NACM configuration that permits all groups to use the standard NETCONF
RPCs <get> and <get-config>, the schema download RPC <get-schema>, and read-only access to the data in
the module ietf-interfaces:
<nacm xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-acm">
<rule-list>
<name>readonly-protocol</name>
<group>*</group>
<rule>
<name>get-permit</name>
<module-name>ietf-netconf</module-name>
<rpc-name>get</rpc-name>
<access-operations>exec</access-operations>
<action>permit</action>
</rule>
<rule>
<name>get-config-permit</name>
<module-name>ietf-netconf</module-name>
<rpc-name>get-config</rpc-name>
<access-operations>exec</access-operations>
<action>permit</action>
</rule>
<rule>
<name>get-schema-permit</name>
<module-name>ietf-netconf-monitoring</module-name>
<rpc-name>get-schema</rpc-name>
<access-operations>exec</access-operations>
<action>permit</action>
</rule>
</rule-list>
<rule-list>
<name>readonly-data</name>
<group>*</group>
<rule>
<name>ietf-interfaces-permit</name>
<module-name>ietf-interfaces</module-name>
<access-operations>read</access-operations>
<action>permit</action>
</rule>
</rule-list>
</nacm>
Standard/RFC Title
RFC 6020 YANG - A Data Modeling Language for the Network Configuration
Protocol (NETCONF)
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, http://www.cisco.com/support
including documentation and tools for troubleshooting and resolving
technical issues with Cisco products and technologies.
To receive security and technical information about your products,
you can subscribe to various services, such as the Product Alert Tool
(accessed from Field Notices), the Cisco Technical Services
Newsletter, and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a
Cisco.com user ID and password.
Model-Based AAA Cisco IOS XE Fuji 16.8.1 This feature was implemented on the
following platforms:
• Cisco ASR 900 Series Aggregated
Services Routers
• Cisco ASR 920 Series Aggregated
Services Routers
• Cisco ASR 1000 Series Aggregated
Services Routers
• Cisco CSR 1000v Switches
• Cisco ISR 1100 Series Integrated
Services Routers
• Cisco ISR 4000 Series Integrated
Services Routers
• Cisco NCS 4200 Series
Model-Driven Telemetry
Model-driven telemetry provides a mechanism to stream YANG-modelled data to a data collector. This module
describes model-driven telemetry and provides sample telemetry remote procedure calls (RPCs).
Verify that the following processes are running, by using the show platform software yang-management
process command:
confd : Running
nesd : Running
syncfd : Running
ncsshd : Running
dmiauthd : Running
nginx : Running
ndbmand : Running
pubd : Running
gnmib : Running
Note The process pubd is the model-driven telemetry process, and if it is not running,
model-driven telemetry will not work.
The following table provides details about each of the Device Management Interface (DMI) processes.
NETCONF-Specific Prerequisites
• Knowledge of NETCONF and how to use it, including:
• Establishing a NETCONF session.
• Sending and receiving hello and capabilities messages.
• Sending and receiving YANG XML RPCs over the established NETCONF session. For more
information, see the Configure NETCONF/YANG and Validate Example for Cisco IOS XE 16.x
Platforms document.
NETCONF is ready to use, when a successful reply is received in response to your hello message.
RESTCONF-Specific Prerequisites
• Knowledge of RESTCONF and how to use it (when creating a subscription using RESTCONF).
• RESTCONF must be configured on the device.
• RESTCONF must send correctly-formed Uniform Resource Identifiers (URIs) that adhere to RESTCONF
RFC 8040.
<snip>
..
}
RESTCONF is validated successfully when you receive the above reply with all device capabilities.
gRPC-Specific Prerequisites
• Set up a gRPC collector that understands key-value Google Protocol Buffers (GPB) encoding.
gRPC-Specific Restrictions
• Transport Layer Security-based (TLS-based) authentication between a device and receiver is not supported
yang-push-Specific Restriction
• Subscription quality of service (QoS) is not supported.
Telemetry Roles
In systems that use telemetry, different roles are involved. In this document the following telemetry roles are
described:
Subscription Overview
Subscriptions are items that create associations between telemetry roles, and define the data that is sent between
them.
Specifically, a subscription is used to define the set of data that is requested as part of the telemetry data; when
the data is required, how the data is to be formatted, and, when not implicit, who (which receivers) should
receive the data.
Even though the maximum number of supported subscriptions is platform-dependent, currently 100
subscriptions are supported. The subscriptions can be either configured or dynamic, and use any combination
of transport protocols. If too many subscriptions are operating at the same time to allow all the valid configured
subscriptions to be active, the removal of an active subscription will cause one of the inactive but valid
configured subscriptions to be attempted. Periodic triggered subscriptions (100 centiseconds is the default
minimum) and on-change triggered subscriptions are supported.
NETCONF and other northbound programmable interfaces (such as RESTCONF or gNMI) are supported to
configure subscriptions.
Two types of subscriptions are used in telemetry on Cisco IOS XE systems: dynamic and configured
subscriptions.
Because dynamic subscriptions are created by clients (the subscriber) that connect into the publisher, they are
considered dial-in. Configured subscriptions cause the publisher to initiate connections to receivers, and as a
result, they are considered dial-out.
Telemetry updates are sent to the initiator or Telemetry updates are sent to the specified receiver
subscriber. or collector.
Life of the subscription is tied to the connection Subscription is created as part of the running
(session) that created it, and over which telemetry configuration; it remains as the device configuration
updates are sent. No change is observed in the running till the configuration is removed.
configuration.
Dial-in subscriptions need to be reinitiated after a Dial-out subscriptions are created as part of the device
reload, because established connections or sessions configuration, and they automatically reconnect to the
are killed during stateful switchover. receiver after a stateful switchover.
Subscription ID is dynamically generated upon Subscription ID is fixed and configured on the device
successful establishment of a subscription. as part of the configuration.
Update Notifications
As part of a subscription, you can specify when data is required. However this is stream-dependent. Some
streams support making data available only when there a change happens, or after an event within the stream.
Other streams make data available when there is a change or at a defined time period.
The result of the when specification is a series of update notifications that carry the telemetry data of interest.
How the data is sent is dependent on the protocol used for the connection between the publisher and the
receiver.
Subscription Identifiers
Subscriptions are identified by a 32-bit positive integer value. The IDs for configured subscriptions is set by
the controller, and for dynamic subscriptions is set by the publisher.
Controllers must limit the values they use for configured subscriptions in the range 0 to 2147483647 to avoid
collisions with the dynamic subscriptions created on the publisher. The dynamic subscription ID space is
global, meaning that the subscription IDs for independently-created dynamic subscriptions do not overlap.
Subscription Management
Any form of management operation can be used to create, delete, and modify configured subscriptions. This
includes both CLIs and network protocol management operations.
All subscriptions, both configured and dynamic, can be displayed using show commands and network protocol
management operations.
The following table describes the supported streams and encodings along with the combinations that are
supported. While streams-as-inputs is intended to be independent of the protocols-as-outputs, not all
combinations are supported.
Stream
ok <establish-subscription> Success
<delete-subscription>
Service gNMI
The gNMI specification identifies a single top-level service named gNMI that contains high-level RPCs. The
following is a service definition that contains the subscribe service RPC:
service gNMI{
.
.
.
rpc Subscribe(stream SubscribeRequest)
returns (stream SubscribeResponse);
The <subscribe RPC> is used by a management agent to request a dynamic subscription. This RPC contains
a set of messages. The following section describes the messages supported by the <subscribe RPC>
SubscribeRequest Message
This message is sent by a client to request updates from the target for a specified set of paths. The following
is a message definition:
message SubscribeRequest {
oneof request {
SubscriptionList subscribe = 1;
PollRequest poll = 3;
AliasList aliases = 4;
}
Repeated gNMI_ext.Extensions = 5;
}
SubscribeResponse Message
This message is carried from the target to the client over an established <subscribe RPC>. The following is
a message definition:
message SubscribeResponse {
oneof response {
Notification update = 1;
Bool sync_response = 3;
Error error = 4 [deprecated=true];
}
}
SubscriptionList Message
This message is used to indicate a set of paths for which common subscription behavior are required. Within
the specification of the SubscriptionList message, the client can identify one or more subscriptions to a given
prefix in the model. The following is a SubscriptionList message defintion:
message SubscriptionList {
Path prefix = 1;
repeated Subscription subscription = 2;
bool use_aliases = 3;
QOSMarking qos = 4;
enum Mode {
STREAM = 0;
ONCE = 1;
POLL = 2;
}
Mode mode = 5;
bool allow_aggregation = 6;
repeated ModelData use_models = 7;
Encoding encoding = 8; // only JSON_IETF supported in R16.12
Bool updates_only = 9;
Note In Cisco IOS XE Gibraltar 16.12.1, Path prefix (only explicit element names), Subscription subscription,
Mode mode STREAM, and Encoding encoding IETF_JSON are supported.
Prefix Message
A valid subscription list may or may not contain a filled in prefix, composed of the shared (across all requested
subscriptions) portion of the xPath.
message Path {
repeated string element = 1; [ deprecated ]
string origin = 2;
repeated PathElem elem = 3;
optional string target = 4;
}
Note In Cisco IOS XE Gibraltar 16.12.1, origin (supported values are “” and “openconfig”), elem (supported element
name is prefix-free), and target are supported.
Subscription Message
This message generically describes a set of data that is to be subscribed to by a client. It contains a path,and
attributes used to govern the notification behaviors. The following is a Subscription message definition:
message Subscription {
Path path = 1;
SubscriptionMode mode = 2;
uint64 sample_interval = 3;
bool suppress_redundant = 4;
uint64 heartbeat_interval = 5;
}
Note In Cisco IOS XE Gibraltar 16.12.1, Path path, SubscriptionMode mode, Uint64 sample_interval, and Uint64
heartbeat_interval (only if the value is set to 0) are supported.
Path Message
A valid subscription contains a filled in path, which when added to the prefix associated with the subscription
list constitutes a full qualified path. The following is a Path message definition:
message Path {
repeated string element = 1; [ deprecated ]
string origin = 2;
repeated PathElem elem = 3;
optional string target = 4;
}
Note In Cisco IOS XE Gibraltar 16.12.1, origin (supported values are “” and “openconfig”), elem (supported element
name is prefix-free), and target are supported.
SubscriptionMode Message
This message informs the target about how to trigger notifications updates. The following is a SubscriptionMode
message definition:
enum SubscriptionMode {
TARGET_DEFINED = 0;
ON_CHANGE = 1;
SAMPLE = 2;
}
Notifications Message
This message delivers telemetry data from the subscription target to the collector. The following is a
Notifications message definition:
message Notification {
int64 timestamp = 1;
Path prefix = 2;
string alias = 3;
repeated Update update = 4;
repeated Path delete = 5;
bool atomic = 6;
}
Note In Cisco IOS XE Gibraltar 16.12.1, timestamp, prefix, and update are supported.
<establish-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-event-notifications"
xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<stream>yp:yang-push</stream>
<yp:xpath-filter>/cdp-ios-xe-oper:cdp-neighbor-details/cdp-neighbor-detail</yp:xpath-filter>
<yp:dampening-period>0</yp:dampening-period>
</establish-subscription>
<get>
<filter>
<mdt-oper-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-oper">
<mdt-subscriptions/>
</mdt-oper-data>
</filter>
</get>
</data>
</rpc-reply>
<kill-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-event-notifications"
xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<identifier>2147483653</identifier>
</kill-subscription>
xmlns:notif-bis="urn:ietf:params:xml:ns:yang:ietf-event-notifications">notif-bis:ok</subscription-result>
</rpc-reply>
<get>
<filter>
<mdt-oper-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-oper">
<mdt-subscriptions/>
</mdt-oper-data>
</filter>
</get>
…
</mdt-receivers>
<last-state-change-time>2018-12-13T21:16:57.440936+00:00</last-state-change-time>
</mdt-subscriptions>
</mdt-oper-data>
</data>
</rpc-reply>
Periodic Subscription
The following example shows how to configure gRPC as the transport protocol for configured subscriptions
using the CLI:
The following sample RPC shows how to create a periodic subscription using NETCONF that sends telemetry
updates to the receiver every 60 seconds:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config>
<target>
<running/>
</target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<mdt-config-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-cfg">
<mdt-subscription>
<subscription-id>200</subscription-id>
<base>
<stream>yang-push</stream>
<encoding>encode-kvgpb</encoding>
<period>6000</period>
<xpath>/memory-ios-xe-oper:memory-statistics/memory-statistic</xpath>
</base>
<mdt-receivers>
<address>10.22.23.48</address>
<port>57555</port>
<protocol>grpc-tcp</protocol>
</mdt-receivers>
</mdt-subscription>
</mdt-config-data>
</config>
</edit-config>
</rpc>
On-Change Subscription
The following sample RPC shows how to create an on-change subscription using NETCONF that sends
updates only when there is a change in the target database:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config>
<target>
<running/>
</target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<mdt-config-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-cfg">
<mdt-subscription>
<subscription-id>200</subscription-id>
<base>
<stream>yang-push</stream>
<encoding>encode-kvgpb</encoding>
<no-synch-on-start>false</no-synch-on-start>
<xpath>/cdp-ios-xe-oper:cdp-neighbor-details/cdp-neighbor-detail</xpath>
</base>
<mdt-receivers>
<address>10.22.23.48</address>
<port>57555</port>
<protocol>grpc-tcp</protocol>
</mdt-receivers>
</mdt-subscription>
</mdt-config-data>
</config>
</edit-config>
</rpc>
The following sample RPC shows how to create an on-change subscription using RESTCONF:
URI:
https://10.85.116.28:443/restconf/data/Cisco-IOS-XE-mdt-cfg:mdt-config-data
Headers:
application/yang-data.collection+json, application/yang-data+json,
application/yang-data.errors+json
Content-Type:
application/yang-data+json
BODY:
{
"mdt-config-data": {
"mdt-subscription":[
{
"subscription-id": "102",
"base": {
"stream": "yang-push",
"encoding": "encode-kvgpb",
"dampening period": "0",
"xpath": "/cdp-ios-xe-oper:cdp-neighbor-details/cdp
-neighbor-detail "
}
"mdt-receivers": {
"address": "10.22.23.48"
"port": "57555"
}
}
]
}
}
subscribe: <
prefix: <>
subscription: <
path: <
origin: "openconfig"
elem: <name: "routing-policy">
>
mode: SAMPLE
sample_interval: 10000000000
>
mode: STREAM
encoding: JSON_IETF
>'
subscribe: <
prefix: <>
subscription: <
path: <
origin: "legacy"
elem: <name: "oc-platform:components">
elem: <
name: "component"
key: <
key: "name"
value: "PowerSupply8/A"
>
>
elem: <name: "power-supply">
elem: <name: "state">
>
mode: SAMPLE
sample_interval: 10000000000
>
mode: STREAM
encoding: JSON_IETF
>'
Subscription receivers are identified by the address and port number. Receivers cannot be modified. To change
the characteristics (protocol, profile, and so on) of a receiver, it must be deleted first and a new receiver created.
If a valid receiver configuration on a valid subscription is in the disconnected state, and the management wants
to force a new attempt at setting up the connection to the receiver, it must rewrite the receiver with the exact
same characteristics.
<edit-config>
<target>
<running/>
</target>
<config>
<mdt-config-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-cfg">
<mdt-subscription operation="delete">
<subscription-id>102</subscription-id>
</mdt-subscription>
</mdt-config-data>
</config>
</edit-config>
Subscription Monitoring
Subscriptions of all types can be monitored by using CLIs and management protocol operations.
CLI
Use the show telemetry ietf subscription command to display information about telemetry subscriptions.
The following is sample output from the command:
Device# show telemetry ietf subscription 2147483667 detail
NETCONF
The following is a sample NETCONF message that displays information about telemetry subscriptions:
<get>
<filter>
<mdt-oper-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-oper">
<mdt-subscriptions/>
</mdt-oper-data>
</filter>
</get>
<protocol>grpc-tcp</protocol>
<state>rcvr-state-connecting</state>
<comments/>
<profile/>
<last-state-change-time>1970-01-01T00:00:00+00:00</last-state-change-time>
</mdt-receivers>
<last-state-change-time>1970-01-01T00:00:00+00:00</last-state-change-time>
</mdt-subscriptions>
<mdt-subscriptions>
<subscription-id>2147483648</subscription-id>
<base>
<stream>yang-push</stream>
<encoding>encode-xml</encoding>
<source-vrf/>
<period>1000</period>
<xpath>/if:interfaces-state/interface[name="GigabitEthernet0/0"]/oper-status</xpath>
</base>
<type>sub-type-dynamic</type>
<state>sub-state-valid</state>
<comments/>
<mdt-receivers>
<address>5.22.22.45</address>
<port>51259</port>
<protocol>netconf</protocol>
<state>rcvr-state-connected</state>
<comments/>
<profile/>
<last-state-change-time>1970-01-01T00:00:00+00:00</last-state-change-time>
</mdt-receivers>
<last-state-change-time>1970-01-01T00:00:00+00:00</last-state-change-time>
</mdt-subscriptions>
</mdt-oper-data>
</data>
</rpc-reply>
Streams
A stream defines a set of events that can be subscribed to, and this set of events can be almost anything.
However, as per the definition of each stream, all possible events are related in some way. This section
describes the supported streams.
To view the set of streams that are supported, use management protocol operations to retrieve the streams
table from the Cisco-IOS-XE-mdt-oper module (from the YANG model Cisco-IOS-XE-mdt-oper.yang) in
the mdt-streams container.
The following example shows how to use NETCONF to retrieve supported streams:
<get>
<filter>
<mdt-oper-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-oper">
<mdt-streams/>
</mdt-oper-data>
</filter>
</get>
<mdt-streams>
<stream>native</stream>
<stream>yang-notif-native</stream>
<stream>yang-push</stream>
</mdt-streams>
</mdt-oper-data>
</data>
</rpc-reply>
The example shows that three streams are supported: native, yang-notif-native, and yang-push. The stream
native is not available for general use and can be ignored.
Note Currently there are no CLIs to return the list of supported streams.
Note The following features that are described in the corresponding drafts are not supported:
• Subtree filters
• Out-of-band notifications
• Any subscription parameter not explicitly stated as supported
# VALID!
Compound keys are supported by the use of multiple key specifications. Key names and values must be
exact; no ranges or wildcard values are supported.
• XPath expressions support the use of the union operator (|) to allow a single subscription to support
multiple objects.
Note Currently, this stream is not supported over Google remote procedure call (gRPC).
Transport Protocol
The protocol that is used for the connection between a publisher and a receiver decides how the data is sent.
This protocol is referred to as the transport protocol, and is independent of the management protocol for
configured subscriptions. The transport protocol affects both the encoding of the data, for example XML,
Google Protocol Buffers (GPB) and the format of the update notification itself.
Note The stream that is chosen may also affect the format of the update notification.
NETCONF Protocol
The NETCONF protocol is available only for the transport of dynamic subscriptions, and can be used with
yang-push and yang-notif-native streams.
Three update notification formats are used when using NETCONF as the transport protocol:
• When the subscription uses the yang-push stream, and if it is periodic or when the initial synchronization
update notification is sent on an on-change subscription.
• When the subscription uses the yang-push stream and it is an on-change subscription, other than the
initial synchronization update notification.
• When the subscription uses the yang-notif-native stream.
gRPC Protocol
The gRPC protocol is available only for the transport of configured subscriptions, and can only be used with
the yang-push stream. Only kvGPB encoding is supported with gRPC transport protocol.
Receiver connection retries based on gRPC protocol (exponential back-off) are supported.
For telemetry messages defined in .proto files, see: mdt_grpc_dialout.proto and telemetry.proto.
Note In the event of a device reload, subscription configurations must be synchronized to the start-up configuration
of a device. This ensures that after the device reboots, subscription configurations remain intact on the device.
When the necessary processes are up and running, the device attempts to connect to the telemetry receiver
and resume normal operations.
Note Currently, you can only use the gRPC protocol for managing configured subscriptions.
SUMMARY STEPS
1. enable
2. configure terminal
3. telemetry ietf subscription id
4. stream yang-push
5. filter xpath path
6. update-policy {on-change | periodic} period
7. encoding encode-kvgpb
8. source-vrf vrf-id
9. source-address source-address
10. receiver ip address ip-address receiver-port protocol protocol profile name
11. end
DETAILED STEPS
Step 5 filter xpath path Specifies the XPath filter for the subscription.
Example:
Device(config-mdt-subs)# filter xpath
/memory-ios-xe-oper:memory-statistics/memory-statistic
Step 6 update-policy {on-change | periodic} period Configures a periodic update policy for the subscription.
Example:
Device(config-mdt-subs)# update-policy periodic
6000
Step 10 receiver ip address ip-address receiver-port protocol Configures the receiver IP address, protocol, and profile
protocol profile name for notifications.
Example:
Device(config-mdt-subs)# receiver ip address
10.28.35.45 57555 protocol grpc-tcp
SUMMARY STEPS
1. enable
2. configure terminal
3. telemetry ietf subscription id
4. stream yang-push
5. filter xpath path
6. update-policy {on-change | periodic period}
7. encoding encode-kvgpb
8. receiver ip address ip-address receiver-port protocol protocol profile name
9. end
DETAILED STEPS
Step 5 filter xpath path Specifies the XPath filter for the subscription.
Example:
Device(config-mdt-subs)# filter xpath
/iosxe-oper:ios-oper-db/hwidb-table
Step 6 update-policy {on-change | periodic period} Configures an on-change update policy for the subscription.
Example:
Device(config-mdt-subs)# update-policy on-change
Step 8 receiver ip address ip-address receiver-port protocol Configures the receiver IP address, protocol, and profile
protocol profile name for notifications.
Example:
Device(config-mdt-subs)# receiver ip address
10.22.22.45 45000 protocol
grpc_tls profile secure_profile
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2017-05-09T21:34:51.74Z</eventTime>
<push-update xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<subscription-id>2147483650</subscription-id>
<datastore-contents-xml>
<cpu-usage
xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-process-cpu-oper"><cpu-utilization>
<five-minutes>5</five-minutes></cpu-utilization></cpu-usage>
</datastore-contents-xml>
</push-update>
</notification>
If the information element to which a subscription is made is empty, or if it is dynamic, for example, a named
access list, and does not exist, the periodic update will be empty and will have a self-closing
datastore-contents-xml tag. The following is a sample RPC message in which the periodic update is empty:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2017-05-09T21:34:09.74Z</eventTime>
<push-update xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<subscription-id>2147483649</subscription-id>
<datastore-contents-xml />
</push-update>
</notification>
<mdt-oper-data xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-mdt-oper">
<mdt-subscriptions>
<subscription-id>2147485164</subscription-id>
<base>
<stream>yang-push</stream>
<encoding>encode-xml</encoding>
<period>100</period>
<xpath>/ios:native/router/ios-rip:rip/ios-rip:version</xpath>
</base>
<type>sub-type-dynamic</type>
<state>sub-state-valid</state>
<comments/>
<updates-in>0</updates-in>
<updates-dampened>0</updates-dampened>
<updates-dropped>0</updates-dropped>
</mdt-subscriptions>
</mdt-oper-data>
</data>
</rpc-reply>
The following is sample output from the show telemetry ietf subscription dynamic brief command:
The following is sample output from the show telemetry ietf subscription subscription-ID detail command:
The following is sample output from the show telemetry ietf subscription all detail command:
Device# show telemetry ietf subscription all detail
Stream: yang-push
Encoding: encode-kvgpb
Filter:
Filter type: xpath
XPath: /iosxe-oper:ios-oper-db/hwidb-table
Update policy:
Update Trigger: on-change
Synch on start: Yes
Dampening period: 0
Notes:
The following sample RPC shows how to retrieve subscription details uisng RESTCONF:
Subscription details can also be retrieved through a RESTCONF GET request to the
Cisco-IOS-XE-mdt-oper database:
URI:
https://10.85.116.28:443/restconf/data/Cisco-IOS-XE-mdt-oper: mdt-oper-data/mdt-subscriptions
Headers:
application/yang-data.collection+json, application/yang-data+json,
application/yang-data.errors+json
Content-Type:
application/yang-data+json
Returned output:
{
"Cisco-IOS-XE-mdt-oper:mdt-subscriptions": [
{
"subscription-id": 101,
"base": {
"stream": "yang-push",
"encoding": "encode-kvgpb",
"source-vrf": "",
"no-synch-on-start": false,
"xpath": "/iosxe-oper:ios-oper-db/hwidb-table"
},
"type": "sub-type-static",
"state": "sub-state-valid",
"comments": "",
"updates-in": "0",
"updates-dampened": "0",
"updates-dropped": "0",
"mdt-receivers": [
{
"address": "5.28.35.35",
"port": 57555,
"protocol": "grpc-tcp",
"state": "rcvr-state-connecting",
"comments": "Connection retries in progress",
"profile": ""
}
]
}
]
}
Standard/RFC Title
Custom Subscription to Event Notifications https://tools.ietf.org/id/
draft-ietf-netconf-subscribed-notifications-03 draft-ietf-netconf-subscribed-notifications-03.txt
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
Model-Driven Telemetry gNMI Cisco IOS XE Gibraltar 16.12.1 Telemetry updates that are sent to
Dial-In the initiator/subscriber are called
Dial-in.
This feature was implemented on
the following platforms:
• Cisco Catalyst 9200 and
9200L Series Switches
• Cisco Catalyst 9300 and
9300L Series Switches
• Cisco Catalyst 9400 Series
Switches
• Cisco Catalyst 9500 and
9500-High Performance Series
Switches
• Cisco Catalyst 9600 Series
Switches
• Cisco cBR-8 Converged
Broadband Router
Model-Driven Telemetry gRPC Cisco IOS XE Gibraltar 16.10.1 Configured subscriptions cause the
Dial-Out publisher to initiate connections to
receivers, and these connections are
considered as dial-out.
This feature was implemented on
the following platforms:
• Cisco 1000 Series Integrated
Services Routers
• Cisco 4000 Series Integrated
Services Routers
• Cisco ASR 1000 Series
Aggregation Services Routers
• Cisco ASR 900 Series
Aggregation Services Routers
• Cisco ASR 920 Series
Aggregated Services Router
• Cisco Catalyst 9200 and
9200L Series Switches
• Cisco Catalyst 9300 and
9300L Series Switches
• Cisco Catalyst 9400 Series
Switches
• Cisco Catalyst 9500 and
9500-High Performance Series
Switches
• Cisco cBR-8 Converged
Broadband Router
• Cisco Cloud Services Router
1000V Series
• Cisco Network Convergence
System 520 Series
• Cisco Network Convergence
System 4200 Series
Model-Driven Telemetry: Kill Cisco IOS XE Gibraltar 16.11.1 To delete dynamic subscriptions,
Subscription you can use the CLI and the
kill-subscription RPC.
• Cisco ASR 900 Series
Aggregation Services Routers
• Cisco ASR 920 Series
Aggregated Services Router
(RSP2)
• Cisco Catalyst 3650 Series
Switches
• Cisco Catalyst 3850 Series
Switches
• Cisco Catalyst 9200 and
9200L Series Switches
• Cisco Catalyst 9300 and
9300L Series Switches
• Cisco Catalyst 9400 Series
Switches
• Cisco Catalyst 9500 and
9500-High Performance Series
Switches
• Cisco Network Convergence
System 520 Series
• Cisco Network Convergence
System 4200 Series
Series Cloud Services Routers. Similarly, an update package built for Cisco IOS XE Fuji 16.7.1 cannot be
applied on a device that runs the Cisco IOS XE Everest 16.5.2 version.
All contents of an update package will be part of future mainline or maintenance release images. The image
and platform versions are checked by the In-Service Model Update commands during the package add and
activate. If an image or platform mismatch occurs, the package install fails.
If NETCONG-YANG is enabled during package activation, NETCONF processes are restarted. All active
NETCONF sessions are killed during package activation. Failure during a package verification terminates
the activation process.
When you deactivate an update, if more than one model update package is installed, the most recently committed
model update package becomes the model package used by the device. If there are no other previously
committed model packages, then the base version of data models included with the standard image is used.
DETAILED STEPS
Step 2 install add file tftp: filename Copies the model update package from a remote location
(via FTP, TFTP) to the device, and performs a compatibility
Example:
check for the platform and image versions.
Device# install add file
tftp://172.16.0.1//tftpboot/folder1/ • You can use other methods to copy the update package
isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin from the remote location to the device, however; you
Device# install add file still have to execute the install add command before
tftp://172.16.0.1//tftpboot/folder1/ the package is activated.
asr1000-universalk9.2017-08-23_17.48.0.CSCxxxxxxx.SSA.dmp.bin
Step 3 install activate file bootflash: filename Validates whether the update package is added through the
install add command, and restarts the NETCONF processes.
Example:
Device# install activate file bootflash: • Perform the install add operation prior to activating
isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin an update package.
Device# install activate file bootflash:
asr1000-universalk9.2017-08-23_17.48.0.CSCxxxxxxx.SSA.dmp.bin
Step 5 install deactivate file bootflash: filename Deactivates the specified update package, and restarts the
NETCONF processes.
Example:
Step 7 install rollback to {base | committed | id commit-ID} Rollbacks the update to the base version, the last committed
version, or a known commit ID, and restarts NETCONF
Example:
processes.
Device# install rollback to base
• Valid values for the commit-id argument are from 1
to 4294967295.
• Older versions of data models updates are available
for use.
Step 8 install remove {file bootflash: filename | inactive} Removes the specified update package from the bootflash.
Example: • A package must be deactivated before it is removed.
Device# install remove file bootflash:
isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Device# install remove file bootflash:
asr1000-universalk9.2017-08-23_17.48.0.CSCxxxxxxx.SSA.dmp.bin
Step 9 show install summary Displays information about the active package.
Example: • The output of this command varies according to the
Device# show install summary install commands that are configured.
The sample image used in the following examples are a Cisco ASR1000 Series Aggregated Services
Router image.
The following example shows how to add a model update package file:
Device# install add file tftp://172.16.0.1//tftpboot/folder1/
asr1000-universalk9.2017-08-23_17.48.0.CSCxxxxxxx.SSA.dmp.bin
The following is sample output from the show install summary command after adding an update
package file to the device:
Device# show install summary
Active Packages:
No packages
Inactive Packages:
bootflash: isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Committed Packages:
No packages
Uncommitted Packages:
No packages
Device#
The following example shows how to activate an added update package file:
Device# install activate file bootflash:
isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
The following sample output from the show install summary command displays the status of the
model package as active and uncommitted:
Device# show install summary
Active Packages:
bootflash:isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Inactive Packages:
No packages
Committed Packages:
No packages
Uncommitted Packages:
bootflash:isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Device#
The following example shows how to execute the install commit command:
Device# install commit
install_commit: START Sun Feb 26 06:46:48 UTC 2017
SUCCESS: install_commit Sun Feb 26 06:46:52 UTC 2017
Device#
The following sample output from the show install summary command displays that the update
package is now committed, and that it will be persistent across reloads:
Device# show install summary
Active Packages:
bootflash:isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Inactive Packages:
No packages
Committed Packages:
bootflash:isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Uncommitted Packages:
No packages
Device#
The following example shows how to rollback an update package to the base package:
Device# install rollback to base
The following is sample output from the show install package command:
Device# show install package bootflash:
isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Name: isr4300-universalk9.16.05.01.CSCxxxxxxx.dmp.bin
Version: 16.5.1.0.199.1484082952..Everest
Platform: ISR4300
Package Type: dmp
Defect ID: CSCxxxxxxx
Package State: Added
Supersedes List: {}
Smu ID: 1
Device#
The following sample NETCONF hello message verifies the new data model package version:
The following is sample output from the show install log command:
Device# show install log
The sample image used in the following examples are a Cisco Catalyst 3000 Series Switch image.
The following example shows how to add a model update package file:
The following sample output from the show install summary command displays that the update
package is now committed, and that it will be persistent across reloads:
Device# show install summary
Active Packages:
bootflash:cat3k_caa-universalk9.16.06.01.CSCxxxxxxx.dmp.bin
Inactive Packages:
No packages
Committed Packages:
bootflash:cat3k_caa-universalk9.16.06.01.CSCxxxxxxx.dmp.bin
Uncommitted Packages:
No packages
Device#
In-Service Model Update Cisco IOS XE Everest This module describes how to update YANG
16.5.1a data models through In-Service Model Update.
Cisco IOS XE Everest In Cisco IOS XE Everest 16.5.1a, this feature
16.5.1b was implemented on the following platforms:
• Cisco Catalyst 9300 Series Switches
• Cisco Catalyst 9500 Series Switches
Cisco IOS XE Everest 16.6.1 In Cisco IOS XE Everest 16.5.1b, this feature
was implemented on the following platforms:
• Cisco Catalyst 3650 Series Switches
• Cisco Catalyst 3850 Series Switches
Cisco IOS XE Fuji 16.7.x In Cisco IOS XE Fuji 16.7.x, this feature was
implemented on the following platform:
• Cisco 1000 Series Aggregated Services
Routers
Cisco IOS XE Fuji 16.8.1a In Cisco IOS XE Fuji 16.8.1a, this feature was
implemented on Cisco Catalyst 9500-High
Performance Series Switches
This module describes the Application Hosting feature and how to enable it.
• Restrictions for Application Hosting, on page 235
• Information About Application Hosting, on page 236
• How to Configure Application Hosting, on page 238
• Verifying the Application-Hosting Configuration, on page 250
• Configuration Examples for Application Hosting, on page 254
• Additional References, on page 256
• Feature Information for Application Hosting, on page 257
The application-hosting container that is referred to as the virtualization environment is provided to run a
guest application on the host operating system. The Cisco IOS-XE virtualization services provide manageability
and networking models for running a guest application. The virtualization infrastructure allows an administrator
to define a logical interface that specifies the connectivity between the host and the guest. Cisco IOx maps
the logical interface into a Virtual Network Interface Card (vNIC) that the guest application uses.
Applications that are to be deployed in the containers are packaged as TAR files. The configuration that is
specific to these applications is also packaged as part of the TAR files.
The management interface on the device connects the application-hosting network to the Cisco IOS management
interface. The Layer 3 interface of the guest application receives the Layer 2-bridged traffic from the Cisco
IOS management interface. The management interface connects to the container interface through the
management bridge. The IP address of the application must be on the same subnet as the management interface
IP address.
Note On all Cisco Catalyst stack and stackwise virtual models (all software versions), Guest Shell and
AppGigabitEthernet only operate on the active switch in the stack. Therefore, the configurations for the
AppGigabitEthernet interface must be applied to the AppGigabitEthernet interface on each switch in the stack.
If the configurations are not applied to all switches, the AppGigabitEthernet interface will not work after a
switchover.
For application hosting, you can configure the front-panel port as either a trunk interface or a VLAN-specific
interface. When using as a trunk interface, the front-panel port is extended to work as a Layer 2 trunk port,
and all the traffic received by the port is available to the application. When using the port as a VLAN interface,
the application is connected to a specific VLAN network.
Note When using a back-panel USB or an M2 SATA drive for application hosting, the storage medium should be
formatted as an ext4 filesystem.
Cisco IOS Network Address Translation (NAT) Supported through the hardware data-port features
applied on the front-panel data ports and on the
AppGigabitEthernet port.
SUMMARY STEPS
1. enable
2. configure terminal
3. iox
4. username name privilege level password {0 | 7 | user-password}encrypted-password
5. end
DETAILED STEPS
Step 4 username name privilege level password {0 | 7 | Establishes a username-based authentication system and
user-password}encrypted-password privilege level for the user.
Example: • The username privilege level must be configured as
Device(config)# username cisco privilege 15 15.
password 0 ciscoI
to the container's Ethernet 2 interface. Also, in this configuration mode, VLAN encapsulation is terminated
so that the container receives only untagged frames.
You can configure an app-ID either in application-hosting trunk configuration mode or application-hosting
VLAN-access configuration mode.
SUMMARY STEPS
1. enable
2. configure terminal
3. interface type number
4. switchport mode allowed vlan vlan-ID
5. switchport mode trunk
6. exit
7. app-hosting appid name
8. app-vnic AppGigEthernet vlan-access
9. vlan vlan-ID guest-interface guest-interface-number
10. guest-ipaddress ip-address netmask netmask
11. end
DETAILED STEPS
Step 3 interface type number Configures the interface and enters interface configuration
mode.
Example:
Device(config)# interface AppGigabitEthernet 1/0/1 • For stackable switches, the number argument is
switch-number/0/1.
Step 4 switchport mode allowed vlan vlan-ID Configures the list of VLANs allowed on the trunk.
Example:
Device(config-if)# switchport mode allowed vlan
10-12,20
Step 5 switchport mode trunk Sets the interface into permanent trunking mode and
negotiates to convert the neighboring link into a trunk link.
Example:
Device(config-if)# switchport mode trunk
Step 8 app-vnic AppGigEthernet vlan-access Configures a VLAN port as the front-panel port for
application hosting, and enters application-hosting
Example:
VLAN-access configuration mode.
Device(config-app-hosting)# app-vnic
AppGigEthernet vlan-access
Step 9 vlan vlan-ID guest-interface guest-interface-number Configures a VLAN guest interface and enters
application-hosting VLAN-access IP configuration mode.
Example:
Device(config-config-app-hosting-vlan-access)# • Multiple VLAN-to-guest interface mapping is
vlan 10 guest-interface 2 supported.
Step 10 guest-ipaddress ip-address netmask netmask (Optional) Configures the static IP address.
Example:
Device(config-config-app-hosting-vlan-access-ip)#
guest-ipaddress 192.168.0.2
netmask 255.255.255.0
SUMMARY STEPS
1. enable
2. configure terminal
3. interface type number
4. switchport mode allowed vlan vlan-ID
5. switchport mode trunk
6. exit
7. app-hosting appid name
8. app-vnic AppGigEthernet trunk
9. guest-interfaceguest-interface-number
10. end
DETAILED STEPS
Step 3 interface type number Configures the interface and enters interface configuration
mode.
Example:
Device(config)# interface AppGigabitEthernet 1/0/1 • For stackable switches, the number argument is
switch-number/0/1.
Step 4 switchport mode allowed vlan vlan-ID Configures the list of VLANs allowed on the trunk.
Example:
Device(config-if)# switchport mode allowed vlan
10-12,20
Step 5 switchport mode trunk Sets the interface into permanent trunking mode and
negotiates to convert the neighboring link into a trunk link.
Example:
Device(config-if)# switchport mode trunk
Step 8 app-vnic AppGigEthernet trunk Configures a trunk port as the front-panel port for an
application, and enters application-hosting
Example:
trunk-configuration mode.
Device(config-app-hosting)# app-vnic
AppGigEthernet trunk
Starting an Application
The start command in application-hosting configuration mode is equivalent to the app-hosting activate
appid and app-hosting start appid commands.
The no start command in application-hosting configuration mode is equivalent to the app-hosting stop appid
and app-hosting deactivate appid commands.
Note If the start command is configured before an application is installed, and then the install command is
configured, Cisco IOx automatically performs internal activate and start actions. This allows the application
to be automatically started by configuring the install command.
SUMMARY STEPS
1. enable
2. configure terminal
3. app-hosting appid application-name
4. start
5. end
DETAILED STEPS
Lifecycle of an Application
The following EXEC commands take you through an application's lifecycle.
Note If any configuration changes are made after an application is installed, the application in the running state
will not reflect these changes. The application must be explicitly stopped and deactivated, and then activated
and started again for the configuration changes to take effect.
SUMMARY STEPS
1. enable
2. app-hosting install appid application-name package package-path
3. app-hosting activate appid application-name
4. app-hosting start appid application-name
5. app-hosting stop appid application-name
6. app-hosting deactivate appid application-name
7. app-hosting uninstall appid application-name
DETAILED STEPS
Step 2 app-hosting install appid application-name package Installs an application from the specified location.
package-path
• An application can be installed from a local storage
Example: location such as, flash, bootflash, usbflash0, usbflash1,
Device# app-hosting install appid iox_app package and harddisk.
usbflash1:my_iox_app.tar
SUMMARY STEPS
1. enable
2. configure terminal
3. app-hosting appid application-name
4. app-resource docker
5. run-opts options
6. end
DETAILED STEPS
2. Based on the application's Linux support, use the standard Linux interface configuration commands:
- ifconfig dev IFADDR/subnet-mask-length
Or
- ip address {add|change|replace} IFADDR dev IFNAME [ LIFETIME ] [ CONFFLAG-LIST ]
• Enable the Dynamic Host Configuration Protocol (DHCP) in the container, and configure the DHCP
server and relay agent in the Cisco IOS configuration.
• Cisco IOx provides a DHCP client to run within the application container that is used for an
application DHCP interface.
SUMMARY STEPS
1. enable
2. configure terminal
3. interface gigabitethernet0/0
4. vrf forwarding vrf-name
5. ip address ip-address mask
6. exit
7. app-hosting appid name
8. app-vnic management guest-interface network-interface
9. end
DETAILED STEPS
Step 4 vrf forwarding vrf-name Associates a Virtual Routing and Forwarding (VRF)
instance or a virtual network with an interface or
Example:
subinterface.
Device(config-if)# vrf forwarding Mgmt-vrf
• Mgmt-vrf is automatically set for the management
interface on the Cisco Catalyst 9000 Series Switch.
Step 8 app-vnic management guest-interface network-interface Connects the guest interface to the management port, and
enters application-hosting management-gateway
Example:
configuration mode.
Device(config-app-hosting)# app-vnic management
guest-interface 1 • The management keyword specifies the Cisco IOS
management GigabitEthernet0/0 interface that is
connected to the container.
• The guest-interface network-interface
keyword-argument pair specifies the container's
internal Ethernet interface number that is connected
to the Cisco IOS management interface. The example
provided here uses guest-interface 1 for the container's
Ethernet 1 interface.
You can configure the IP address of a container through Cisco IOS CLIs.
SUMMARY STEPS
1. enable
2. configure terminal
3. app-hosting appid name
4. name-server# ip-address
5. app-vnic management guest-interface interface-number
6. guest-ipaddress ip-address netmask netmask
7. exit
8. app-default-gateway ip-address guest-interface network-interface
9. end
DETAILED STEPS
Step 4 name-server# ip-address Configures the Domain Name System (DNS) server.
Example:
Device(config-app-hosting)# name-server0 10.2.2.2
Step 6 guest-ipaddress ip-address netmask netmask Configures the management guest interface details.
Example:
Device(config-app-hosting-mgmt-gateway)#
guest-ipaddress 172.19.0.24
netmask 255.255.255.0
SUMMARY STEPS
1. enable
2. configure terminal
3. app-hosting appid name
4. app-resource profile name
5. cpu unit
6. memory memory
7. vcpu number
8. end
DETAILED STEPS
Step 3 app-hosting appid name Enables application hosting and enters application-hosting
configuration mode.
Example:
Device(config)# app-hosting appid iox_app
Step 4 app-resource profile name Configures the custom application resource profile, and
enters custom application resource profile configuration
Example:
mode.
Device(config-app-hosting)# app-resource profile
custom • Only the custom profile name is supported.
Step 5 cpu unit Changes the default CPU allocation for the application.
Example: • Resource values are application specific, and any
Device(config-app-resource-profile-custom)# cpu adjustment to these values must ensure that the
7400 application can run reliably with the changes.
Step 7 vcpu number Changes the virtual CPU (vCPU) allocation for the
application.
Example:
Device(config-app-resource-profile-custom)# vcpu
2
SUMMARY STEPS
1. enable
2. show iox-service
3. show app-hosting detail
4. show app-hosting device
5. show app-hosting list
6. show interfaces trunk
7. show controller ethernet-controller AppGigabitEthernet interface-number
DETAILED STEPS
Step 1 enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Example:
Device> enable
State : Running
Author : Cisco Systems, Inc
Application
Type : vm
App id : Wireshark
Name : Wireshark
Version : 3.4
Activated Profile Name : custom
Description : Ubuntu based Wireshark
Resource Reservation
Memory : 1900 MB
Disk : 10 MB
CPU : 4000 units
VCPU : 2
Attached devices
Type Name Alias
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––--
Serial/shell
Serial/aux
Serial/Syslog serial2
Serial/Trace serial3
Network Interfaces
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
eth0:
MAC address : 52:54:dd:80:bd:59
IPv4 address
eth1:
MAC address : 52:54:dd:c7:7c:aa
IPv4 address
App id State
–––––––––––––––––––––––––––––––––––––––--
Wireshark Running
Building configuration...
0 1 collision frames
0 2 collision frames
0 3 collision frames
0 4 collision frames
0 5 collision frames
0 6 collision frames
0 7 collision frames
0 8 collision frames
0 9 collision frames
0 10 collision frames
0 11 collision frames
0 12 collision frames
0 13 collision frames
0 14 collision frames
0 15 collision frames
0 Excess collision frame
This example shows how to manually configure the IP address for an application.
Device# configure terminal
Device(config)# interface gigabitethernet 0/0
Device(config-if)# vrf forwarding Mgmt-vrf
Device(config-if)# ip address 198.51.100.1 255.255.255.254
Device(config-if)# exit
Device(config)# app-hosting appid iox_app
Device(config-app-hosting)# app-vnic management guest-interface 1
Device(config-app-hosting-mgmt-gateway)# end
Additional References
Related Documents
USB3.0 SSD on Cisco Catalyst 9300 Series Switches Configuring USB 3.0 SSD
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, including http://www.cisco.com/support
documentation and tools for troubleshooting and resolving technical issues
with Cisco products and technologies.
To receive security and technical information about your products, you can
subscribe to various services, such as the Product Alert Tool (accessed from
Field Notices), the Cisco Technical Services Newsletter, and Really Simple
Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a Cisco.com user
ID and password.
Application Hosting: Cisco IOS XE Gibraltar Introduces datapath connectivity between the
Front-Panel Network Port 16.12.1 Application Hosting container and the
Access front-panel network ports. Also enables ZTP
Cisco IOS XE Amsterdam
functionality on the front-panel network.
17.1.1
• In Cisco IOS XE Gibraltar 16.12.1, this
feature was implemented on Cisco
Catalyst 9300 Series Switches.
• In Cisco IOS XE Amsterdam 17.1.1, this
feature was implemented on Cisco
Catalyst 9400 Series Switches.
Application Hosting: Cisco IOS XE Gibraltar Introduces datapath connectivity between the
Front-Panel USB Port Access 16.12.1 Application Hosting container and the
front-panel USB port.
Cisco IOS XE Amsterdam
17.1.1 • In Cisco IOS XE Gibraltar 16.12.1, this
feature was implemented on Cisco
Catalyst 9300 Series Switches.
• In Cisco IOS XE Amsterdam 17.1.1, this
feature was implemented on Cisco
Catalyst 9400 Series Switches.
OpenFlow Controller
The OpenFlow controller is an entity that interacts with an OpenFlow switch using the OpenFlow protocol.
In most cases, a controller is a software that manages many OpenFlow logical switches. Controllers offer a
centralized view of the network, and enable administrators to dictate to the underlying systems (switches and
routers) on how to handle the network traffic. A controller typically runs on a Linux server, and must have
IP connectivity to OpenFlow-capable switches.
A controller manages a switch, and inserts and deletes the flows on the switch. These flows support a subset
of OpenFlow 1.3 and 1.0 match and action criteria.
The switch connects to the controller using the management port. The management port is in the management
virtual routing and forwarding (VRF) instance, and hence provides a secure connection to the controller. To
connect a controller to the switch, configure the IP address and port number on which the controller can be
reached.
Flow Management
A flow entry is an element in a flow table that is used to match and process packets. It contains priority levels
for matching precedence, a set of match fields for matching packets, a set of instructions to apply, and packet
and byte counters. A timeout is also associated with each flow (a hard timeout or an inactivity timeout), which
is used to automatically remove flows.
Cisco Catalyst 9000 Series Switches support a maximum of nine flow tables.
Each flow provides the following information:
• Priority: High-priority flows are matched first. A flow update requires all the flows to be prioritized
based on the configured priority.
• Match fields: A part of a flow entry against which a packet is matched. Match fields can match the various
packet header fields. If no match information is provided for a field, a wildcard is used.
OpenFlow Pipeline
An OpenFlow pipeline is a set of linked flow tables that provide matching, forwarding, and packet modification
in an OpenFlow switch. A port is where packets enter and exit the pipeline.
Packets are received on an ingress port and processed by the OpenFlow pipeline that forwards it to output
ports. The packet ingress port is owned by the packet throughout the pipeline, and represents the port on which
the packet was received into the switch. Note that the ingress port can also be used as a match field in a flow.
Flow actions allow packets to be sent to subsequent tables in the pipeline for further processing, and allow
information to be communicated between tables. Pipeline processing stops when the action associated with
a matching flow entry does not specify the next table. At this point, the packet is usually modified and
forwarded. The packet can also be dropped.
Flow tables of an OpenFlow switch are sequentially numbered, starting from 0. Pipeline processing always
starts by matching the packet against flow entries of flow table 0. Other flow tables can be used depending
on the outcome of the match and actions in the first table, which could result in matching the packet against
flow entries in subsequent tables.
VLAN ID — 0x13f
IPv4 source address Ethernet type should be Yes 10.0.0.0/24 (with mask)
set to 0x0800
IPv4 destination address Ethernet type should be Yes 10.0.0.254 (without mask)
set to 0x0800
Incoming interface — — —
Supported Actions
A flow can send a packet to:
• The controller.
• Any interface of the switch (including the incoming interface).
• A subsequent flow table (after Table 0) for another lookup.
• A group.
• The switch CPU for local processing. Only Cisco Discovery Protocol and Link Layer Discovery Protocol
(LLDP) packets can be sent for local processing.
A flow can add (push) or remove (pop) a VLAN tag. If a packet is an IP packet, the flow can decrement the
Time to Live (TTL) header field.
Flow Operations
This section describes the operations that take place when a flow is sent by the controller to be programmed
in the OpenFlow device.
Typically a device has flow tables arranged in a pipeline. The pipeline capabilities information specifies the
structure of the pipeline, such as the number of tables or stages, what each stage is capable of doing (match
or actions), and the size of each table.
When the controller sends a flow request, the OpenFlow agent verifies whether the flow can be handled by
the hardware. It compares the flow against the capabilities of the hardware that are defined when the switch
is booted up. If the flow is valid, it is programmed in the appropriate flow table.
If the new pipeline is validated (whether the hardware can support the pipeline), it becomes the new set of
capabilities used to check if a flow can be installed or not.
After the pipeline is instantiated and flows are installed, packets are forwarded by the switch. Ingress packets
are matched against the flows in each flow table, until the highest-priority matching flow entry is found. Packet
matching may be exact (match all fields of the table exactly), or partial (match some or all fields, and fields
with bit masks may be partially matched). Packets can be modified or forwarded based on the configured
actions. Actions can be applied in the pipeline at any time. An action can determine the next flow table to
match, the set of egress ports for the packet, and whether the packet should be routed to the controller.
SUMMARY STEPS
1. enable
2. configure terminal
3. boot mode openflow
4. exit
5. write erase
6. • delete flash:vlan.dat
• delete flash:stby-vlan.dat
7. reload
8. enable
9. show boot mode
DETAILED STEPS
Step 4 exit Exits global configuration mode and enters privileged EXEC
mode.
Example:
Device(config)# exit
Step 6 • delete flash:vlan.dat • Deletes the vlan.dat file that stores the VLAN
• delete flash:stby-vlan.dat information.
Example: • Deletes the stby-vlan.dat file, if you have a standby
Device# delete flash:vlan.dat device.
Device# delete flash:stby-vlan.dat
Step 7 reload Reloads the switch and enables OpenFlow forwarding mode
for the switch.
Example:
Device# reload
Step 9 show boot mode Displays information about the device's forwarding mode.
Example:
Device# show boot mode
Example
The following is sample output from the show boot mode command that shows the device in
OpenFlow mode:
Device# show boot mode
What to do next
To go back to normal mode, configure the no boot mode openflow command and then reload the device.
Configuring OpenFlow
SUMMARY STEPS
1. enable
2. configure terminal
3. feature openflow
4. openflow
5. switch 1 pipeline 1
6. controller ipv4 ip-address port port-number vrf vrf-name security {none | tls}
7. datapath-id ID
8. tls trustpoint local name remote name
9. end
DETAILED STEPS
Step 5 switch 1 pipeline 1 Configures a logical switch and pipeline, and enters
OpenFlow switch configuration mode.
Example:
Device(config-openflow)# switch 1 pipeline 1
Step 6 controller ipv4 ip-address port port-number vrf vrf-name Connects to a controller.
security {none | tls}
• You must configure the tls trustpoint command if
Example: you have configured TLS as the OpenFlow controller
Device(config-openflow-switch)# controller ipv4 connection security option.
10.2.2.2 port 6633 vrf Mgmt-vrf security tls
• You do not have to configure tls trustpoint command
if you have not configured any security option for the
OpenFlow controller.
Step 8 tls trustpoint local name remote name (Optional) Configures an OpenFlow switch Transport Layer
Security (TLS) trustpoint.
Example:
Device(config-openflow-switch)# tls trustpoint
local trustpoint1 remote trustpoint1
SUMMARY STEPS
1. enable
2. configure terminal
3. feature openflow
4. interface type number
5. switchport mode trunk
6. switchport nonnegotiate
7. no keepalive
8. spanning-tree bpdufilter enable
9. end
DETAILED STEPS
Step 4 interface type number Configures an interface and enters interface configuration
mode.
Example:
Device(config)# interface gigabitethernet 1/0/3
Step 5 switchport mode trunk Sets the trunking mode of the Layer 2-switched interface
to trunk.
Example:
Device(config-if)# switchport mode trunk
Step 6 switchport nonnegotiate Specifies that the device will not engage in negotiation
protocol on this interface.
Example:
Device(config-if)# switchport nonnegotiate
Step 8 spanning-tree bpdufilter enable Enables bridge protocol data unit (BPDU) filtering on the
interface.
Example:
Device(config-if)# spanning-tree bpdufilter enable
Verifying OpenFlow
Use these commands to verify your OpenFlow configuration. These commands can be used in any order.
SUMMARY STEPS
1. enable
2. show openflow hardware capabilities
3. show openflow switch 1 controller
4. show openflow switch 1 ports
5. show openflow switch 1 flows list
DETAILED STEPS
Step 1 enable
Example:
Device> enable
Pipeline ID: 1
Pipeline Max Flows: 2322
Max Flow Batch Size: 100
Statistics Max Polling Rate (flows/sec): 10000
Pipeline Default Statistics Collect Interval: 5
.
.
.
Flow: 1 Match: any Actions: goto_table:1, Priority: 9000, Table: 0, Cookie: 0x1,
Duration: 2382.117s, Packets: 34443, Bytes: 3359315
Additional References
Related Documents
Technical Assistance
Description Link
The Cisco Support website provides extensive online resources, http://www.cisco.com/support
including documentation and tools for troubleshooting and resolving
technical issues with Cisco products and technologies.
To receive security and technical information about your products,
you can subscribe to various services, such as the Product Alert
Tool (accessed from Field Notices), the Cisco Technical Services
Newsletter, and Really Simple Syndication (RSS) Feeds.
Access to most tools on the Cisco Support website requires a
Cisco.com user ID and password.
OpenFlow Power over Cisco IOS XE Gibraltar 16.12.1 PoE is supported on OpenFlow ports.
Ethernet
This feature was implemented on the following
platforms:
• Catalyst 9300 Series Switches
• Catalyst 9400 Series Switches