Interacting with devices running Cisco IOS XR
Cisco IOS XR (http://www.cisco.com/c/en/us/products/ios-nx-os-software/ios-xr-software/index.html) is a distributed network operating system for service providers. It supports many devices to provide a cloud scale networking. It is known as a self-healing distributed networking operating system.
PyIOSXR
(https://github.com/fooelisa/pyiosxr) is a Python library used to manage the devices that are running IOS XR. In this recipe, we will install pyIOSXR
, mock a network, and coordinate it with a Python program based on pyIOSXR
.
Getting ready
First install pyIOSXR
:
$ sudo pip install pyIOSXR
How to do it...
Now you may connect to your device using Python as shown by the following code segment:
from pyIOSXR import IOSXR device = IOSXR(hostname='lab001', username='ejasinska', password='passwd', port=22, timeout=120) device.open()
You may test pyIOSXR
without an IOS XR device using the mock scripts provided by the project.
Checkout the source code from the...