A Python-driven network automation tool designed to orchestrate, provision, validate, and audit a multi-node Huawei VRP topology simulated in eNSP. This project leverages Netmiko for SSH-based configuration management and Jinja2 templates for decoupled, programmatic infrastructure deployment.
Manually configuring network infrastructure is time-consuming and prone to human error. This project demonstrates an end-to-end Network Automation Lifecycle by bridging a local host machine to an eNSP virtual topology via a Cloud Adapter.
The framework automates Layer 2 and Layer 3 provisioning across a Core Switch and 10 isolated Edge Routers, executing pre/post-flight connectivity validations, configuration archiving, and structured HTML reporting.
Tip
Click here to watch the full walkthrough video showing the topology, script execution, and generated artifacts.
- Management Station: Host PC bridged directly into the eNSP environment via a Loopback/Cloud Adapter.
- Core Switch: 1x Huawei Layer 3 Switch managing VLAN segmentation and downstream routing gateways.
- Edge Layer: 10x Huawei Routers with
GE 0/0/0interfaces pre-addressed from10.1.1.2/24to10.1.10.2/24. - Control Plane: Target devices are pre-configured with basic SSH access to allow secure programmatic orchestration.
Uses Python's ThreadPoolExecutor to perform tasks (Connectivity checks, Backups, Audits, Pushes) across the entire network simultaneously, drastically reducing execution time for large topologies.
Decouples configuration logic from device data. Supports complex features like:
- L2/L3 Setup: VLANs, IP Addresses, Trunking.
- Advanced Protocols: OSPF, BGP, MSTP, VRRP, MUX VLAN, QinQ.
Validates running configurations against a "Golden Standard" defined in YAML policies. Automatically detects missing security features (SSH, AAA, Idle-timeouts, Port security).
- Audit Reports: High-level summary of network health with pass/fail metrics.
- Device Portals: Dynamic, per-device HTML dashboards providing a live view of configuration and status.
- Netmiko: Multi-vendor SSH orchestration.
- Jinja2: Industry-standard configuration templating.
- PyYAML: Structured inventory and policy management.
- Loguru/Logging: Production-grade traceability.
- Concurrent.futures: High-performance parallel processing.
ensp-automation-framework/
├── src/ # Core Logic (Backup, Audit, Pushing, Reports)
├── inventory/ # YAML-based device and variable data
├── templates/ # Jinja2 configuration and HTML templates
├── policies/ # Security compliance standards
├── outputs/ # Backups, Logs, and Generated Reports
├── main.py # CLI Orchestrator
└── requirements.txt # Project Dependencies
pip install -r requirements.txt| Command | Description |
|---|---|
python main.py --check-conn |
Perform a parallel connectivity test to all inventory devices. |
python main.py --backup |
Securely retrieve and store timestamped configs from all devices. |
python main.py --audit |
Run security compliance checks and generate a JSON summary. |
python main.py --report |
Generate the professional HTML Audit Report. |
python main.py --deploy [tpl] --vars [file] |
Push configuration templates to devices in parallel. |
To bootstrap the switch in the demo scenario:
python main.py --deploy vlan_setup --vars inventory/vlan_data.yaml --host 10.1.1.1This project reflects a deep understanding of:
- Network Engineering: VRP (Huawei), VLANs, OSPF, BGP, and Security Hardening.
- Software Engineering: Multi-threading, Modular Code, Regex, and Templating.
- DevOps/NetOps: Automated workflows and Infrastructure as Code.
Developed by Muhammad Usman - Portfolio Project 2026