ContainerLab 〡 Network Automation

What is Netlab and Why Network Engineers Should Care

Milan Zapletal
April 15, 2026

Table Of Contents

In the world of network engineering, building test labs has always been a necessary evil. We’ve all been there – spending hours configuring devices, setting up IP addresses, and troubleshooting basic connectivity before we can even start testing what we actually want to test. What if I told you there’s a tool that eliminates 80% of this setup time while making your labs reproducible and version-controlled?

What is Netlab?

Netlab is an infrastructure-as-code tool specifically designed for network labs. Think of it as “Terraform for network labs” – you describe what you want in a simple YAML file, and netlab handles all the heavy lifting of device configuration, IP addressing, and connectivity setup.

Created and maintained by Ivan Pepelnjak, a renowned networking expert and in my opinion also a pioneer of network abstraction. Netlab represents years of experience in what network engineers actually need when building labs. Unlike traditional lab tools that focus on GUI-based topology design, netlab takes a developer-friendly approach that aligns perfectly with modern DevOps practices. We all know that GUI is great, but it doesn’t scale.

The network topology below was built entirely with Netlab, here’s the full story.

Complex network topology, built entirely with Netlab. It contains 5 sites and more than 50 devices

The Problem Netlab Solves

Traditional network lab creation follows a standard pattern:

  1. Deploy virtual devices
  2. Manually or programmatically configure management IPs
  3. Prepare config files – this part is especially important and prone to errors!
  4. Confirm basic connectivity
  5. Configure additional protocols or rules
  6. Document everything (if you remember)
  7. Pray you can recreate it next month

Netlab transforms this into:

  1. Write a YAML topology file (you can add configs, but you don’t have to)
  2. Run netlab up
  3. Start testing

The difference is transformative – what used to take hours now takes minutes and more importantly, with YAML definition, we have our programmatic source of truth for the lab in future. Imagine it as a next-level abstraction. Do you need to run OSPF in a multiarea environment? Add the OSPF module to your YAML file and define rules. Do you need to create an MPLS VPNv4 lab to emulate customers connected to provider’s cloud? Just add the declarative abstracted config to your YAML and the MPLS core with sites is built in minutes with Junos, IOS or Arista!

Core Concepts That Make Netlab Powerful

Declarative Topology Definition

Instead of clicking through GUIs or writing lengthy configuration scripts, netlab uses a declarative approach. You describe your desired network topology in YAML:

YAML
# Simple topology of 2 connected routers
provider: clab
defaults.device: eos
defaults.devices.eos.clab.image: ceos:4.29.9.1M

nodes:
- r1
- r2
- r3

links:

# P2P link
- r1-r2
- r2-r3
- r3-r1

This simple file creates a three-router triangle topology with all IP addresses automatically assigned and basic connectivity configured. In my example, I am using ContainerLab to emulate the images, but there’re are more options.

Vendor Abstraction Layer

One of netlab’s killer features is vendor abstraction. The same topology file can deployed on all vendors that have the model supported. And if there’s something missing? It’s not a blocker at all, the netlab project is open-source and ready for additional input.

Intelligent Configuration Modules

Netlab includes built-in modules for common protocols and features:

  • Fundamental connectivity: Mostly guaranteed, supported for all major platforms
  • OSPF/BGP – Full protocol configuration with areas, AS numbers, and policies
  • VLANs – Trunk/access port configuration across vendors
  • VRF – Multi-tenancy setup with route leaking options
  • MPLS – LDP, MPLS VPNs
  • SR/SRv6 – Segment routing for modern networks

Each module understands vendor differences and generates appropriate configurations automatically.

Main Use Cases: Where Netlab Shines

1. Network Design Validation

Before implementing a new network design in production, Netlab lets you:

  • Test the complete topology in minutes, not hours
  • Verify protocol interactions across different vendors
  • Validate failover scenarios with reproducible tests
  • Document designs with version-controlled topology files

Real-world example: A network architect can test a new BGP route reflector design across Cisco and Arista devices, ensuring compatibility before the procurement phase. Netlab automatically handles the base BGP configuration, neighbor relationships, and route reflector hierarchy. However, for production-ready deployments, additional configuration beyond Netlab’s automated setup is often required – such as BGP authentication (MD5 passwords, TCP-AO), advanced route policies, or complex MPLS integration with route reflectors.

2. Learning and Training Environments

For network professionals developing their skills, Netlab provides:

  • Consistent lab environments that work every time
  • Progressive complexity – start simple, add features gradually
  • Multi-vendor experience without managing multiple lab platforms
  • Focus on learning, not lab setup

Example scenario: A CCNP candidate can create OSPF, BGP, and MPLS labs that exactly match their study materials, saving hours of setup time for each study session.a

3. Automation Development and Testing

Network automation engineers use netlab to:

  • Test Ansible playbooks against multiple vendors
  • Develop Python scripts in consistent environments
  • CI/CD integration for automated testing
  • Validate automation tools before production deployment

Practical application: Before rolling out a new automation script, spin up a 20-device topology matching your production network, test thoroughly, then tear it down – all in under 30 minutes.

4. Troubleshooting and Recreation

When production issues arise, netlab helps by:

  • Recreating production topologies quickly
  • Testing fixes in isolated environments
  • Documenting solutions with shareable topology files
  • Training team members on issue resolution

Real scenario: A complex MPLS VPN issue can be recreated in the lab using the exact same topology and configuration approach, allowing safe troubleshooting without production impact.

Special Thanks to Ivan Pepelnjak

It’s impossible to discuss Netlab without acknowledging Ivan Pepelnjak’s contribution to the networking community. Through his work at ipSpace.net and the creation of Netlab, Ivan has democratized access to advanced network lab automation.

His philosophy of “infrastructure as code for networking” has influenced countless engineers to adopt modern automation practices. Netlab embodies this philosophy perfectly – making complex network labs as easy to manage as application code.

Getting Started with Netlab

Ready to transform your lab experience? Here’s what you need:

System Requirements:

  • Linux or macOS (WSL2 for Windows)
  • Python 3.8 or higher
  • Virtualization platform (KVM/libvirt, Docker, or VirtualBox)
  • Minimum 8GB RAM (16GB+ recommended)

Knowledge Prerequisites:

  • Basic YAML understanding
  • Familiarity with command-line tools
  • Network protocol knowledge (OSPF, BGP, etc.)
  • Basic virtualization concepts

Conclusion and What’s Next

Netlab represents a paradigm shift in how we approach network labs. By treating lab infrastructure as code, it brings software development best practices to network engineering. The result? More time learning and testing, less time on repetitive setup tasks.

In this series, we’ll take you from Netlab novice to power user:

  • Part 2: Deep dive into Netlab features, architecture, and comparisons with other tools
  • Part 3: Hands-on guide building a simple OSPF lab with Netlab and ContainerLab
  • Part 4: Advanced multi-site topology with 10+ devices demonstrating real-world scenarios

Ready to revolutionize your lab workflow? Stay tuned for Part 2, where we’ll explore Netlab’s architecture and see how it compares to other popular lab tools.

Additional Resources


Have you tried netlab in your environment? What’s your biggest challenge with network lab automation? Share your thoughts in the comments below or reach out to us at Netodata to discuss how we can help optimize your network automation journey.

NETWORK AUTOMATION INSIGHTS
Stay informed about the latest in network automation:
Technical deep dives - Implementation guides -
Industry best practices
Netodata official logo featuring a stylized green geometric icon and the brand name "NETODATA" in white and green typography on a transparent background.
From initial consulting to seamless implementation, we manage your network automation journey every step of the way. Our comprehensive suite of professional services caters to diverse enterprises, ranging from startups to established players.
Contact
1-234-1234
info@netodata.io
Address
Nové sady 988/2
602 00, Brno
Czech Republic
ICO: 23213035
GET IN TOUCH
Address
Netodata Labs, s.r.o. © 2026 All Rights Reserved
Nautobot icon

Nautobot

The central Source of Truth for network infrastructure data. Nautobot serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
Automation platform

Nornir

A Python automation framework specifically designed for network automation. Nornir provides:
High-performance concurrent task execution
Deep Python integration
Flexible inventory management
Fine-grained control over network operations
CI/CD

Orchestration & CD/CI

We integrate industry-standard orchestration tools to ensure reliable automation delivery:
Git-based version control
Automated pipelines
Controlled deployment workflows
Continuous integration practices

Ansible

An industry-standard automation platform that excels at network configuration management. We utilize Ansible for:
Network device configuration deployment
State validation and compliance checking
Integration with custom Python modules
Standardized workflow automation

Netbox

The central Source of Truth for network infrastructure data. NetBox serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
REST API provider for automation workflows

Python

The foundation of our automation framework, Python enables us to create modular, maintainable, and efficient network automation solutions. We leverage Python's extensive standard library and carefully selected packages to build:
Reusable automation components
Custom network management tools
API integrations
Data processing pipelines