Skip to content

E-Conners-Lab/NetworkConfigPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetConfigPro

A network configuration generator and validator for multi-vendor network devices.

Features

  • Multi-vendor support: Generate configurations for Cisco IOS/IOS-XE, NX-OS, Arista EOS, Juniper Junos, SONiC, and Fortinet FortiGate
  • Configuration validation: Catch errors and get best-practice recommendations before deployment
  • Import & analyze: Parse existing configurations and identify issues
  • Configuration diff: Compare two configurations side-by-side
  • Secure vault: Encrypted storage for credentials and sensitive variables
  • Modern GUI: Clean, dark-themed interface with PySide6

Installation

# Clone the repository
git clone <repo-url>
cd netconfigpro

# Create virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Usage

# Run the application
python main.py

Quick Start

  1. Generate Configuration

    • Select your target vendor (Cisco IOS, NX-OS, Arista EOS, Juniper, SONiC, Fortinet)
    • Fill in hostname, interfaces, VLANs, routing configuration
    • Click "Generate" or press Ctrl+G
    • Review validation results and export
  2. Import Configuration

    • Paste an existing configuration or open a file
    • Click "Parse Configuration"
    • Review parsed elements and validation issues
  3. Compare Configurations

    • Use the Diff tab to compare two configurations
    • See additions, deletions, and changes highlighted
  4. Secure Vault

    • Create a vault with a master password
    • Store credentials and template variables securely
    • All data is encrypted at rest

Supported Vendors & Configuration Elements

Element Cisco IOS NX-OS Arista EOS Juniper SONiC FortiGate
Interfaces Yes Yes Yes Yes Yes Yes
VLANs Yes Yes Yes Yes Yes Yes
ACLs/Firewall Yes Yes Yes Yes Yes Yes
Static Routes Yes Yes Yes Yes Yes Yes
OSPF Yes Yes Yes Yes Yes Yes
BGP Yes Yes Yes Yes Yes Yes
Route Maps Yes Yes Yes Yes - Yes
Prefix Lists Yes Yes Yes Yes - Yes

SONiC Support

SONiC configurations are generated in config_db.json format with support for:

  • DEVICE_METADATA: Hostname, BGP ASN, device type
  • PORT: Interface configuration with MTU (default 9100)
  • INTERFACE / LOOPBACK_INTERFACE: L3 addressing
  • VLAN / VLAN_MEMBER / VLAN_INTERFACE: VLAN configuration
  • OSPF_ROUTER / OSPF_ROUTER_AREA / OSPF_INTERFACE: OSPF routing
  • BGP_NEIGHBOR: BGP peering with rmt_asn field format
  • STATIC_ROUTE: Static routing
  • ACL_TABLE / ACL_RULE: L3 ACLs
  • NTP_SERVER / DNS_NAMESERVER: Management services

Interface naming is automatically converted:

  • GigabitEthernet0/0Ethernet0
  • Ethernet0/1Ethernet1 (slot/port to flat numbering)
  • Loopback0Loopback0

Fortinet FortiGate Support

FortiGate configurations are generated in FortiOS CLI format with support for:

  • config system global: Hostname, FQDN
  • config system interface: Interface configuration with IP, status, MTU
  • config system dns / ntp: Management services
  • config router static: Static routing
  • config router ospf: OSPF with areas, interfaces, passive interfaces
  • config router bgp: BGP neighbors, networks, redistribution
  • config router prefix-list / route-map: Policy configuration
  • config firewall address / policy: ACL to firewall policy conversion

Interface naming is automatically converted:

  • GigabitEthernet0/0port1
  • Ethernet1port2 (1-indexed)
  • Loopback0loopback0

Project Structure

netconfigpro/
├── main.py                  # Application entry point
├── requirements.txt         # Python dependencies
├── src/
│   ├── core/
│   │   ├── models.py        # Data models
│   │   ├── generators/      # Config generation
│   │   │   └── config_generator.py
│   │   ├── validators/      # Validation rules
│   │   ├── parsers/         # Config parsing
│   │   │   └── config_parser.py
│   │   └── templates/
│   │       └── vendors/     # Jinja2 templates
│   │           ├── cisco_ios.j2
│   │           ├── cisco_nxos.j2
│   │           ├── arista_eos.j2
│   │           ├── juniper_junos.j2
│   │           ├── sonic.j2
│   │           └── fortinet_fortigate.j2
│   ├── security/            # Encryption, vault
│   └── gui/                 # PySide6 GUI
├── tests/
│   └── unit/
│       ├── test_generator.py
│       ├── test_parser.py
│       ├── test_sonic.py
│       ├── test_all_templates.py
│       └── ...
└── docs/                    # Documentation

Running Tests

# Run all tests
python -m pytest tests/ -v

# Run SONiC-specific tests
python -m pytest tests/unit/test_sonic.py -v

# Run all template tests
python -m pytest tests/unit/test_all_templates.py -v

# Run with coverage
python -m pytest tests/ --cov=src

Keyboard Shortcuts

Shortcut Action
Ctrl+1-5 Switch tabs
Ctrl+G Generate configuration
Ctrl+S Save project
Ctrl+O Open project
Ctrl+E Export configuration
Ctrl+L Clear form
Ctrl+I Add interface
Ctrl+Shift+C Copy output

Security

  • All sensitive data is encrypted using AES-256 (Fernet)
  • PBKDF2 with 480,000 iterations for key derivation
  • Vault files use restrictive permissions (600)
  • No plaintext secrets stored on disk

Requirements

  • Python 3.10+
  • PySide6
  • Jinja2
  • cryptography

License

MIT License

About

Multi-vendor network configuration generator and validator. One data model in, deployable configs out for Cisco IOS/IOS-XE, NX-OS, Arista EOS, Juniper Junos, SONiC, and Fortinet FortiGate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages