
Learn how Python automates MikroTik firewall rules across two routers with one click. The teaser demonstrates applying scripted rules via Python to MikroTik RouterOS for secure, scalable network automation.
Python is a free, open source programming language with simple syntax and cross-platform support, taught here for network automation on MikroTik RouterOS using scripts to connect to devices.
Download and install Python on a Windows machine from python.org, using the latest 3.x version (3.9.0), add Python to the path, and verify with a small print script.
Install the PyCharm community edition on Windows, create a new project, configure the Python interpreter, and run Python scripts to test scripting and observe results.
Run your first Python script to connect to a MikroTik router via SSH, accept the fingerprint, and print the router output line by line before closing the connection.
Use a Python script to automate MikroTik router tasks, such as enabling the client on interface Internet five, and disabling unused services like FTP and Telnet, with script-driven verification.
Explore how to connect to multiple MikroTik routers from Python using Paramiko, build a router list, loop through devices, run commands, and apply configurations like firewall rules or BGP.
Configure OSPF on three MikroTik routers with a Python Paramiko script, enabling full-mesh neighbors, then verify via routing OSPF to ensure all interfaces run OSPF.
Explore Netmiko as a multi-vendor library that simplifies SSH connections to network devices, versus Paramiko's greater scripting complexity, with MikroTik support in limited testing.
Install the netmiko module in a Python environment and verify its import with a test script for MikroTik devices.
Write your first Python script using Netmiko to connect to a MikroTik RouterOS device via SSH, define the device dictionary, send commands to configure an interface, and print the results.
Connect to multiple MikroTik devices with Netmiko by building a device list, looping through connections, printing IP addresses, and pausing two seconds between sessions.
Automate firewall filter rules on two MikroTik routers with Netmiko using Python, reading rules from a text file and deploying them across devices for secure, scalable router configuration.
The world of IT is moving to network programmability which is also called network automation, which means that network engineers should be ready to write scripts in order to configure network devices such as MikroTik Routers. Most of network engineers don't like programming - that's a fact. But programming skills is required if you want to keep working as a network engineer. The most used programming language for network automation nowadays is called Python. For this reason, I have designed this course to show you how you can run scripts on Python to interact with MikroTik devices so you can configure them by just one click no matter how big is the number of the MikroTik devices, and to avoid human errors that happen a lot.
In this course I am not going to explain everything about Python. I am just going to take the scripts that we needed as network engineers and explain them then apply them to see how the network automation on MikroTik routers can work.
Bottom line, this course is an essence for all MikroTik network engineers and I am glad to be the 1st trainer doing a course about network automation on MikroTik using Python.