hello@itglobalconsult.it
ISMS certified to ISO/IEC 27001:2022 – Bureau Veritas, cert. no. IT347116. Find out more
English
Blog

Python: what it is and how it helps network automation

Python for network automation
11/10/2024
Category:
IT Solutions

‍The basics

In recent years computer networks have grown considerably in size and complexity, to the point where managing them with “manual” methods is becoming increasingly difficult.

For this reason, to keep preparation and management times reasonable and, above all, to maintain a high level of reliability, it is advisable, and sometimes essential, to rely on network automation.

For this purpose you can use third-party tools available under different licences and distribution models, which, however, are not always perfectly tailored to your needs.

Being able to build your own tools can often be the winning card for a significant productivity boost, both in quantity and in quality, and for this a knowledge of a programming language is essential.

Why Python?

The language that has become increasingly established in network management in recent years is undoubtedly Python, for a number of reasons, including:

  • It is user-friendly: its syntax is easy to read, you do not need to declare variable data types, and it has versatile data structures such as lists and dictionaries.
  • It is productive and fast to develop with: it keeps the distance between an idea and its implementation to a minimum, even for beginners.
  • It has been around since the 1990s, so it is a mature language with a large support community: online you will find courses, blogs and discussions of every kind, so whatever problem you run into has probably already been tackled and discussed, with extensive documentation available.
  • It has a rich set of libraries covering every field: from those built specifically for networking to string processing and interaction with third-party programs such as the Microsoft Office suite.

My personal experience:

In the team I work in, even though we use “traditional” network technologies (not SDN, to be clear), Python is used extensively to prepare and verify activities. Here are some concrete examples from my own experience:

  • Automatic inventory: building inventories of various network device components, such as transceivers, modules and software versions.
  • Automatic generation of configuration files for upgrades and migrations: creating command files to isolate devices at various levels (HSRP, OSPF, BGP, physical) from up-to-date production configurations.
  • Automatic retrieval and backup of information from network devices for pre/post-activity checks and comparisons: MAC address table, OSPF database, BGP table and more.
  • Normalising routing tables into tabular form and comparing them: pre/post-activity routing tables from devices of different types and brands are converted into a common format (.csv file) and compared for verification.
  • Automatic retrieval of network information from the customer’s tools: for example, given any host IP address, finding which device/interface/VRF it belongs to.
  • Creating tables and charts of bandwidth usage on specific interfaces, by processing the information sent automatically by Infovista.

Conclusion

If Python already proves useful with traditional networking technologies, it is in the new world of software-defined networking that the greatest opportunities open up.

The Cisco DevNet track, introduced in 2020, accompanied the growth of network automation; since 3 February 2026, the certifications have been named CCNA, CCNP and CCIE Automation (source: Cisco). This development is a strong signal of where the future of networking is heading: the low-level network layer will become increasingly “hidden”, and interaction with the network will increasingly take place at API level (Application Programming Interface), with programming skills becoming ever more important compared with traditional systems skills.

Admittedly, traditional network engineers may find it hard to adapt to this new paradigm and to overcome their reluctance to move towards programming, but after an understandable initial hesitation they will come to appreciate the major benefits and the “creative” satisfaction it offers.

Useful resources:

There are plenty of resources online to get started with Python; here are just a few:

Would you like to find out more about IT Global Consulting?

Learn more: IT Global Consulting’s outsourced network engineers and IT consultancy.

Watch the IT Global Consulting services video: click here.

Would you like us to contact you? Click here to go to the contact page

Request information

Do you have questions about our services? We're here to help!

Our team of experts is ready to listen to your needs and to offer you solutions tailored to your business.

Fill out the contact form. We will get back to you as soon as possible to discuss how we can support you in the transformation of your IT infrastructure.

Reason for contacting us*
Thank you! Your request has been received!
Oops! An error occurred while submitting the form.