This will be in regards to Unit Testing, just grabbing lab screen snips for now This showing no result is correct because we don't want a JSON value returned, so time to write some actual unittest for python! Note below the unittest is using data "from" other scripts in the same directory! As seen below … Continue reading Week 1 of the DevNet Grind – Python Script “unittest” and “Pytest” for testing scripts with scripts Hands on Lab!
Intro to APIs API = Application Programming Interface, APIs define how users / developer / other applications can communicate with each other, API's will generally use web-services or web based communication however they can use unique protocols for proprietary APIs. API's not only provide communication, but also secured communication by several different methods, and all … Continue reading Week 2 of the Cisco DevNet Grind – EVERYTHING you will need for the DEVASC regarding REST APIs – Acronyms / Design / Status Codes / Webhooks / Troubleshooting!
Beginning with this Class I will be having a much more "scribbled notes" format! I started out trying to use a pen and notepad, but I thought to myself why in world would I not type out my notes in my study blog, even if they do look like a notebook full of quick notes … Continue reading Week 1 of the Cisco DevNet Grind – SDLC Methods, Design Patterns, GIT, Coding Basics, Code review / Unit Testing / Integration, TDD, and tons of info!
There is still some kind of crappy limitation with GNS3 and getting my Loopedback VLAN to communicate with the PC devices in ACME Co LAN - However I do have reachability on the Network Devices to play with some local configs in this lab! I have just recently started to use GNS3 and am not … Continue reading Python3 Network Programming – NAPALM for Network Device Configuration, lots of troubleshooting and good to knows for Network Engineers in this content (which will be continued)!
I was just going to watch the BGP series without taking notes on NAPALM, but its been so long since I've configured it from scratch I figured I could knock the rust off, below is a quick review of the configs in my Multi-AS BGP Topology I've created for this lab. Note - This … Continue reading Python3 Network Promgramming – Quick BGP configuration and demo of using NAPALM to get BGP information from network devices!
I'm going to build out this lab a little bit more using Netmiko scripting to push configs to SW1 so we get a bit more output to review, and we will also be using JSON within the script as well to make it more readable that a big mashed up blob of output! 🙂 First … Continue reading Python3 Network Programming – Building lab with Netmiko, using JSON formatting within the Py3 scripts for readability!
Time to burn through Multi-Vendor Environments using Python with NAPALM! I've spun up a new network, as I believe I am going to wade into the waters of doing some router configuration using NAPALM scripting coming up in later posts! Napalm is short for "Network Automation and Programmability Abstraction Layer with Multivendor Support" which is … Continue reading Python3 Network Programming – Review of NAPALM (what it is), some links with additional resources, and configuring a new lab for use with NAPALM configs!
To round off the Netmiko section of Python3, I'd like to show a script that will standardize the entire network here with NTP and Buffered Logging, as those two things should be absolutely configured on a network for troubleshooting purposes. The configs shown are very minimal, and definitely not best practice for production networks, which … Continue reading Python3 Network Programming – Deploying base NTP / Logging across entire network, best practices, and the raw script at the very end of the post!
Finally the power to Automate Network Device Standardization!!! In this demo I will actually be starting small, adding SW4 and SW5 to write a script similar to the last lab, only instead of sending config line by line, it will open a file on the NetAuto Host that will contain configs to be written. This … Continue reading Python3 Network Programming – Writing a script that calls a file to use within the script (and a lot of troubleshooting the script itself)!
Being as I have been tanking through just touching network devices with Python, I wanted to take a step back, and look at the components within the script that call out each others to function properly and how to start thinking about writing scripts freestyle that suits your needs and begin thinking diving deeper into … Continue reading Python3 Network Programming – Review of a Netmiko Python Script, Python Terminology, and how different pieces reference each other in a script!
Now that I have secured SSH in my previous post on this lab, I will continue forward using Netmiko that utilizes SSH for connections, so I will get right to it here. First to prep your NetAuto Host for Netmiko (this requires Internet Connection) The NetAuto host in GNS3 does not come with Netmiko modules … Continue reading Python3 Network Programming – Installing Python3-pip / Netmiko Module, writing Netmiko script, and executing it on the multi-switch lab / working through troubleshooting!
It is time to ditch the SSH and move onto Netmiko that would actually be used in most production networks, which involves a bit more than "enable ssh" if you have not turned it on before / turned off telnet, but I will demo it here of course via Automation! I am still continuing on … Continue reading Python3 Network Programming – Enabling SSHv2 and Disabling Telnet using Automation, and how to secure your network by enabling SSHv2 and disabling Telnet (very carefully)!
This will be a shorter demo, using the same Topology from the previous lab, to demonstrate writing a script for the NetAuto Host to telnet to switches to backup the running configs and in this demo writing them to the local NetAuto Host. This will be a pretty quick lab as the steps for using … Continue reading Python3 Network Programming – Creating a script to Automate getting backup configs from multiple network devices using my previous Topology!
I will be automating the three switches in the above Topology with a single script! But first an important note before reading: This simple demo took all of an hour or so to lab up and post here, Network Automation with Python is SUCH a powerful skillset to have at your disposal, it is ridiculous … Continue reading Python3 Network Programming – Creating a very simple script that automates unlimited devices, nesting loops within loops, and labs to demo how absolutely powerful Network Automation is!
I have created a new Topology consisting of just a switch to demonstrate using "Loops" and "Concatenation" to demonstrate how to create a ton of VLANs, using the Loop to define the "Iterations" or number of times the function is run, and using Concatenation to allow "Integers" and "Strings" in Python to play well together. … Continue reading Python3 Network Programming – Using loops to script VLAN configuration, explanation of Python terminology, and lab demo to see it work!