We wanted to make SR Linux the most accessible Network OS. With that in mind we made SR Linux container image available to everybody without any registration or licensing requirements
The public SR Linux container image when powered by containerlab allows users to build virtual labs with SR Linux in no time. All that to let you not only read about the features we offer, but to try them live!
A single container image that hosts management, control and data plane functions is all you need to get started.
The container image is hosted at the publicly accessible GitHub container registry. This means that you can pull SR Linux container image exactly the same way as you would pull any other image.
Because SR Linux simulator image is distributed exclusively in a container packaging, it offers great startup times (~1min) and extremely resource friendly1. Because of its containerized nature, we wanted to create a lab orchestration tool that would play nicely with containerized Network OSes and be more "as code" when compared to traditional GUI-based network virtualization tools. Enter containerlab.
Containerlab is an open source project that provides a CLI for orchestrating and managing container-based networking labs. It starts the containers, builds a virtual wiring between them and manages labs lifecycle.
The extremely low footprint of Containerlab and YAML-based topology definition made it a perfect fit for the SR Linux-based labs.
You are minutes away from deploying your first SR Linux lab using containerlab. But first, you need to install containerlab and Docker on any Linux system, which can be as easy as running a single installation command2:
Everything is ready for the lab deployment. We are going to spin up this lovely topology with two leaf and one spine switches making up our tiny fabric with two clients connected.
Lab Topology
How do we deploy it? Enter in some directory where the lab is about to be cloned and run this one-liner:
There are not a lot of reasons not to use containerlab, but "not a lot" doesn't mean there aren't any. You can run SR Linux container image with docker CLI as well, but of course, you will have to do more things manually.
The above command will start the container named srlinux emulating the D3L hardware variant on the host system with a single management interface attached to the default docker network.
To connect to the CLI of the container you can either use docker exec -it srlinux sr_cli or SSH to the container over the network:
# default password is NokiaSrl1!sshadmin@$(dockerinspect-f'{{.NetworkSettings.IPAddress}}'srlinux)
Using docker CLI is a viable approach when all you need is to run a standalone container to explore SR Linux CLI or to use its management interfaces. However, it is not particularly suitable to run multiple SR Linux containers with links between them, as this requires some extra work.
For multi-node SR Linux deployments containerlab offers a better way.
Deployment verification
Regardless of the way you spin up SR Linux container it will be visible in the output of the docker ps command. If the deployment process went well and the container did not exit, a user can see it with docker ps command:
The logs of the running container can be displayed with docker logs <container-name>.
In case of the misconfiguration or runtime errors, container may exit abruptly. In that case it won't appear in the docker ps output as this command only shows running containers. Containers which are in the exited status will be part of the docker ps -a output. In case your container exits abruptly, check the logs as they typically reveal the cause of termination.
Now that the lab is ready, we can connect to the nodes directly from the host system using the node names as seen in the table above. Let' connect to the leaf1 node.
sshleaf1
Warning: Permanently added 'leaf1' (ED25519) to the list of known hosts.................................................................: Welcome to Nokia SR Linux! :: Open Network OS for the NetOps era. :: :: This is a freely distributed official container image. :: Use it - Share it :: :: Get started: https://learn.srlinux.dev :: Container: https://go.srlinux.dev/container-image :: Docs: https://doc.srlinux.dev/24-7 :: Rel. notes: https://doc.srlinux.dev/rn24-7-2 :: YANG: https://yang.srlinux.dev/v24.7.2 :: Discord: https://go.srlinux.dev/discord :: Contact: https://go.srlinux.dev/contact-sales :................................................................Using configuration file(s): ['/home/admin/.srlinuxrc']Welcome to the srlinux CLI.Type 'help' (and press <ENTER>) if you need any help using this.--{ running }--[ ]--A:leaf1#
Alright, we are in, let's get familiar with the SR Linux CLI!