Installation

netlab is a Python3 package[1] that uses Python 3.10[2] or later. It runs on Linux[3] (we’re doing all our tests on Ubuntu), including Windows Subsystem for Linux or Multipass on macOS.

netlab is a high-level abstraction and orchestration tool that relies on other tools to provide the low-level functionality:

  • Container/VM virtualization with Docker, Podman, or libvirt/KVM

  • Container/VM orchestration with containerlab or Vagrant

  • Configuration deployment with shell scripts, netmiko, or Ansible[4]

High-level architecture

If you already have a Linux environment you can use with netlab, please proceed directly to Ubuntu server installation or generic Linux installation.

Otherwise, you’ll have to select the platform you want to use and create your lab environment (including netlab installation). If you don’t want to invest your time in building a Linux VM, run netlab with container-based network devices in GitHub Codespaces (netlab examples, BGP labs, IS-IS labs, EVPN labs, SR-MPLS labs).

Selecting the Platform and Low-Level Tools

We test netlab with Docker/containerlab and libvirt/Vagrant on Ubuntu. Both combinations should work on non-Debian-based Linux distributions but will likely require manual software installation.

You can also run netlab in a Linux virtual machine or a Ubuntu instance in a public cloud.

When selecting the virtualization environment, consider the following:

  • Ubuntu-based netlab is the easiest to set up; the netlab install command does all the heavy lifting for you and installs all the prerequisite software (KVM, libvirt, Vagrant, Docker, containerlab, Ansible).

  • Containers provisioned with containerlab start much faster than virtual machines, but you can get only a few network devices in native container format (Arista cEOS, Cisco IOS XRd, FRR, Juniper cRPD, Nokia SR Linux and SR-SIM, VyOS). The vrnetlab fork by Roman Dodin can build containers that run virtual machines for many network devices, but those containers might take longer to start than Vagrant boxes.

  • Vagrant provider for libvirt[5] supports parallel VM provisioning, resulting in pretty fast lab creation. Unfortunately, you’ll have to build the libvirt Vagrant boxes manually, but the netlab libvirt package usually does 90% of the work for you. However, we’re no longer developing new Vagrant functionality, so you might be better off focusing on containerlab.

Creating the Lab Environment

We have documented how you can set up your lab:

Tip

If you decide to run the network labs within an Ubuntu VM, create a new VM and use the automated software installation procedure. Starting with a fresh VM is much easier and safer than installing the necessary software on an existing VM.

Finally, you can use netlab on Apple Silicon (basics, using Arista cEOS), but all we managed to do was run containers (Arista EOS, FRR, SR Linux) on a Multipass-provisioned Ubuntu VM. If you’re using a laptop with Apple silicon, run more complex labs on a Ubuntu VM running on-premises or in a public cloud, or a bare-metal server.

Next Steps