Archive

Category Archives for "Network-oriented programming"

Automating New Network Build – Part 2 (BGP)

In this post we’ll have a look at how to automate a typical BGP setup. This is where configuration may get particularly messy especially in presence of backdoor links and complex routing failover policies. However, as I will show, it is still possible to create a standard set of routing manipulation policies and selectively apply them to the required adjacencies to achieve the desired effect.

Continue reading

Network TDD Quickstart Guide

This post gives a quick overview of how to use network Test Driven Development framework. As an example I’ll use a simplified version of a typical enterprise network with a Data Centre/HQ and a Branch office. A new branch is being added and the task is to configure routing for that branch using a TDD approach. First we’ll devise a set of TDD scenarios to be tested and then, going through each one of them, modify routing to make sure those scenarios don’t fail (a so-called red-green-refactor approach)

Continue reading

Verifying TDD Scenarios

Now that Ansible has done all the information gathering for us it’s time to finally make use of it. In this post I will show how to use Ansible to run traceroutes from and to the hosts defined in a test scenario and perform verification of the results of those tests. Should any of those tests fail, Ansible will provide a meaningful description of what exactly failed and why. While doing all this I’ll introduce a couple of new Ansible features like conditional looping and interactive prompts.

Continue reading

IP Address Information Collection With Custom Ansible Modules

Ansible has a very neat feature called “fact gathering”, which collects useful information from hosts prior to executing any of the tasks and makes this information available for use within those tasks. Unfortunately, this also relies on Python being available on the remote machine which doesn’t work for Cisco IOS. In this post I’ll show how to write a simple module which will collect IP address information from remote devices and store it in global variable for future use. I’ll also show how to write a module which will convert our human-readable TDD scenarios into YAML structures. As always, full code repository is available on Github

Continue reading