Python library and CLI for opening SSH tunnels that forward local ports to services on remote or private hosts via paramiko.
ktbyers/netmiko
Python library that simplifies SSH CLI connections to multi-vendor network devices, for sending show commands and config changes.
- Stars
- 4,319
- Forks
- 1,393
- Open issues
- 60
- Last commit
- 8 days ago
What is it?
Netmiko is a Python library built on top of Paramiko that makes it easier to connect to network devices over SSH and interact with their command-line interfaces. Network automation often involves gathering output from show commands or pushing configuration changes, and Netmiko handles these operations across a broad set of device platforms.
Instead of writing low-level prompt handling and regex matching for each vendor, users pass a device dictionary with a device_type such as cisco_ios and call methods like send_command or send_config_set. The library takes care of entering configuration mode and waiting for prompts. Connections can be used as context managers so sessions are closed reliably.
The project supports Python 3.11 and later and is installed with pip. Supported platforms are listed in the project's PLATFORMS document, and examples and API documentation are available alongside the code.
Key features
- 01Sends show commands to network devices and returns their output.
- 02Pushes configuration changes and enters config mode automatically.
- 03Supports a wide range of network vendor platforms selected by device_type.
- 04Can be used as a context manager so SSH sessions are always disconnected.
- 05Built on Paramiko for the underlying SSH transport.
Use cases
- Collecting interface or routing state from a fleet of switches and routers.
- Automating repetitive configuration changes across network devices.
- Building network audit or compliance scripts that read device output.
Quick start
- 1
Install Netmiko with pip
pip install netmiko - 2
Create a device dictionary and open an SSH connection with ConnectHandler
- 3
Run a show command with send_command
Things to know
- Requires Python 3.11 or newer; Python 3.10 and earlier are no longer supported.
- Focused on CLI screen-scraping over SSH, so it is not a fit for APIs or non-CLI management.
In collections
Topics
FAQ
- What is netmiko?
- Python library that simplifies SSH CLI connections to multi-vendor network devices, for sending show commands and config changes. Netmiko is a Python library built on top of Paramiko that makes it easier to connect to network devices over SSH and interact with their command-line interfaces. Network automation often involves gathering output from show commands or pushing configuration changes, and Netmiko handles these operations across a broad set of device platforms.
- Is netmiko free to use? What license does it have?
- netmiko is open source under the MIT license. Check the license terms before using it in commercial products.
- Is netmiko still maintained?
- Actively maintained. The last commit to netmiko was on Oct 30, 2026.
- What can I use netmiko for?
- Collecting interface or routing state from a fleet of switches and routers. Automating repetitive configuration changes across network devices. Building network audit or compliance scripts that read device output.
- How do I install netmiko?
- Install Netmiko with pip: pip install netmiko Create a device dictionary and open an SSH connection with ConnectHandler Run a show command with send_command
- Where can I get netmiko?
- The source code and installation instructions are on GitHub: https://github.com/ktbyers/netmiko
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A netcat-like CLI and Go library that connects two machines over Tailscale's WireGuard data plane without needing a Tailscale account or control plane.
A command-line SSH tunnel manager written in Go that lets you define, open and close port forwards from a TOML config.
Open-source source-of-truth web application for modeling and documenting network infrastructure, with a REST and GraphQL API for automation.
A pure-Python implementation of the SSHv2 protocol, providing both client and server functionality for Python programs.
A FUSE-based client that mounts a remote filesystem over SFTP so you can browse and edit files on an SSH server like a local folder.