06-17-2022 11:22 PM - last edited on 05-08-2023 11:35 AM by Paul Zimmerman
I'm going to be moving on to learning either Linux or Python or both and I am unclear on how deep to learn either one or both. I've asked this question before and it's been suggested to learn Python over Linux as a network engineer, but isn't Python deployed using Linux?
I have a pretty strong desire to learn Linux as I'm looking at things such as RADIUS servers, and wrapping openware inside Linux code to help it run as Firewalls and other virtual security devices.
I want to learn both Linux and Python, but I want to understand, beyond Python automation scripting (I.e plugging in Python code to update multiple routers at a time, logging for multiple routers) what else can Python be used for? What else is it used for in Network engineering other than batch updates of devices configurations/logging?
Solved! Go to Solution.
06-19-2022 11:19 AM
Hi @hfakoor222
I think you already know its not a simple question to answer but here is how I like to break it down. This is from a network engineers perspective.
First, these two are not equivalent (Linux is an operating system and Python is a programming language) and so the answer depends on what you want to do. Given what you describe in your message you need to learn both.
As a network engineer, even without the details you provided, I will always recommend a network engineer learn both.
I believe having some Unix/Linux skills is invaluable. Much of what we work on starts out as (an often stripped down version of) Linux or FreeBSD or some other UNIX variant. Having this familiarity really gives you a head start. More to your point, if you want to stand up a DHCP server or a RADIUS server or some other tool that is only available on Linux or simpler to deploy on Linux, you are all set. If you have to help a user who is running Linux with their network configuration or even just to check their IP address...you will have the knowledge to do that and differentiate yourself from those who do not have that background.
Python is one of many programming languages available to you. For network automation today, I firmly believe that Python is the de facto standard with the widest range of modules to help you in your automation pursuits. It has already been pointed out that Python runs on many operating systems, including Linux.
So there you have it, BOTH! but for different reasons and to achieve different ends.
06-18-2022 12:22 AM
@hfakoor222 no you do not need linux to run python, you can install python on windows. Learn both, as python and linux will certainly come in useful as a network enginer (IMO).
06-18-2022 12:53 AM
I have a pretty strong desire to learn Linux as I'm looking at things such as RADIUS servers, and wrapping openware inside Linux code to help it run as Firewalls and other virtual security devices.
You have a strong desire to learn Linux and Python, which is good if you can able to make it. in the future you see more and more Linux-based systems like Kubernetes / Dockers ...Cloud more to come using Linux based, this is due to cost.
Linux has many advantages and Python run in a simple small footprint, until windows you need a License and more installation dll (so on)
with Linux, you can test ( firewall(iptables) - Syslog server, radius, DNS, DHCP, CA Server...many if you looking to test).
Python used for many not only for automation, but you can also use or replace any other programming Language integrating with your frontend (that will be your home work what you looking to do with Python beyond)
06-19-2022 11:19 AM
Hi @hfakoor222
I think you already know its not a simple question to answer but here is how I like to break it down. This is from a network engineers perspective.
First, these two are not equivalent (Linux is an operating system and Python is a programming language) and so the answer depends on what you want to do. Given what you describe in your message you need to learn both.
As a network engineer, even without the details you provided, I will always recommend a network engineer learn both.
I believe having some Unix/Linux skills is invaluable. Much of what we work on starts out as (an often stripped down version of) Linux or FreeBSD or some other UNIX variant. Having this familiarity really gives you a head start. More to your point, if you want to stand up a DHCP server or a RADIUS server or some other tool that is only available on Linux or simpler to deploy on Linux, you are all set. If you have to help a user who is running Linux with their network configuration or even just to check their IP address...you will have the knowledge to do that and differentiate yourself from those who do not have that background.
Python is one of many programming languages available to you. For network automation today, I firmly believe that Python is the de facto standard with the widest range of modules to help you in your automation pursuits. It has already been pointed out that Python runs on many operating systems, including Linux.
So there you have it, BOTH! but for different reasons and to achieve different ends.
06-19-2022 01:08 PM
okay thank you,
one more question
Beyond network automation can any one provide an example or 2 of how Python is used in Network Engineering? Thanks
06-19-2022 01:33 PM
@hfakoor222 I've mainly used python in my job to apply configuration in bulk to multiple devices, including:-
Read a CSV file and bulk import of 1000+ network objects into a Cisco FTD (FDM) and ISE.
Login to a list of switches and apply configuration.
Login to a list of devices to backup devices.
06-19-2022 02:08 PM
Hi @hfakoor222
This is my favorite question! (you might consider posting it on its own rather than hiding it in the Linux vs Python question)
Yes...Python as it relates to network automation is well established by now.
Other interesting uses:
- Documentation - I"m a consultant so I often have to review a network of some type and develop a report describing it.
- Customized text - These days you wind up working with many teams and getting a particular team exactly the information they need without any extraneous stuff is usually much appreciated. For example, you are standing up a new site and you get a batch of subnets and you have to share that with say the WAN team and the Firewall team and the server team. Usually you either send everyone everything or you have to manually peel off say the firewall subnet and the subnets that go behind the firewall and the WAN uplink /30 and the server /30..we have python scripts that will take all the subnets and generate 'mini reports' for each organization
- Diagrams - its often handy to crawl CDP or LLDP and put together a quick diagram
- QA text to close out a Change Request
- Change Request text
Those are just some of the different ways Python can be used.
And here is a bit of a nutty one...I had to take two different spreadsheets of locations and try to match then except there was no common field. Even the addresses were slightly different! check out FuzzyWuzzy.
If you can package your data, whatever it might be, in a structured way, you can use Python to apply your logic!
Don't get me started on what you can do with Python and REST!
06-20-2022 02:13 PM
Super helpful, Thank you
06-20-2022 03:08 PM
That was an interesting piece, the fuzzy variable in Panda could be used to iterate over remaining non-matched values with a less strict match % and **bleep**;ysed for further matches. I will keep all of this in mind, for now then I'm going to continues with learning both Linux and Python
Thank you
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide