Welcome to this Deep Dive on Network Configuration with Netmiko. Netmiko is a multi-vendor Python SSH library that simplifies the process of configuring and obtaining data from your network devices.

Within this guide you will learn how to use Netmiko to:

  • Obtain data from a device.
  • Configure a device.
  • Parse data into structured output.
  • Multithread Netmiko for scaling,
  • and much much more!

All of which you will perform on a 20 node multi-vendor lab!

Topics

  • What is Netmiko? (Free)
  • Installing Netmiko / Hands-on Labs (Members Only)
  • Connecting to the Device (Members Only)
    • Connection Handler
    • Context manager
    • Supported Devices
  • Sending Commands (Members Only)
    • Basic Usage
    • Expect String
  • Sending Config Commands (Members Only)
    • Config Set
    • Config from file
    • Save config
    • Commit config
  • Delay Factor Tuning (Members Only)
    • Delay Factor
    • Global Delay Factor
    • Fast CLI
  • TTP Parsing (Members Only)
    • Netmiko Parsing
    • TTP Overview
    • Dependencies
    • Python example
    • Custom template
  • TextFSM Parsing (Members Only)
    • TextFSM overview
    • NTC template library
    • Custom template
  • Genie Parsing (Members Only)
    • Genie overview
    • Dependencies
    • Genie template library
  • Logging (Free)
    • Per session
    • Global
  • Multithreading (Members Only)
    • Single-Threaded
    • Multi-Threaded
  • Netmiko-Foo Challenge (Members Only)
Netmiko - The What and the Why
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].The Whatnetmiko [https://github.com/ktbyers/netmiko] is a multi-vendor SSH Pythonlibrary that simplifies the process of connecting to network devices via SSH.This library adds vendor-specific logic to paramiko, which…
Netmiko - Hands-on Labs
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].To help you get hands-on and learn Netmiko, this guide provides you with thecode, examples and a lab to help you practise and hone your Netmiko skills! Let’s go… Installing NetmikoNetmiko can be installed via the Py…
Netmiko - Connecting to the Device
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].This section will first look at how you connect to a device using Nemiko, bothusing the standard method and using a context manager. We will then look at thedevice types that Netmiko support. Connection HandlerBefor…
Netmiko - Sending Commands
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].Within this section, we will look at the different Netmiko methods for sendingcommands to a device. The related scripts and code can be found within examples/sending. Basic UsageFirst of all, we can use send_command…
Netmiko - Device Configuration
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].Within this section we will look at the different Netmiko methods used forconfiguring a device - send_config_set() and send_config_from_file. Along withhow we can use Netmiko to save/commit our configuration. The rel…
Netmiko - Delay Factor Tuning
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].Delay Factor is a setting within Netmiko that allows you to alter the amount ofdelay that Netmiko will use when interacting with the device. This is useful insituations where a device or command responds slowly or whe…
Netmiko - TTP Parsing
This section will provide an overview of Netmiko parsing and then explore how wecan use TTP to parse our device output. The related scripts and code can be found within examples/parsing/ttp. Netmiko ParsingNetmiko provides the ability to parse the data returned from the device into aPython data…
Netmiko - TextFSM Parsing
Within this section, we will explore how we can use TextFSM to parse our deviceoutput, along with how to build a custom TextFSM parsing template. The related scripts and code can be found within examples/parsing/textfsm. TextFSM OverviewTextFSM [https://github.com/google/textfsm] is a Python mod…
Netmiko - Genie Parsing
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].This section will explore how we can use Cisco’s Genie to parse our deviceoutput. The scripts and code for this section can be found within examples/parsing/genie. Genie OverviewCisco’s PyATS/Genie [https://developer.cisco.com/docs/pyats/#…
Netmiko - Logging
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].Within this next section, we will look at how we can: * Debug our Netmiko executions, globally or on a per-session basis. * Improve performance when running Netmiko when running across multiple devices via the use…
Netmiko - Multithreading
This post is part of the Netmiko Guide [https://packetflow.co.uk/netmiko-guide].So far through this guide, we have run Netmiko against a single device. However,what about if we want to start running Netmiko across multiple devices? Thissection will look at how we can use multithreading to scale N…
Netmiko-Foo Challenge
We are now at the end of this guide, and it’s time to use what you have learntto achieve Netmiko-Foo level status! GoalPerform an audit of the running software versions across our multi-vendor fleet(aka the PacketFlow lab), by creating a Netmiko script. RequirementsThe requirements of our scri…