This lab builds a demo fabric of Nokia SR Linux devices with NetBox 4.4.6 and Ansible. Containerlab spins up the topology, NetBox is populated with Nokia device types, and playbooks from the netbox_integration_example branch of intent-based-ansible-lab generate and deploy intents.
Run this lab in GitHub Codespaces for free.
Learn more about Containerlab for Codespaces.
- Codespaces: click the button above and wait for the devcontainer to finish. Everything below is run from the repo root inside Codespaces.
- Local machine: follow the prerequisites and setup below, then run the same workflow.
- Containerlab installed. See the official docs.
- Git, Docker, and uv.
Tip
Why uv?
uv is a single, ultra-fast tool that can replace pip, pipx, virtualenv, pip-tools, poetry, and more. It automatically manages Python versions, handles ephemeral or persistent virtual environments (uv venv), lockfiles, and often runs 10–100× faster than pip installs.
git clone --recursive https://github.com/srl-labs/srl-netbox-demo
cd srl-netbox-demo
# Install uv (Linux/macOS)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the Nokia SR Linux Ansible collection
uv run ansible-galaxy collection install nokia.srlinuxImportant
Use --recursive because intent-based-ansible-lab is a submodule.
All commands run from the repo root. Replace the NetBox URL step with the Codespaces forwarded port if you are in Codespaces.
-
Deploy the topology
clab deploy -t srl_netbox.clab.yaml
- Spins up NetBox and the SR Linux fabric; expect ~4–5 minutes.
- Watch progress:
docker logs -f netbox - Wait until netbox_importer get healthy
-
Open NetBox
- Local:
http://127.0.0.1:8000(user/passadmin/admin). - Codespaces: open forwarded port 8000 in the Ports panel.
- Local:
-
Initialize NetBox data
bash api_scripts/import_infra.sh # imports device types, CFs, infrastructure intents bash api_scripts/import_service.sh # imports L2/L3 VPN services
-
Generate Ansible intents from NetBox
INTENT_DIR=$(pwd)/intents/generated_intents uv run ansible-playbook -i inv/ -e intent_dir=$INTENT_DIR \ intent-based-ansible-lab/playbooks/netbox_generate_intents.yml --diff
-
Deploy the generated intents
uv run ansible-playbook -i inv -e intent_dir=$INTENT_DIR \ intent-based-ansible-lab/playbooks/cf_fabric.yml --diff -
(Optional) Verify with fcli
CLAB_TOPO=srl_netbox.clab.yaml alias fcli="docker run -t --network $(grep '^name:' $CLAB_TOPO | awk '{print $2}') --rm \ -v /etc/hosts:/etc/hosts:ro -v ${PWD}/${CLAB_TOPO}:/topo.yml \ ghcr.io/srl-labs/nornir-srl:latest -t /topo.yml" fcli ni
-
Tear down when done
clab destroy -t srl_netbox.clab.yaml
- Containerlab bring-up can take several minutes; rerun
docker psanddocker logs -f netboxto verify health. - Make sure firewall/proxy rules allow the container connectivity defined in the topology.

