Skip to main content

EVPN Ninja Logo

EVPN Ninja

The Ultimate VXLAN/EVPN Fabric Planning & Configuration Tool

PyPI PyPI Downloads GitHub Downloads

Python 3.10+ License: MIT

Features • Installation • Quick Start • Commands • Vendors • Lab Export


Overview

EVPN Ninja is a powerful cross-platform CLI tool designed for network engineers to plan, calculate, and generate configurations for VXLAN/EVPN data center fabrics. Whether you're designing a small campus network or a large-scale multi-tenant datacenter, EVPN Ninja has you covered.

┌─────────────────────────────────────────────────────────────────┐
│  Plan → Calculate → Generate → Deploy                          │
│                                                                 │
│  ┌───────┐    ┌───────────┐    ┌──────────┐    ┌───────────┐  │
│  │Fabric │ => │ IP Plans  │ => │  Configs │ => │Containerlab│ │
│  │Design │    │ VNI/ASN   │    │ 18 Vendors│   │EVE-NG/GNS3│  │
│  └───────┘    └───────────┘    └──────────┘    └───────────┘  │
└─────────────────────────────────────────────────────────────────┘

✨ Features

Calculators

Calculator Description
MTU Calculate VXLAN encapsulation overhead with detailed layer-by-layer breakdown
VNI Allocation Plan VNI assignments using VLAN-based, tenant-based, or sequential schemes
Fabric Parameters Generate complete IP addressing plans for leaf-spine topologies
EVPN Parameters Calculate RD/RT values and generate production-ready vendor configs
eBGP Underlay Design RFC 7938 compliant eBGP underlay with ASN allocation
Multicast Groups Plan multicast group assignments for BUM traffic replication
Route Reflector Calculate BGP RR placement and cluster configurations
Bandwidth Estimate fabric bandwidth and oversubscription ratios
Multi-homing Generate ESI, LACP, and ES-RT for EVPN multi-homing
Topology Visualize fabric topology in ASCII or Graphviz DOT format

Key Capabilities

  • 18 Vendor Support — Generate configs for Arista, Cisco, Juniper, Nokia, and 14 more vendors
  • Lab Export — Export to Containerlab, EVE-NG, and GNS3 for instant lab deployment
  • Presets — Built-in presets for small, medium, and large datacenters
  • Config File — Save your defaults in ~/.evpn-ninja.yaml
  • Multiple Outputs — Table, JSON, or YAML output for automation
  • IP Validation — Automatic overlap and capacity checks for IP networks
  • Interactive Mode — Guided wizard for beginners

📦 Installation

From PyPI

pip install evpn-ninja

From Source

git clone https://github.com/ashimov/evpn-ninja.git
cd evpn-ninja
pip install -e .

Standalone Binary

Download prebuilt binaries from GitHub Releases:

Platform File
Linux (x64) evpn-ninja-linux-amd64
macOS (Intel) evpn-ninja-macos-amd64
macOS (Apple Silicon) evpn-ninja-macos-arm64
Windows (x64) evpn-ninja-windows-amd64.exe
# Linux/macOS: make executable and run
chmod +x evpn-ninja-*
./evpn-ninja-linux-amd64 --help

Shell Completion

# Bash
evpn-ninja completion bash > ~/.evpn-ninja-complete.bash
echo "source ~/.evpn-ninja-complete.bash" >> ~/.bashrc

# Zsh
evpn-ninja completion zsh > ~/.evpn-ninja-complete.zsh
echo "source ~/.evpn-ninja-complete.zsh" >> ~/.zshrc

# Fish
evpn-ninja completion fish > ~/.config/fish/completions/evpn-ninja.fish

🚀 Quick Start

# Show all available commands
evpn-ninja --help

# Use a preset for quick calculations
evpn-ninja --preset large-dc fabric

# Calculate MTU requirements
evpn-ninja mtu --payload 1500 --underlay ipv4

# Generate EVPN configs for multiple vendors
evpn-ninja evpn --as 65000 --loopback 10.0.0.1 --l2-vni 10010 --vendor arista --vendor cisco-nxos

# Export to Containerlab for testing
evpn-ninja export containerlab --spines 2 --leaves 4 --platform eos --output-dir ./lab

# Interactive guided mode
evpn-ninja interactive

📖 Commands

MTU Calculator

Calculate the required underlay MTU for VXLAN encapsulation with a detailed breakdown of each layer.

evpn-ninja mtu --payload 1500 --underlay ipv4 --outer-vlan 1
                              VXLAN MTU Breakdown
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Layer          ┃ Size (bytes) ┃ Description                                ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Outer Ethernet │ 14           │ Dst MAC + Src MAC + EtherType              │
│ Outer VLAN     │ 4            │ 802.1Q tag                                 │
│ Outer IPv4     │ 20           │ Standard IPv4 header                       │
│ UDP            │ 8            │ Source port + Dest port (4789) + Length    │
│ VXLAN Header   │ 8            │ Flags + Reserved + VNI + Reserved          │
│ Inner Ethernet │ 14           │ Dst MAC + Src MAC + EtherType              │
│ Inner Payload  │ 1500         │ Original L3 packet (IP + data)             │
└────────────────┴──────────────┴────────────────────────────────────────────┘

╭─────────────────────────────── Summary ────────────────────────────────╮
│   Required MTU        1554 bytes                                       │
│   Recommended MTU     1600 bytes                                       │
╰────────────────────────────────────────────────────────────────────────╯

VNI Allocation

Plan VNI assignments using multiple allocation schemes.

# VLAN-based scheme
evpn-ninja vni --scheme vlan-based --base-vni 10000 --start-vlan 100 --count 5

# Tenant-based scheme
evpn-ninja vni --scheme tenant-based --tenant-id 5 --start-vlan 100 --count 3

# Output as JSON for automation
evpn-ninja vni --scheme vlan-based --base-vni 10000 --count 10 --output json

Fabric Parameters

Generate complete IP addressing plans and resource estimates for leaf-spine fabrics.

evpn-ninja fabric --vteps 8 --spines 4 --vnis 500 --hosts 100 \
  --loopback-net 10.0.0.0/24 \
  --vtep-net 10.0.1.0/24 \
  --p2p-net 10.0.100.0/22

Features:

  • Router loopback allocation
  • VTEP (NVE) loopback allocation
  • P2P /31 link addressing
  • Resource estimates (MAC entries, EVPN routes, BGP sessions)
  • Automatic IP overlap and capacity validation

EVPN Parameters

Calculate RD/RT values and generate vendor-specific configurations.

# L2 VNI only
evpn-ninja evpn --as 65000 --loopback 10.0.0.1 --l2-vni 10010 --vlan 10 --vendor arista

# L2 + L3 VNI (symmetric IRB)
evpn-ninja evpn --as 65000 --loopback 10.0.0.1 \
  --l2-vni 10010 --vlan 10 \
  --l3-vni 50000 --vrf TENANT-A \
  --vendor arista --vendor cisco-nxos --vendor juniper

eBGP Underlay

Design RFC 7938 compliant eBGP underlay with automatic ASN allocation.

evpn-ninja ebgp --spines 4 --leaves 16 --scheme private-4byte --p2p-net 10.0.100.0/22

ASN Schemes:

  • private-2byte — 64512-65534
  • private-4byte — 4200000000+ (recommended)
  • custom — Specify base ASN

Multi-homing

Calculate EVPN multi-homing parameters including ESI generation.

evpn-ninja multihoming --es-count 4 --peers 2 --mode active-active --vendor arista

Features:

  • ESI Type-0, Type-1 (LACP), Type-3 (MAC-based)
  • LACP system ID configuration
  • DF election algorithm settings
  • Vendor configs for Arista, Cisco, Juniper

Route Reflector

Calculate BGP Route Reflector placement for EVPN overlay.

evpn-ninja rr --clients 16 --placement spine --redundancy pair

Bandwidth Calculator

Estimate fabric bandwidth and oversubscription ratios.

evpn-ninja bandwidth --leaves 8 --spines 4 \
  --uplinks 4 --uplink-speed 100g --downlinks 48 --downlink-speed 25g

🏭 Supported Vendors

EVPN Ninja generates production-ready configurations for 18 vendors:

Vendor Platform Vendor Platform
Arista EOS Nokia SR Linux
Cisco NX-OS Dell OS10
Cisco IOS-XE Cumulus Linux
Cisco IOS-XR SONiC SONiC NOS
Juniper Junos Extreme EXOS
Huawei CE Series HPE Aruba CX
MikroTik RouterOS 7 H3C Comware
VyOS VyOS 1.4+ ZTE ZXROS
Fortinet FortiOS Mellanox Onyx
# Generate config for specific vendor
evpn-ninja evpn --as 65000 --loopback 10.0.0.1 --l2-vni 10010 --vendor nokia-srlinux

# Generate for multiple vendors at once
evpn-ninja evpn --as 65000 --loopback 10.0.0.1 --l2-vni 10010 \
  --vendor arista --vendor cisco-nxos --vendor juniper

🧪 Lab Export

Export your fabric design directly to network simulators for testing.

Containerlab

evpn-ninja export containerlab \
  --spines 2 --leaves 4 \
  --platform eos \
  --lab-name my-fabric \
  --include-hosts \
  --output-dir ./containerlab

# Deploy the lab
cd containerlab && make deploy

EVE-NG

evpn-ninja export eve-ng \
  --spines 2 --leaves 4 \
  --platform nxos \
  --lab-name evpn-test \
  --output-dir ./eve-ng

GNS3

evpn-ninja export gns3 \
  --spines 2 --leaves 4 \
  --platform eos \
  --lab-name gns3-fabric \
  --output-dir ./gns3

Export All Formats

evpn-ninja export all --spines 2 --leaves 4 --output-dir ./automation

This creates:

automation/
├── ansible/
│   ├── inventory.yaml
│   └── group_vars/
├── nornir/
│   ├── inventory/
│   └── config.yaml
├── containerlab/
│   ├── my-fabric.clab.yml
│   ├── configs/
│   └── Makefile
├── eve-ng/
│   └── my-fabric.unl
└── gns3/
    └── my-fabric.gns3

⚙️ Configuration

Config File

Create a config file at ~/.evpn-ninja.yaml to set your defaults:

defaults:
  mtu:
    payload_size: 1500
    underlay_type: ipv4
  fabric:
    spine_count: 2
    vtep_count: 4
    loopback_network: "10.0.0.0/24"
    vtep_loopback_network: "10.0.1.0/24"
  evpn:
    bgp_as: 65000
    vendors:
      - arista
      - cisco-nxos

output:
  format: table
  no_color: false

presets:
  my-dc:
    fabric:
      spine_count: 4
      vtep_count: 32
      vni_count: 1000
    ebgp:
      scheme: private-4byte
# Initialize default config
evpn-ninja config init

# Show current config
evpn-ninja config show

# Use custom config file
evpn-ninja --config /path/to/config.yaml fabric

Built-in Presets

# List available presets
evpn-ninja --list-presets

# Use a preset
evpn-ninja --preset large-dc fabric
evpn-ninja --preset small-dc ebgp
Preset Spines Leaves VNIs Description
small-dc 2 4 100 Small datacenter
medium-dc 2 16 500 Medium datacenter
large-dc 4 64 4000 Large datacenter
multi-tenant - - - Multi-tenant with L3VNI per tenant
campus 2 8 50 Campus network

📤 Output Formats

All commands support multiple output formats:

# Pretty tables (default)
evpn-ninja fabric --vteps 4 --spines 2 --output table

# JSON for automation/scripting
evpn-ninja fabric --vteps 4 --spines 2 --output json

# YAML for config files
evpn-ninja fabric --vteps 4 --spines 2 --output yaml

# Save to file
evpn-ninja fabric --vteps 4 --spines 2 --output json --save fabric.json

🛠️ Development

# Clone repository
git clone https://github.com/ashimov/evpn-ninja.git
cd evpn-ninja

# Install with dev dependencies
pip install -e ".[dev]"

# Run linter
ruff check src/

# Run formatter
ruff format src/

# Run type checker
mypy src/

# Run tests
pytest

# Run all checks
ruff check src/ && ruff format src/ && mypy src/ && pytest

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


👤 Author

Berik Ashimov


Built with ❤️ for the network engineering community

Web Version • Report Bug • Request Feature

Metadata

Release files for evpn-ninja 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evpn-ninja 1.0.4
File Size Uploaded Provenance
evpn_ninja-1.0.4.tar.gz 105.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for evpn-ninja 1.0.4
File Interpreter ABI Platform
evpn_ninja-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 181.6 kB

Release files / evpn_ninja-1.0.4.tar.gz

Download URL evpn_ninja-1.0.4.tar.gz
Size 105.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9578523078af1f0bed8db1dc04b4a3fe2c4f47143ccf3d01f9eb6a3e334c9200
BLAKE2b-256 checksum
How to use checksums
80ce61878d61048052b02162bc4d008289baac530dd635ad6e3d1c7d1c957ce1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Release files / evpn_ninja-1.0.4-py3-none-any.whl

Download URL evpn_ninja-1.0.4-py3-none-any.whl
Size 76.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6be9e418bb7eb9bba1a44e14a1bddccb8bd4a655796b45a8471aebe355d8ebfe
BLAKE2b-256 checksum
How to use checksums
a2c514e803249e7fd7c8d99ae0ba96a27d5ea48fa1757a413060cf905622f798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

Security for evpn-ninja 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for evpn_ninja-1.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page