Category Archives: Networking & SDN

Netconf Python ncclient

In my earlier blogs, I had covered basics of Netconf and Yang and how to use Netconf to configure Cisco devices. Recently, I came across this Python ncclient library that simplifies the configuration/monitoring of Networking devices that supports Netconf. Using ncclient library, we can programmatically configure and monitor devices using Netconf. I also found out that Cisco Openstack Neutron plugin uses ncclient library to program the Nexus switches.

I have used Cisco Nexus 3k switch and Cisco VIRL NXOS switch for the examples in this blog.

In my earlier blog on configuring Cisco Nexus devices using Netconf, I covered the following netconf requests.

  1. “get” request using filter to display configuration.
  2. “edit-config” request to change configuration.
  3. “exec-command” to execute raw CLI requests.

In this blog, I will cover the above same tests using Python ncclient library. Even though the examples below are tried from Python interactive shell, the same can be executed as a Python program as well.

First step is to import the ncclient library and create a connection:

Continue reading Netconf Python ncclient

Connecting NXOS VIRL instance to Arista vEoS

In this blog, I will cover the steps that I did to connect Cisco NXOS VIRL switch instance to Arista vEoS switch instance. We can connect any Cisco switch simulated in VIRL, I just picked the NXOS switch type. CML/VIRL supports majority of Cisco switches as VM as well as few external switches from Juniper, Vyatta. External virtual or physical switches can be connected to Cisco switches running inside VIRL using VM Networking magic. I just think it is cool to connect Virtual devices, try out real-time network configurations and see how the device responds.

Prerequisites:

  • Install CML/VIRL using the procedure here.
  • Install vEoS using the procedure here.
  • I used VMPlayer to run VIRL and vEoS. Connecting across Virtualbox and VMWare player is little painful.

Following is the network I created:

Continue reading Connecting NXOS VIRL instance to Arista vEoS

Cisco NXAPI with VIRL

In this blog, I will cover the steps to get NXAPI working with NXOS image in VIRL. For more details on CML/VIRL, please refer to my earlier blog series. Running NXAPI with VIRL image makes it easy to write automation scripts without needing a physical switch.

Earlier, I had installed VIRL February release(0.9.17) which included the VIRL STD 0.10.13.11. To run NXAPI which is supported in NXOS 7.2.0 version, it is needed to upgrade VIRL to the latest version. I tried running NXOS 7.2.0 in VIRL 0.10.13.11. Even though I was able to enable “feature nxapi”, I was not able to configure management IP and be able to connect from outside.

VIRL’s latest April release(0.9.242) has the following components:

  • VM Maestro 1.2.2 Build Dev-211
  • VIRL STD 0.10.14.20

There are 2 approaches to upgrade VIRL.

  1. Full upgrade which upgrades both VIRL and OS related stuff.
  2. Quick upgrade which upgrades only VIRL. Based on the VIRL 0.9.242 upgrade note here, it is fine to do quick upgrade for users running VIRL STD 0.10.13.11. For folks outside Cisco, I am not sure if VIRL 0.9.242 is released outside.

Continue reading Cisco NXAPI with VIRL

Ansible for Arista EoS

This is a continuation of my previous blog on Arista Eapi. Ansible provides a recipe driven approach to manage servers/switches, I have covered Ansible in some of my previous blogs. In this blog, I will cover the following:

  • Ansible modules for Arista device
  • Ansible galaxy eos role for Arista device

There are 2 approaches to use Ansible with Arista device. Following picture from Arista illustrates this point:

arista2

  • The first approach is called remote approach from Ansible perspective. Here the ansible python script is transferred to Arista device using ssh and the python script is executed on the Arista device which connects locally to the device using Pyeapi which in turn talks through eapi.
  • The second approach is called local approach from Ansible perspective. Here the Ansible python script is run locally in the client machine which in turn talks to Pyeapi library which in turn talks to the remote device using eapi.
  • Typically, network devices dont allow running scripts directly on the device. In that case, only second option would be possible. In Arista’s case, there are no restrictions like this and both the approaches can be used for Ansible based automation.

Continue reading Ansible for Arista EoS

Arista Eapi and pyeapi

I had covered basics of Arista EoS and vEoS in my previous blog. Arista’s Eapi gives programmatic approach to manage Arista devices. Arista’s Pyeapi Python  library is built on top of Eapi. In this blog, I will cover the following:

  • Eapi
  • Pyeapi library

I have used Arista vEoS for trying out all examples below without needing a physical Arista device. That shows the power of virtual device.

There is lot of similarity between Arista’s Eapi and Cisco’s NXAPI. I covered NXAPI in 1 of my earlier blogs. Arista’s Eapi is equivalent to Cisco’s NXAPI, Arista’s Pyapi library is equivalent to Cisco’s Pycsco library. Arista’s Eapi provides http/https access to the Arista router/switch through which we can send standard CLI commands and the output is received in JSON/XML formatted output. There is no need to do screen scraping with this approach, this makes it devops friendly. Arista’ Pyeapi is available as a github project.

Eapi:

To enable Eapi in Arista device, do “management api http-commands” in config prompt. Following is the output in my Arista vEoS switch:

Continue reading Arista Eapi and pyeapi

Arista EoS and vEoS

I had heard some good things about Arista EoS(Extensible Operating System). I have never used Arista switches before. I did some reading on Arista EoS and I also tried their VEoS which is their Virtual machine offering for running Arista switch as VM. In this blog, I will share some of my experiences.

EoS Overview:

I found this block diagram in Arista White paper:

arista1

Following are the things that I liked:

Continue reading Arista EoS and vEoS

Ostinato Traffic generator

Every Network engineer would have used Ixia or Spirent for traffic generation. These are generally expensive. For majority of use cases, we need a simple protocol packet generator which can generate packet streams of various protocol types. The recent trend is to move traffic generation application into a VM formfactor. This is more suitable for virtual appliance testing. I recently came across this tool called “Ostinato” from Google and I found it very useful. Even Ixia and Spirent have their traffic generators in VM form factor. I will cover my Ostinato experiences in this blog.

Installing Ostinato:

I installed Ostinato in my Ubuntu 14.04 and 12.04 VM. For Ubuntu 14.04, Ostinato can be installed by:

sudo apt-get install ostinato

The above installs 0.5.1 version. To install later versions(0.6) or to install Ostinato in older Linux versions, use the procedure here.

Starting Ostinato:

Ostinato has a client, server model where servers can be run on multiple hosts and the client can connect to multiple servers. This allows a single client to manage ports present in multiple servers.

To start both client and server:

Continue reading Ostinato Traffic generator

Networking Debug tools

Earlier, I had written a blog on tools that I used with Opendaylight. In that blog, I covered Mininet, dpctl, packeth, Wireshark, Postman. I covered traffic generation tool Ostanito in another blog. There are few other miscellaneous networking tools that I use and I am planning to cover them in this blog. I will try to keep this blog updated as I come across more tools. I will cover the following tools in this blog.


iperf:
iperf is used for tcp and udp performance measurement.
Unicast TCP performance:

Continue reading Networking Debug tools

Cisco Meraki

Cisco acquired Meraki at the end of 2012. I have heard a lot about Meraki and I recently tried to dig deep into what they do. This blog is a result of that.

What does Meraki do?

Meraki does cloud managed access devices for the edge market. Their primary focus is small/medium enterprises. Meraki now has Wireless access points, access switches, security devices. In addition to this, Meraki also provides a mobile management application to remotely monitor and manage mobile devices. All Meraki’s devices have a management connectivity to their backend data center and the devices can be managed remotely. Following picture from Meraki shows the high level data plane/management plane model for all their devices. There is a management connectivity from each device to the backend data center and all centralized management is done from there. Even if the management connectivity is lost, data plane does not get affected.

meraki1

What are Meraki’s differentiators?

Continue reading Cisco Meraki

Cisco NXAPI

Earlier, I had written about Cisco NXOS device configuration/monitoring using Python and OnePK. Recently, I came across NXAPI approach to configure and monitor NXOS  devices. NXAPI uses either http/https to connect to NXOS devices and talk using NXOS CLI. For configuration, CLI is encoded in XML/JSON. For monitoring, CLI is encoded in XML/JSON and the results are returned in similar format that makes it easy to parse. I also saw this blog and nxos-ansible project from Jason where he has created Ansible modules using NXAPI. In this blog, I will cover NXAPI basics and my experience in trying Pycsco library and nxos-ansible modules from Jason. Thanks to Jason, he has done a nice job abstracting the NXAPI into higher level functions and Ansible modules and this can help others to build up on top of it rather than working from scratch.

Enabling NXAPI:

NXAPI is available on Nexus 3k and 9k devices. I have access to N3K device and I tried this there. To enable NXAPI, we need to execute “feature nxapi” from config prompt. NXAPI also provides a sandbox environment which can be accessed using http from the management ip address. With the sandbox environment, we can execute NXOS CLI commands and get output in JSON or XML format. Following image is a snapshot of the sandbox. Continue reading Cisco NXAPI