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!
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!
In continuing through Automating the Boring Stuff book, I thought posting some demonstrations of Loops and how to program them to avoid infinite program loops would be a critical concept to get documented to reflect on. First concept of Loops, using the "while" keyword rather than "if" statements While is a loop statement / expression … Continue reading Python – Configuring “While” and “For” Loop Types, “Continue” and “Break” statements, and range function reviewed!