Skip to content

Containerlab

Estimated time to read: 3 minutes

  • Originally Written: March, 2024

Setup Notes

I've started using Containerlab to quickly setup some lab examples. I have the following configuration which seems to be working ok so far:

  • Ubuntu VM running Containerlab
    • 32G memory
    • 8 CPUs
    • 50GB disk
    • Single network adapter

I'm starting with some IP multicast scenarios using a small number (up to 4) of CSR 1000v routers and a couple of Linux containers. From the CSR 1000v datasheet, the minimum requirement is 1 vCPU/4 GB per instance.

Info

If you see the error the CPU virtualization support is required, but not available then you may need to enable hardware virtualization on the VM through the vCenter client.

To install Containerlab was fairly straight forward using the install guide found at:

https://containerlab.dev/install/

Since I'm using the CSR1000v I needed package the qcow2 virtual machine image into a container and used the vrnetlab project to do this. As per the Containerlab guide above the existing Vrnetlab project has been forked to support container based networking. The correct repo is found at:

https://github.com/hellt/vrnetlab

If you use the original vrnetlab repo with Containerlab you may run into this error and the nodes won't start.

launch.py: error: unrecognized arguments: --hostname csr-r1 --connection-mode tc

Onboarding the CSR 1000v

scp csr1000v-universalk9.17.03.04a-serial.qcow2 guest-01@10.1.1.1:/home/guest-01
  • Clone the vrnetlab Git repo
git clone https://github.com/hellt/vrnetlab
  • Move the csr1000v image to the csr folder
mv csr1000v-universalk9.17.03.04a-serial.qcow2  vrnetlab/csr/
  • Run the Makefile in the CSR folder. You may need sudo privileges to run Docker.
cd vrnetlab/csr/
make docker-image
  • If successful you should see a new Docker image
docker images
  • You can tag the image with your own username and push to your image registry
docker image tag vrnetlab/vr-csr:17.03.04a conmurphy/vr-csr:17.03.04a
docker login
docker push conmurphy/vr-csr:17.03.04a

Info

I did try Boxen which seemed straight forward to use but unfortunately I ran into some errors building the image.

I also found the build process output straight forward with vrnetlab. I might have overlooked something but I was only able to follow the install process in Boxen by looking at the log file.

tail +1f  /tmp/boxen2793225932/install_build.log

Running topologies

Now that it's installed and setup I can deploy the topology quite easily.

sudo containerlab deploy --topo topology.clab.yml

You can SSH directly into the routers and the default username/password for the CSR1000v is admin/admin

Comments