I'm sure many of you had to compute summary network given a number of subnets. It's one of those rare occasions when you have to dust off binary maths skills that you had to pick up while learning ip address subnetting. In this blog post I want to discuss related problem, namely working out the largest prefix length needed to encompass provided prefix lengths. I realise it's a mouthful so I'll show some examples before moving onto solution and corresponding Python code. Contents Problem description Examples Solution and algorithm Python implementation Example usage GitHub repository with the source code Problem...
Tag: automation
Time for another post in the series on Pynetbox, awesome PythonAPI client for NetBox. In part 1 we learned how to retrieve information from NetBox, and how to work with objects returned by Pynetbox. In part 2 we've gone through object creation, where we learned how to check what fields are required and how to fill them to make NetBox happy. In this post we will talk about updating existing objects and deleting objects we no longer need. Unlike first two posts this one will be much shorter but should be no less exciting! Posts in the Pynetbox series: Pynetbox...
Welcome to the second post in the series dedicated to Pynetbox, Python API client for NetBox. In this episode I'll be talking about object creation and we'll go through a few code examples showing how can we add stuff to NetBox. Expect some cool Python code and unexpected plot twists! Posts in the Pynetbox series: Pynetbox - NetBox Python API client part 1 - getting info Pynetbox - NetBox Python API client part 2 - creating objects Pynetbox - NetBox Python API client part 3 - updates and deletions Pynetbox - NetBox Python API client part 4 - tags and...
NetBox is an open source IPAM/DCIM solution that came out of DigitalOcean. It's an excellent piece of software that is being actively developed and has very lively community. New features are being constantly added and I find it to be better than any of the commercial solutions available out there. If you never heard of it I strongly recommend having a look at the Github and Docs pages: https://github.com/digitalocean/netbox - NetBox Github repo https://netbox.readthedocs.io/en/stable/ - NetBox docs One of the great selling points of NetBox is well thought through and...
This is the second post in the series on Napalm validation in which we will explore more options available to us for writing validation tests. First part can be found here: NAPALM-Ansible - Automatic validation - part 1. First we'll make amendments to YAML files we used to describe desired LLDP state and see how it affects validation results. After that we'll introduce two more examples, one for checking BGP peerings, and one for verifying reported interfaces. Contents Partial string matching and regex BGP peering validation example Strict mode and 'list' key Listings of Playbooks GitHub repository with resources for...