Get started on the path to network programmability with these tools and educational resources.
Automation is all the rage in IT these days, especially in networking, where overworked engineers are eager to reduce the time they spent on manual tasks. The keen interest in network automation was undeniable at Interop ITX, where a workshop on the topic drew a full house of IT pros.
Network automation involves things like standardizing network device configurations, ensuring all switches have same time and DNS service settings, Scott Lowe, one of the workshop leaders, said in an interview at Interop ITX. "What we're trying to do is drive out inconsistency from the network," he said. "Inconsistency is what bites us at 3 a.m. when there's an outage and there's that one switch in one location that's configured a little differently and causing problems."
By reducing manual effort and cutting down on all those little fires through automation, engineers can free themselves to work on more strategic projects, said Lowe, a well-known author and podcaster who is currently an engineering architect on the NSX team at VMware.
One of the biggest questions networking pros can have about network automation is how to get started. Lowe said there are a lot of different paths, depending on your background.
For example, if you have some programming experience, you could start developing Python scripts. Or if you have templating experience, you could write templates to create standard configurations for network devices. Meanwhile, someone with server expertise and familiar with configuration management tools might learn how to use an Ansible playbook for network automation.
To help you get started, we've collected some network automation tools, cheatsheets, and educational resources. Check them out and begin your journey today.
(Image: Photon photo/Shutterstock)
Git is a popular open source distributed version control system that you will want to use to manage your scripts, templates and other network automation work. It allows you to compare versions, manage who has access to files, and review proposed changes. Combining Git with GitHub and GitLab provides additional collaboration, review, and backup capabilities.
Basic Git commands
At Interop ITX, Lowe provided are some basic Git commands to get you started:
- git init – To initialize a new Git repository
- git clone – To make a copy of a repository for your use
- git add – To prepare changes to be committed to the repository
- git commit – To commit changes to the repository
- git push and git pull – To work with remote repositories like GitHub
In networking, Python is the popular choice among scripting languages. It's easy to learn and because of its wide, active community, there are a lot of readily available Python resources. Python was developed as a general-purpose language, which makes it highly versatile. An added plus: It doesn't have to be compiled, which speeds debugging.
Lowe teamed up with workshop co-presenter Jere Julian, DevOps for network evangelist and extensibility engineer for Arista Networks, to write a short tutorial on using Python for network automation.
As mentioned there are a lot of Python books and other materials available. Here are a couple top resources:
- Kirk Byers, CCIE #6243 Emeritus, has been teaching Python to network engineers since 2014. Starting Aug. 10, he'll offer a free 10-week email course on Python designed for network engineers with some familiarity with programming; no Python experience is required.
- Byers recommends this book: "Treading on Python, Vol. 1: Foundations of Python," written by Matt Harrison. The book, also is known by the title, "Beginning Python Programming: Learn Python in 7 Days," is designed to bring readers quickly up to speed on Python.
- Another popular Python book for beginners is "Learn Python the Hard Way," by Zed A. Shaw.
There are more than 110,000 software packages that can help in creating Python scripts, including Netmiko. Developed by Byers, the open source library is designed to simplify lower-level SSH management across a wide range of networking devices from various vendors including Cisco and Arista.
(Image source: Twin Bridges Technology)
Another software package that helps with Python scripts is Virtualenv, a tool for creating isolated Python environments. According to Julian, Virtualenv allows users to manage Python environments on a per-project basis, which eliminates the need for administrator credentials to install or updates modules, and also streamlines work with different projects.
Ansible, a configuration management and IT automation tool, has become popular among networking pros. It allows you to group devices by function and map configuration settings to roles, according to Julian. Ansible doesn't require an agent be installed on the device that's managed; it interacts with network devices using both CLI over SSH and when available, API transports. Ansible is open source with commercial support from RedHat.
Julian and Lowe wrote a step-by-step introductory guide to using Ansible for network automation.
Chef and Puppet
"Chef and Puppet use a Ruby-like Domain Specific Language (DSL) that defines a 'contract' with a server or network device. You specify files and packages that should exist, configuration state, and services that should be running or not. The tools handle the dirty work of how to ensure that contract is enforced."
Templates, which enable IT pros to define content of a file or network device configuration, are key tools for network automation. Julian and Lowe cited two common template formats: Embedded Ruby (ERB) and Jinja2, and noted that Jinja2 is particularly popular because of its close ties to Python and Ansible. Templates can help streamline network device configuration and improve consistency.
Network Automation and Programmability Abstraction Layer (NAPALM) is a library designed to create a standardized interface for certain file and get operations across a broad range of vendor platforms, according to Byers. NAPALM supports Cisco IOS, Arista EOS, Juniper JunOS, among others.
Blogs and other resources
Here are some other network automation resources:
- Matt Oswalt, one of the co-presenters of the network automation workshop at Interop ITX, blogs at Keeping it Classless.
- Network to Code, founded by Jason Edelman, offers live training and on-demand labs in network automation. Edelman also blogs about network automation.
- Networking luminary Ivan Pepelnjak, CCIE#1354 Emeritus, teaches an online course, "Building Network Automation Solutions."