Network Programming and Administration Using Python

Intermediate/Advanced 3 days

In this course you will learn to

  • Learn Python programming skills to write programs that manage and configure network devices
  • Write robust code for multi-tasking and multi-threaded operations
  • Install and use Paramiko, Netmiko, and NAPALM capabilities for managing and configuring network devices
  • Acquire network device information
  • Automate changes to network device configurations

Training materials

All Python training students will receive comprehensive courseware.

Suggested attendees

Systems and/or network administrators/engineers/technicians with some experience with fundamental Linux utilities and commands. Python programming experience and working knowledge of a vendor-specific network device (CLI) are useful, but not essential.

Course Outline

  • Introduction to Python data types and operations
    • Python program layout
    • Executing a Python program
    • Scalar variables and operations
    • Tuple and list array variables and operations
    • Dictionary variables and operations
    • Function creation and calling
  • Multi-tasking and multi-threading TCP/IP client/server Python programs
    • Python multi-tasking server
    • Avoiding zombie processes from a multi-tasking server
    • Python network client
    • Python multi-threading server
    • Avoiding zombie threads from a multi-threading server
    • Creating a daemon (server) process in Python
    • Implement a daemon-based multi-tasking or multi-threading server
  • Required setup for accessing network devices
    • Resource requirements for an accessible network device
    • Overview of EVE-NG setup for network device emulation
  • Obtaining network information and configuring network devices (Paramiko)
    • Overview of ParamikoSSH capabilities
    • Obtaining and installing the Paramiko SSH library
    • Initial connection to a network device via the SSH connect method
    • Sending and receiving network device information via Paramiko SSH methods
  • Obtaining network information and configuring network devices (Netmiko)
    • Overview of ParamikoSSH capabilities
    • Obtaining and installing the Paramiko SSH library
    • Initial connection to a network device via the SSH connect method
    • Sending and receiving network device information via Paramiko SSH methods
  • Obtaining network information and configuring network devices
    • Overview of NAPALM (Network Automation and Programmability Abstraction Layer)
    • Obtaining and installing the NAPALM library on Linux
    • NAPALM common API interface to establish a connection to a network device
    • Basic retrieval of state data from a network device
    • Loading, replacing, merging, and committing configuration changes
    • Rolling back committed changes
    • Ansible modules to drive NAPALM actions

No software needs to be installed for this class. The class will be conducted in a remote environment. Students need a local computer with a web browser (recent version of Microsoft Edge, Mozilla Firefox, or Google Chrome) and a stable Internet connection.