Some random python scripts that I’ve created during my learning trail. These scripts focuses primarily on use-cases for Network Engineers. All examples are available on the python script examples GitHub repository.


Jupyter: an interactive web-based Python shell

Jupyter: an interactive web-based Python shell

I like to write about a tool today, that I used since several months to write python code for some smaller tasks: Jupyter. It provides a web-based python environment running on your local machine or on a server. This is very useful from my perspective to get started with python programming, play with new libraries and share scripts.
Reconfigure static ARP entries using ciscoconfparse

Reconfigure static ARP entries using ciscoconfparse

Today I'd like to show you another use case using the ciscoconfparse python module. During the migration from a Cisco VSS to a Cisco Nexus vPC pair, I need to translate a lot of static ARP entries from an existing configuration. To do this translation manually is not very effective, because the configuration is expressed differently in NX-OS compared to Cisco IOS. From my perspective, this is an ideal case for ciscoconfparse and python.
HTTP calls using the Python requests library

HTTP calls using the Python requests library

Within this post, I’ll dive deeper into the python code example, where I use the Cisco NX-API on Nexus 5500. We will have a closer look at the HTTP/HTTPs calls using the python requests library and on the interaction with HTTP based interfaces.
Implement HSRP using ciscoconfparse

Implement HSRP using ciscoconfparse

I like to show you this week a use case, which focuses on the work with existing configurations using the ciscoconfparse python module. The use case focuses on a quite common topic associated with campus networks: a later implementation of redundancy in the distribution (or aggregation) layer. At the end of this post, we’ll have created a configuration script for HSRP along with the readdressing of the VLAN switched virtual interface (SVI) interfaces based on the configuration from the existing switch.