Implementing and Operating Cisco Enterprise Network Core Technologies (ENCOR) v1.2AutomationMedium
A network administrator is developing a Python script to automate the configuration of VLANs on a Cisco IOS XE device. The script needs to send configuration commands to the device and receive the output. Which Python library is specifically designed to interact with network devices using SSH for command execution and output retrieval, without requiring a NETCONF/RESTCONF API?
- Ancclient
- Bparamiko
- Crequests
- Dnetmiko
Show answer & explanationAnswer & explanation
Correct answer: D. netmiko
Netmiko is a Python library specifically built for simplifying SSH connections to network devices, handling prompts, and sending configuration commands or retrieving operational output. It abstracts away many complexities of raw SSH interaction.
Why the other options are wrong
- A. ncclient is a Python library for interacting with NETCONF-enabled devices, not for direct SSH command execution.
- B. Paramiko is a low-level SSHv2 protocol implementation for Python, but Netmiko builds on top of Paramiko to provide a more network-device-specific API.
- C. The 'requests' library is used for making HTTP requests, not for SSH interactions with network devices.
Netmiko Library
A Python library that simplifies SSH connections to network devices, handling various prompts and providing a consistent API for sending commands and retrieving output across different vendors.
- Built on top of Paramiko.
- Supports multiple network vendors (Cisco, Juniper, Arista, etc.).
- Simplifies sending commands, config, and parsing output.
Memory trick: Python needs a 'net' to 'miko' (make) SSH connections.