Python for Network Automation (Python 202)

Managing networks can be repetitive and error‐prone, but Python can make incredible changes to how you automate with all major (and most minor) network vendors. This course is driven by lessons and labs designed to utilize Python libraries designed to interact with and configure your network devices. At the conclusion of this course, you’ll be empowered with the tools and skills necessary to take your network to the next level. This class is a combination of live demonstrations and hands‐on labs with virtual network devices and endpoints as targets for your configuration.

Course Information

Price: $2,395.00
Duration: 5 days
Certification: Alta3 Certified Python Networking Professional - A3CPNP
Exam: 
Learning Credits:
Course Delivery Options

Check out our full list of training locations and learning formats. Please note that the location you choose may be an Established HD-ILT location with a virtual live instructor.

Train face-to-face with the live instructor.

Access to on-demand training content anytime, anywhere.

Attend the live class from the comfort of your home or office.

Interact with a live, remote instructor from a specialized, HD-equipped classroom near you. An SLI sales rep will confirm location availability prior to registration confirmation.

All Sunset Learning dates are guaranteed to run!

Register

Prerequisites:

Python 101 ‐ Python Basics

 

Target Audience:

This course was written for networking professionals looking to expand their capabilities by automating their workload with Python. This includes Network Engineers, Network Architects, System Admins, DevOps Engineers, Cisco Certified Professionals (CCNA, CCNP, CCIE), and developers interested in network programmability with Python.

 

Course Objectives:

  • Sending HTTP Requests to APIs with builtin and 3rd party libraries
  • Opening Telnet Sessions with built-in libraries
  • Automating SSH commands with Paramiko
  • Performing ICMP Pings
  • Transforming Data between JSON, YAML, and Python
  • Retrieve and Push network device configuration via Netmiko and Napalm
  • Use Pandas to manipulate data in a variety of formats (CSV, Excel, JSON)
  • Database manipulation
  • Capturing and Parsing Network Traffic

 

Course Outline:

Reviewing Python Essentials

  • Version Controlling Code
  • Up and running with Python (installing on various platforms)
  • Lists
  • Dictionaries
  • File Input and Output
  • Functions
  • Methods
  • Review of the Standard Library
  • Using pip and pypi.org

Python and Data translation

  • JSON
    • Reading from files
    • Reading from API
  • YAML
    • Reading from files CSV
    • Reading from files
  • Excel
    • Using pyexcel library
    • Using pandas library

Python and RESTful APIs

  • RESTful APIs decoded
  • Reading attachments
  • API keying
  • Passing credentials securely
  • Standard Library Solution
  • 3rd party library solutions

Automating SMTP and Extended SMTP (Email)

  • SMTP
  • Extended SMTP
  • Automating Email solutions
  • Setting headers and creating a body
  • Attachments
  • Google Gmail considerations
  • Microsoft considerations

Python and Telnet

  • RFC 854 ‐ Telnet Protocol
  • Standard Library Solution

Python and SSH

  • Standard Library Solution
  • Paramiko
    • SSH Agents
    • Key exchange and authorization
    • Securing dealing with passwords
    • Configuration
    • SFTP
  • Passing commands and capturing responses
  • Parsing remote logs

Automating Switches and Routers with Python

  • Netmiko
  • Push / Pull Configuration
  • Retrieve information about devices
  • Manage the devices configuration
  • Connecting and Running a Command on a Networking Device
  • Enable & Global Config Mode
  • Configure a Networking Device from a File
  • Configuration Backup using Netmiko
  • VLAN & VXLAN management
  • BGP & OSPF Management
  • Solutions for HSRP, VRRP, and GLBP

Automating Networks with Python NAPALM

  • Installation
  • Tutorials
  • Validating deployments
  • Supported Devices
  • Command Line Tool
  • NetworkDriver
  • YANG
  • napalm‐logs
  • Integrations

Python and Network Captures

  • Wireshark
  • TCPDump
  • Decoding network captures with Python
  • *.pcap files
  • *.pcap‐ng files
  • Parsing network captures
  • Regular Expression Library

Optimizations and Security

  • Multiprocessing and Multithreading
  • Examples of running in parallel
  • Cost and Benefit Considerations
  • Secure hashes and digests
  • MD5, SHA, and OpenSSL Options
  • Encrypting content
  • Considerations for credentials
  • Securely passing input

Overview of Ansible (optional)

  • Relationship of Ansible and Python
  • Overview and Installing
  • Where YAML fits
  • Modules for Cisco, Juniper, Arista, and other major vendors
    • shell, raw, copy, file, apt, service, cli_command, cli_config
  • Constructing the playbook
  • Applications of Python versus Ansible

Hands-On Labs

  • Welcome to Alta3 Research Labs
  • Python for Network Automation – Certification Project
  • Using vim
  • Introduction to VScode
  • Tmux Basics
  • SCM with GitLab
  • Installing Python
  • Read from Files
  • Python Data to JSON
  • Python Data to YAML
  • Pandas dataframes with Excel, csv, json, HTML and beyond
  • CSV data – Standard Library and pandas dataframes
  • List and Dict Modeling
  • Interacting with APIs
  • APIs, pip, and requests
  • Restful Open APIS with Standard Library
  • Restful Open APIS with requests
  • Python for Network Captures and Wireshark
  • Examining Network Capture pcaps Files with termshark
  • Performing ICMP Checks
  • Automating SMTP
  • Exploring Network Interfaces
  • Web Scraping Data with Beautiful Soup
  • LECTURE – Automating Front-End Web Forms
  • Python Telnet Client
  • LECTURE – Introducing Paramiko
  • Paramiko and SFTP
  • Automating Commands Across SSH
  • LECTURE – Python to Cisco NX-OS
  • Netmiko for Router and Switch Automation
  • Lightweight Database Interactions
  • Getting Switch Configuration with NAPALM
  • Switch Validation and NAPALM
  • Building APIs with Python Flask
  • Building APIs with Django
  • Lecture – Introduction to CI CD with GitLab
  • Running Python in a Container
  • Lecture – CI CD with Python, Webhooks, and GitLab Runner
  • Lifecycling a Python App with GitLab
  • Testing Code with PyTest
  • Using Argparse
  • Controlling run time with Environmental Variables
  • Python and Regular Expression for Searching
  • Automating HTTP Requests
  • Automating HTTP Requests with Async IO
  • VMWare NSX Automation
  • scapy – Network Traffic as Code
  • Introduction to Ansible and Playbooks (OPTIONAL)
  • Retrieving Switch Config with Ansible (OPTIONAL)
  • Using Agnostic Networking Modules (OPTIONAL)
  • Glossary