The Ultimate VXLAN/EVPN Fabric Planning & Configuration Tool
Features • Installation • Quick Start • Commands • Vendors • Lab Export
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│ │
│ └───────┘ └───────────┘ └──────────┘ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘
| 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 |
- 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
pip install evpn-ninjagit clone https://github.com/ashimov/evpn-ninja.git
cd evpn-ninja
pip install -e .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# 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# 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 interactiveCalculate 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 │
╰────────────────────────────────────────────────────────────────────────╯
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 jsonGenerate 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/22Features:
- 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
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 juniperDesign 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/22ASN Schemes:
private-2byte— 64512-65534private-4byte— 4200000000+ (recommended)custom— Specify base ASN
Calculate EVPN multi-homing parameters including ESI generation.
evpn-ninja multihoming --es-count 4 --peers 2 --mode active-active --vendor aristaFeatures:
- ESI Type-0, Type-1 (LACP), Type-3 (MAC-based)
- LACP system ID configuration
- DF election algorithm settings
- Vendor configs for Arista, Cisco, Juniper
Calculate BGP Route Reflector placement for EVPN overlay.
evpn-ninja rr --clients 16 --placement spine --redundancy pairEstimate fabric bandwidth and oversubscription ratios.
evpn-ninja bandwidth --leaves 8 --spines 4 \
--uplinks 4 --uplink-speed 100g --downlinks 48 --downlink-speed 25gEVPN 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 juniperExport your fabric design directly to network simulators for testing.
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 deployevpn-ninja export eve-ng \
--spines 2 --leaves 4 \
--platform nxos \
--lab-name evpn-test \
--output-dir ./eve-ngevpn-ninja export gns3 \
--spines 2 --leaves 4 \
--platform eos \
--lab-name gns3-fabric \
--output-dir ./gns3evpn-ninja export all --spines 2 --leaves 4 --output-dir ./automationThis 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
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# 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 |
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# 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/ && pytestContributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Berik Ashimov
- Website: ashimov.com
- GitHub: @ashimov
Built with ❤️ for the network engineering community
