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:

% 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, using multipass 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 ;)

3 comments:

  1. This is great; thanks for sharing, Ivan. May I know the specs of your Mac Book Pro? 

    Replies
    1. I was testing the labs on a MacBook Air (M2) with 8 GB of RAM

  2. Hi Ivan, thanks for sharing this. However, there seem to be an issue when running the bgp lab 0-ffrouting.

    ERRO[0000] failed deploy links for node "rtr": failed to Statfs "/proc/4928/ns/net": no such file or directory
    

    and then the deployment seems to fail too.

    fatal: [x1]: UNREACHABLE! => changed=false
      msg: 'Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "` echo ~/.ansible/tmp `"&& mkdir "` echo ~/.ansible/tmp/ansible-tmp-1710850548.1555705-5034-172158355871746 `" && echo ansible-tmp-1710850548.1555705-5034-172158355871746="` echo ~/.ansible/tmp/ansible-tmp-1710850548.1555705-5034-172158355871746 `" ), exited with result 1'
      unreachable: true
    
    Replies
    1. Did you change the external devices from Cumulus Linux to FRR (https://bgplabs.net/1-setup/#setting-up-the-labs)?

    2. 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!

    3. Ouch, good one. Will fix. Thank you!

    4. Thanks a million for reporting this. Fixed, a plugin switches the devices in that lab from CL to FRR when running on aarch64 architecture.

  3. 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...

    Replies
    1. 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.

    2. 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

Add comment
Sidebar