Skip to content

UsmanNizamani/ensp-automation-framework

Repository files navigation

Automated VRP Network Provisioning & Auditing Framework

Python 3.8+ License: MIT

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.


🚀 Project Overview

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.

🎥 Watch the Demo Video

Tip

Click here to watch the full walkthrough video showing the topology, script execution, and generated artifacts.


🛠️ Network Architecture & Topology

  • 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/0 interfaces pre-addressed from 10.1.1.2/24 to 10.1.10.2/24.
  • Control Plane: Target devices are pre-configured with basic SSH access to allow secure programmatic orchestration.

🚀 Key Technical Features

1. Parallel Multi-Threaded Execution

Uses Python's ThreadPoolExecutor to perform tasks (Connectivity checks, Backups, Audits, Pushes) across the entire network simultaneously, drastically reducing execution time for large topologies.

2. Template-Driven Provisioning (Jinja2)

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.

3. Automated Compliance Auditing (Regex Engine)

Validates running configurations against a "Golden Standard" defined in YAML policies. Automatically detects missing security features (SSH, AAA, Idle-timeouts, Port security).

4. Professional HTML Reporting & Dashboards

  • 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.

🛠️ Tech Stack

  • 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.

📂 Project Structure

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

🚦 Usage Guide

1. Installation

pip install -r requirements.txt

2. Core Commands

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.

3. Example Deployment

To bootstrap the switch in the demo scenario:

python main.py --deploy vlan_setup --vars inventory/vlan_data.yaml --host 10.1.1.1

👔 Career Impact

This 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

About

Just a tool i have devloped to help me with ENSP labs.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages