Running netlab and BGP Labs on Apple Silicon
I usually say that you cannot run netlab on Apple silicon because the vendors don’t provide ARM images. However, when I saw an ARM version of the FRRouting container, I started wondering whether I could run the BGP labs (admittedly only on FRR containers) on my M2 MacBook Pro.
TL&DR: Yes, you can do that.
Now for the recipe:
- Install multipass. I used Homebrew to install it.
- Start the default Ubuntu VM
% multipass shell
- Once you get the Ubuntu prompt, install Pip3 and netlab:
$ sudo apt-get update
$ sudo apt install python3-pip
$ pip3 install networklab
- Pip3 creates the
~/.local/bin
directory, which is not yet in the PATH. Logout and reconnect to the Ubuntu VM (yet again, usingmultipass shell
) - Use
netlab install
to install Ubuntu tools, Containerlab, and Ansible
$ netlab install ubuntu containerlab ansible
- The installation script adds the current user to the
docker
group to allow you to start containers. However, the shell process in the current session is not yet a member of that group. You have to log out and reconnect to the Ubuntu VM. - Start a simple lab to test the installation
$ netlab test clab
You’re ready to run labs using FRR containers on your Apple laptop. Install BGP labs and have fun ;)
This is great; thanks for sharing, Ivan. May I know the specs of your Mac Book Pro?
I was testing the labs on a MacBook Air (M2) with 8 GB of RAM
Hi Ivan, thanks for sharing this. However, there seem to be an issue when running the bgp lab 0-ffrouting.
and then the deployment seems to fail too.
Did you change the external devices from Cumulus Linux to FRR (https://bgplabs.net/1-setup/#setting-up-the-labs)?
I had changed them in the defaults.yml, but apparently the issue was that I needed to change them in the lab's topology.yml file too. Thanks!
Ouch, good one. Will fix. Thank you!
Thanks a million for reporting this. Fixed, a plugin switches the devices in that lab from CL to FRR when running on aarch64 architecture.
Anyone having issues installing containerlab?
Install containerlab version 0.49.0 Downloading https://github.com/srl-labs/containerlab/releases/download/v0.49.0/containerlab_0.49.0_linux_amd64.deb curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. Failed to install containerlab with the arguments provided: -v 0.49.0 Accepted cli arguments are: [--help|-h ] ->> prints this help [--version|-v <desired_version>] . When not defined it fetches the latest release from GitHub e.g. --version v0.1.1 [--use-pkg] ->> install from deb/rpm packages [--no-sudo] ->> install without sudo [--verify-checksum] ->> verify checksum of the downloaded file For support, go to https://github.com/srl-labs/containerlab/issues
Installation script containerlab.sh failed, exiting...
I have no idea what happened to you. I started a fresh multipass Ubuntu 22.04 instance, followed the recipe, and got containerlab 0.49.0 installed.
I did a bit of a search on the error message you got, and all hits hint that it's a local SSL/CA issue.
Did you try to install containerlab on some other platform? Please note that a fresh Ubuntu 22.04 instance is the only environment in which I have any chance of figuring out what might be wrong. Trying to replicate anything else is way beyond my skill set.
Got it working by exporting local trusted root certs to ubuntu instance and updating the certs. I think because of the company's IT certs. Thanks