Chapter 4: Configuring Network Devices Using Netmiko
In Chapter 2, Connecting to Network Devices via SSH Using Paramiko, we saw how to connect to a network device via SSH using the Paramiko library. While we can do pretty powerful things such as executing commands against our devices using Paramiko, it was built as an SSH library, not a library to connect to and configure network devices. Enter netmiko, a library purpose-built to connect to and configure network devices using Python.
The netmiko library is build on top of Paramiko, hence the similarity in name, which abstracts away some of the quirks of dealing with SSH connections, including differing escape codes, and is purpose-built for connecting to and configuring network devices using either an SSH or telnet connection. This purpose-built abstraction becomes particularly useful when dealing with devices from different vendors and not with a homogeneous single-vendor deployment. Additionally, netmiko provides a nice set of...