Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
GitHub repo · OtherFree

Netmiko

The open source Python library most network engineers start automation with: it handles SSH logins, prompts and paging for devices from many vendors, so a short script can collect show output or push configuration across a whole network. Simple to learn, widely used, and the natural first step from typing commands to scripting them.

GitHub stars

4.3k

GitHub · Sept 2026

Latest release

4.8.0 (September 2026)

GitHub · Sept 2026

Licence

MIT

GitHub · Sept 2026

Format

GitHub repo

Topic

Other

Provider

Kirk Byers (open source)

Time needed

First script in an afternoon

Level

Intermediate

Access

Free

What Netmiko is

Netmiko describes itself as a multi-vendor library to simplify CLI connections to network devices. It is built on Paramiko, Python's SSH library, and hides the low-level work that makes SSH to network gear awkward: logging in, entering privileged mode, recognising prompts, turning off paging and waiting for long commands to finish. Its README puts the goal simply: network automation by screen scraping is mostly about gathering output from show commands and making configuration changes, and Netmiko aims to do both across a very broad set of platforms.

Why network engineers start with it

Netmiko matches how you already work. You give it a device type, host and credentials, then call send_command with a show command or send_config_set with a list of configuration lines, exactly as you would type them. That makes it the easiest bridge from manual CLI work to automation. Typical first projects:

  • Collect show version and show ip interface brief from every device and write a report.
  • Back up every configuration to files, then to Git.
  • Find interfaces with errors across all switches.
  • Add a VLAN or a logging server to many devices at once.

Its supported platforms list covers the major network vendors and many smaller ones, so the same script style works in mixed networks.

What you need first

Basic Python: variables, lists and dictionaries, loops, functions, files and exception handling. Then a lab to point it at, such as Cisco Modeling Labs Free, GNS3 or containerlab, never production for your first scripts. Install it with pip install netmiko.

Is it worth learning?

Yes, as a first automation tool. It is free, well documented through its examples page, actively maintained and widely used, so answers to common problems are easy to find. As you grow, you may use API-based tools, NAPALM, Nornir or Ansible for larger jobs, and many of them use Netmiko underneath for SSH connections.

Good habits from day one

  • Read passwords at run time or from a secrets store, never hard-code them.
  • Handle devices that fail to connect without stopping the whole run.
  • Keep scripts in Git with a README and a sample inventory.
  • Test against a lab, then a single non-critical device, before running widely.

Common questions

Netmiko or Ansible? Learn both eventually. Netmiko teaches you how automation talks to devices; Ansible gives teams readable, repeatable playbooks.

Does it work with APIs? No, it is for CLI over SSH (and some Telnet and serial). For REST APIs, use Python's requests library.

pythonopen sourcedevops

Ready to start?

Opens on Kirk Byers (open source) in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "Netmiko". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.