Automation Scripts

Undoubtedly, the future of networking lies in automation. While some argue this shift may raise industry standards and reduce certain job roles, automation offers immense benefits—including scalability, predictability, efficiency, and enhanced capabilities for network configuration and management. For today’s network engineer, mastering essential automation tools and scripting languages has become a necessity. I invite you to explore some of the projects I’ve worked on while learning Python, in hopes they’ll inspire you to discover the incredible potential of automation.

1. Operators.py authentication system

This project simulates a system that handles users and actions based on a local database, leveraging OOP concepts and decorators. Users are organized based on the class ’User’ which defines its properties trough the __init__ constructor: user_id, user_password and the logged_in variable. Based on these information, the class defines two methods: ’login’ and ’logout’, trough which the user can authenticate using its username and password and which provide useful error messaging. There are three actions defined that a user can perform: post_message, view_profile and browse_public_feed. The first two of these actions can be completed only if the user is authenticated, and to check this fact the script uses a decorator called requires_authentication which verifies the users logged_in status to allow or deny a specific action.

2. MAC Address Changer

This Python script enables users to change the MAC address of a specified network interface on Linux systems. It leverages the ’subprocess’ module to execute system commands for interfacing with network settings and ’optparse’ for parsing command-line arguments. The script uses regular expressions via the ’re’ module to extract the current MAC address. After changing the MAC address, it verifies the update to ensure the change was successful. Also, the script includes error checking to ensure that both the network interface and new MAC address are provided, and it verifies whether the MAC address change was successful.