--- title: "Running netlab and BGP Labs on Apple Silicon" url: https://blog.ipspace.net/2024/03/netlab-bgp-apple-silicon/ date: 2024-03-18 lastmod: 2025-12-05 author: "Ivan Pepelnjak" tags: ["netlab","BGP"] --- # 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 wondered 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](https://multipass.run/docs/installing-on-macos). 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 ``` > **Warning:** > > Recent versions of **pip3** (starting with Ubuntu 22.04 or 24.04) are paranoid about breaking throwaway VMs. Adding `--break-system-packages` parameter to **pip3** usually solves the problem. * Pip3 creates the `~/.local/bin` directory, which is not yet in the PATH. Logout (`exit` or Ctrl-D) 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, and we probably don't have enough disk space for the next step anyway. * Log out of the Ubuntu instance. * Increase the instance disk size and restart it. ``` % multipass stop primary % multipass set local.primary.disk=10G % multipass shell ``` * You might have to increase the memory allocated to the VM and the number of virtual CPUs it gets. Add these commands in front of the `multipass shell` command: ``` % multipass set local.primary.cpus=4 % multipass set local.primary.memory=8G ``` * The multipass instance [might not have the Linux kernel drivers](https://netlab.tools/caveats/#frr) we need for the FRR management VRF and MPLS forwarding. If VRF, VXLAN, or MPLS labs fail, log into the Ubuntu instance and install the missing generic Linux drivers: ``` sudo apt install linux-generic ``` * Just to be on the safe side, log out of the VM, restart it, and log in: ``` % multipass restart primary % multipass shell ``` * 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](https://bgplabs.net/1-setup/#setting-up-the-labs) and have fun ;) You can also [use Arista cEOS containers](https://blog.ipspace.net/2025/02/arista-ceos-arm-apple-silicon/) or [Nokia SR Linux containers](https://blog.ipspace.net/2024/09/srlinux-arm-apple-silicon/) instead of FRR containers, and someone even [made Cisco IOL container work on a Mac](https://www-packetswitch-co-uk.cdn.ampproject.org/c/s/www.packetswitch.co.uk/running-containerlab-in-macos-cisco-iol-ceos-2/amp/).