Category: Network Automation

  • Here is a small but powerful automation tool that: This is a practical example of combining Network Automation + AI-driven operations. In order to use OpenAI API you should have credit there. Project Structure: testbed.yaml: Workflow Overview: Connect to device↓Run show ip interface brief↓Genie parses CLI → structured JSON↓Reduce JSON to only relevant fields↓Send structured…

  • pyATS is a powerful network automation and testing framework designed to help network engineers validate, test, and troubleshoot their infrastructures in a structured and reliable way. Instead of manually checking device configurations and network behavior, pyATS allows you to automate these tasks using Python, making your workflows faster, more consistent, and less error-prone. It is…

  • Nornir is a Python-based automation framework designed specifically for network engineers who want more control, flexibility, and scalability in their automation workflows. Unlike traditional tools that hide logic behind rigid abstractions, Nornir acts as a lightweight orchestration layer that lets you combine Python code with popular networking libraries such as Netmiko, Scrapli, NAPALM, and pyATS.…

  • Scrapli is a modern Python library for network automation that provides fast, flexible, and reliable communication with network devices. It is designed with a clean API, supports both synchronous and asynchronous workflows, and offers built-in parsing, logging, and interactive command handling. Scrapli allows us to send single commands or multiple commands to a network device…

  • If you work with network devices (Cisco, Juniper, Aruba, Fortinet, etc.) and you want simple, reliable SSH automation, Netmiko is one of the best Python libraries to start with. To install it use pip install netmiko. Netmiko uses a device dictionary and ConnectHandler() to create an SSH connection. We should specify the device type in…

  • Cisco Network Services Orchestrator is a Linux application which orchestrates the configuration life cycle of network devices. NSO uses software packages called Network Element Drivers (NEDs) to facilitate telnet, SSH, or API interactions with the devices that it manages. The NED provides an abstraction layer that reads in the device’s running configuration and parses it…

  • In this example I want to get the configuration of the routers with rest API in host file and save the config files in a folder. this line of the code: “outfile = Path(OUT_DIR) / f”{ip}_running-config.txt”” creates the file name using the router IP. And with “outfile.write_text(r.text, encoding=”utf-8″)” we are writing the value of the…

  • If we want to automate a network with many devices we have normally 4 files a python code, host files, config file and data file. In this example I want to automate BGP configuration of routers. So I prepare these 4 files. The first file is Host file which contains the IP of the devices,…

  • For cisco Switches there is another API framework called NX-API which we can manage them with. I am using a test device in cisco sandbox. at first we need to enable the nx-api feature on the device. Unlike postman, here we have only one URL which is /ins and also we use only POST. If…

  • I want to get the interface Gig2 with RESTCONF using Curl. -v is verbose so we can see the logs.-k is for certificate -H is for header and with +json we define the format of the data. Restconf is also enabled on the router. Using postman we can do the same thing easy. We just…