Containerlab, the future of your virtual network lab

In the last month, it was brought to my attention via a LinkedIn post, a new project that is aiming to change the way we do our network labs.

You may think: “Well, why do I need something like that, my CML (Cisco Modeling Labs) or my EVE-NG servers are doing that for me today and I’m quite happy with that”.

This is a completely reasonable statement. Over the last years, we have seen how EVE-NG and CML have taken over the market when it comes to Virtual Network lab environments. But are they enough? And for how long do you want to create links between devices and spend so much time building configurations for each device so you can then automate?

Containerlab to the rescue

Please keep in mind that the following is 100% my opinion and satisfaction with this project and not a “you must be doing it wrong” statement.

Tools like CML and EVE-NG are great, do not get me wrong, but one of the major problems with them is the fact that you need to pay to be able to enjoy the nice features.
Of course, code that does what these tools do should be compensated. It’s not like the developers of these tools have all the time and money in the world to build these systems for free. But I’m a firm believer in Open Source and Containerlab is part of that.

Secondly, tools like EVE-NG and CML require a high number of resources like RAM and CPU. Not adding how troublesome it can be to add new images to the system, and here is where Containerlab makes your life simple.

What is Containerlab?

Containerlab is an orchestration and container management tool for networking.

This means that you can take advantage of already available and well-known systems like Docker to build network infrastructure based on containers.

How is it better?

Well, that is a very good question. There are already tools out there that allow you to implement this sort of infrastructure (Vagrant), but they still require a high number of resources to be able to run 2 or more instances of different systems (clients, switches, etc.)

What are some of the features of Containerlab?

Containerlab has a number of features that make it very attractive, at least from my perspective. Here are some of those features:

  1. Everything is a container, which means is light and fast.
  2. You can have any sort of system integrated here, from a Linux image to an Arista EOS instance.
  3. Since it uses containers, the resources it requires are minimum.
  4. A programmatic way to define the network segments and configurations.
  5. Persistent configuration for devices, via volume mounting.
  6. Auto topology graph generation
  7. You can find a full list here

Getting started with Containerlab

To get started with Containerlab, there is one major requirement. You need to install Docker, if you do not know how to install Docker, you can find that info here

Once you have installed Docker, you will have some different steps to take. For example, if you are running Windows or MAC, or Linux, some steps are different.

This guide will assume you are running ubuntu 18.04 or higher.

For more info on how to install it on your environment check https://containerlab.srlinux.dev/install/

Installing Containerlab on Ubuntu

We have a couple of options:

  1. Install using the bash script that the developers and maintainers of Containerlab created for us
  2. Install using package management system (APT)

We will be using the bash script, as it is very simple:

  1. Open your terminal
  2. Enter the following command:
sudo bash -c "$(curl -sL https://get-clab.srlinux.dev)"

Once that command is completed you should see some output like this:

Image of result of containerlab installation using the bash script

If you are seeing this, it means that you have successfully installed the containerlab system
so let’s do so by entering the following command to check which version we actually installed

containerlab version
clab version

# Output should be
                           _                   _       _
                 _        (_)                 | |     | |
 ____ ___  ____ | |_  ____ _ ____   ____  ____| | ____| | _
/ ___) _ \|  _ \|  _)/ _  | |  _ \ / _  )/ ___) |/ _  | || \
( (__| |_|| | | | |_( ( | | | | | ( (/ /| |   | ( ( | | |_) )
\____)___/|_| |_|\___)_||_|_|_| |_|\____)_|   |_|\_||_|____/

    version: 0.14.4
     commit: 34e8301
       date: 2021-06-06T07:42:18Z
     source: https://github.com/srl-labs/containerlab
 rel. notes: https://containerlab.srlinux.dev/rn/0.14.4

we can also use the clab short version of containerlab to save on typing, this maps to containerlab on /usr/bin

Closing thoughts

Now that you have the containerlab environment installed, go over to the official page documentation and read some more about how to add containers and images into the system.

In the meantime, I will do the same and work on the following post, where we will learn about the syntax we need to use, and how we can build a lab with 2 Arista cEOS images and a couple of clients

Leave a Reply