HCIA-Datacom lab 19 of 22
Python automation with Paramiko and Netmiko
Automate a Huawei router and switch from Python. You write a Paramiko script that logs in over SSH, runs display commands and pushes a change, then use Netmiko to back up both devices in a loop and to push VLANs to the VRP8 switch with a proper commit.
Run this lab
It needs Lite: its 3 nodes are set to 4 vCPU and 5,120 MB in total. That fits the free demo too.
In your workspace: Shared, then HCIA-Datacom H12-811 guided labs, then 19 - Python automation with Paramiko and Netmiko
- Level
- Advanced
- Time
- About 60 minutes
- Nodes need
- 4 vCPU, 5,120 MB
- Smallest plan
- Lite
The scenario
Northwind's network team is tired of logging in to devices one at a time. The management station (NMS, Ubuntu with Python 3, Paramiko and Netmiko already installed) can reach R1 and SW1 over SSH. You'll build the team's first tools: a script that runs display commands, one that makes a change, and a nightly backup of every device's configuration.
What you’ll practise
- Explain why automation uses SSH and libraries such as Paramiko and Netmiko (and why telnetlib is gone)
- Write a Paramiko script that opens an interactive shell, handles prompts and reads output
- Push configuration with Paramiko and verify it
- Use Netmiko device types for VRP5 (huawei) and VRP8 (huawei_vrpv8), including commit
- Back up configurations from an inventory in a loop
The tasks
- Load the starting configuration
- Read a device with Paramiko
- Make a change with Paramiko
- Back up every device with Netmiko
- Push VLANs to the VRP8 switch, with a commit
- Think about safety
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- NMS
eth0to SW1GE1/0/10 - SW1
GE1/0/1to R1GE0/0/0
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| R1 | Huawei AR1000V router | huaweiar1k-5.170-V300R022C00SPC100-Auto-update-esn | 1 vCPU, 2,048 MB |
| SW1 | Huawei CloudEngine CE6800 | huaweice6800-bundled | 2 vCPU, 2,048 MB |
| NMS | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 1,024 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
HCIA-Datacom H12-811 guided labs.Open
19 - Python automation with Paramiko and Netmikoand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More HCIA-Datacom labs
Related labs in other courses
CloudLabBox is independent of Huawei. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.