Step by Step Guide to Deploy Juniper cRPD Lab for Practice
- January 1, 1
- 14 min read
- 2860 words
#Step by Step Guide to Deploy Juniper cRPD Lab for Practice
1. Introduction
In this guide, tailored for network engineers and automation enthusiasts, Iโll show you step-by-step how to:
- Install Containerlab using Juniperโs cRPD image.
- Deploy a fully functional network lab.
- Manage licenses and add-on features to optimize your setup.
{== By the end of this article, youโll have the skills to build and manage your own containerized lab environment for testing, learning, or automation workflows. ==}
2. Prerequisites for Setting Up a Containerized Lab
To follow this guide, youโll need:
- A workstation running Ubuntu or Debian.
- Access to Juniperโs cRPD containerized image.
Important Note Download the crpd image and license from the official juniper channel, you need to have a proper account to download the images and license.
If youโre missing any of these components, Iโve included links to quick installation guides below to help you get started.
3. Step-by-Step Guide to Deploying Juniper cRPD with Containerlab
3.1 Installing Containerlab
In this article we are going to use containerlab for deploying the juniper containerized image i.e. cRPD Purpose of the Article:
3.1.1 Transfer the Junos cRPD image to your workstation.
You can use ftp or filezilla to transfer the image to your Ubuntu workstation. We created a folder for this purpose namely Juniper_cRPD_testing
ubu@ubu:~/Juniper_cRPD_testing$ ll
total 158364
drwxrwxr-x 2 ubu ubu 4096 Dec 15 18:25 ./
drwxr-x--- 17 ubu ubu 4096 Dec 15 18:24 ../
-rw-r--r-- 1 ubu ubu 238 Dec 15 18:25 cRPD_license.lic
-rw-r--r-- 1 ubu ubu 162144268 Dec 15 18:25 junos-routing-crpd-docker-amd64-23.2R1.13.tgz
ubu@ubu:~/Juniper_cRPD_testing$
Kindly Note For the convenience a file with extension .lic has been created with the name cRPD_license.lic and it contains the license code you must have received from Juniperโs cRPD containerized image.
3.1.2 Install Containerlab
To install all components at once, run the following command on any of the supported OSes w.r.t. Containerlab Installation
curl -sL https://containerlab.dev/setup | sudo -E bash -s "all"
you may need to install curl if not installed use
sudo apt install curlorsudo dnf install curl
The above mentioned command should be sufficient to install the containerlab and docker components.
3.1.3. Verify Containerlab Installation
3.1.3.1 Verify version of Containerlab and Docker
To verify the version of containerlab and docker, simply by issuing clab version and sudo docker version in your terminal.
ubu@ubu:~/Juniper_cRPD_testing$ clab version
____ ___ _ _ _____ _ ___ _ _ _____ ____ _ _
/ ___/ _ \| \ | |_ _|/ \ |_ _| \ | | ____| _ \| | __ _| |__
| | | | | | \| | | | / _ \ | || \| | _| | |_) | |/ _` | '_ \
| |__| |_| | |\ | | |/ ___ \ | || |\ | |___| _ <| | (_| | |_) |
\____\___/|_| \_| |_/_/ \_\___|_| \_|_____|_| \_\_|\__,_|_.__/
version: 0.60.1
commit: 37adecb8
date: 2024-12-07T19:58:41Z
source: https://github.com/srl-labs/containerlab
rel. notes: https://containerlab.dev/rn/0.60/#0601
ubu@ubu:~/Juniper_cRPD_testing$
///caption
fig1: containerlab version
///
ubu@ubu:~/Juniper_cRPD_testing$ sudo docker version
Client: Docker Engine - Community
Version: 26.1.4
API version: 1.45
Go version: go1.21.11
Git commit: 5650f9b
Built: Wed Jun 5 11:28:57 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 26.1.4
API version: 1.45 (minimum version 1.24)
Go version: go1.21.11
Git commit: de5c9cf
Built: Wed Jun 5 11:28:57 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.24
GitCommit: 88bf19b2105c8b17560993bee28a01ddc2f97182
runc:
Version: 1.2.2
GitCommit: v1.2.2-0-g7cb3632
docker-init:
Version: 0.19.0
GitCommit: de40ad0
ubu@ubu:~/Juniper_cRPD_testing$
3.1.4 Enable passwordless docker commands
It is always handy to add user to the docker group to enable passwordless docker commands
sudo usermod -aG docker ${USER}
logout and login again to get the passwordless docker command access.
3.1.5 Dockerize the image
Assuming you have Docker installed on your system (as mentioned above), you would first load the container image:
sudo docker load -i junos-routing-crpd-docker-amd64-23.2R1.13.tgz
ubu@ubu:~/Juniper_cRPD_testing$ sudo docker load -i junos-routing-crpd-docker-amd64-23.2R1.13.tgz
[sudo] password for ubu:
291ad76fd150: Loading layer [==================================================>] 504.5MB/504.5MB
Loaded image: crpd:23.2R1.13
3.1.5.1 Verify uploaded image
To verify the uploaded images we can use docker images command.
ubu@ubu:~/Juniper_cRPD_testing$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
crpd 23.2R1.13 0cf5adbda509 18 months ago 498MB
ubu@ubu:~/Juniper_cRPD_testing$
4.1 Define topology file
To define a topology we must create a yaml file and define all the parameters in that file e.g. we created a yaml file i.e. touch clos_topology.clab.yaml and define the parameters suited to that file using nano clos_topology.clab.yaml.
Including inline comment for each line of configuration in yaml file for better readability:
name: clos-spine-leaf-topology # Name of the containerlab topology
topology:
nodes: # Definition of network nodes
spine1: # First spine node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt_ipv4: 172.20.20.11 # Management IP address
spine2: # Second spine node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt_ipv4: 172.20.20.12 # Management IP address
leaf1: # First leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt_ipv4: 172.20.20.21 # Management IP address
leaf2: # Second leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt_ipv4: 172.20.20.22 # Management IP address
leaf3: # Third leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt_ipv4: 172.20.20.23 # Management IP address
ws1: # First workstation node
kind: linux # Node type (Linux)
image: alpine:latest # Docker image for the node
ws2: # Second workstation node
kind: linux # Node type (Linux)
image: alpine:latest # Docker image for the node
ws3: # Third workstation node
kind: linux # Node type (Linux)
image: alpine:latest # Docker image for the node
links: # Network links between nodes
- endpoints: ["spine1:eth1", "leaf1:eth1"] # Link between spine1 and leaf1
- endpoints: ["spine1:eth2", "leaf2:eth1"] # Link between spine1 and leaf2
- endpoints: ["spine1:eth3", "leaf3:eth1"] # Link between spine1 and leaf3
- endpoints: ["spine2:eth1", "leaf1:eth2"] # Link between spine2 and leaf1
- endpoints: ["spine2:eth2", "leaf2:eth2"] # Link between spine2 and leaf2
- endpoints: ["spine2:eth3", "leaf3:eth2"] # Link between spine2 and leaf3
- endpoints: ["leaf1:eth3", "ws1:eth1"] # Link between leaf1 and ws1
- endpoints: ["leaf2:eth3", "ws2:eth1"] # Link between leaf2 and ws2
- endpoints: ["leaf3:eth3", "ws3:eth1"] # Link between leaf3 and ws3
4.2 Deploying the containerlab
Use sudo containerlab deploy -t clos_topology.clab.yaml --debug to deploy the containerlab using the topology file clos_topology.clab.yaml
should end up as following:
INFO[0008] Adding ssh config for containerlab nodes
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฎ
โ Name โ Kind/Image โ State โ IPv4/6 Address โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf1 โ crpd โ running โ 172.20.20.21 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::5 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf2 โ crpd โ running โ 172.20.20.22 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::4 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf3 โ crpd โ running โ 172.20.20.23 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::3 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-spine1 โ crpd โ running โ 172.20.20.11 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::6 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-spine2 โ crpd โ running โ 172.20.20.12 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::2 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws1 โ linux โ running โ 172.20.20.3 โ
โ โ alpine:latest โ โ 3fff:172:20:20::8 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws2 โ linux โ running โ 172.20.20.2 โ
โ โ alpine:latest โ โ 3fff:172:20:20::7 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws3 โ linux โ running โ 172.20.20.4 โ
โ โ alpine:latest โ โ 3fff:172:20:20::9 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโฏ
4.3 Accessing the cRPD nodes
We can access our cRPD nodes through:
- Netconf for programmatic access.
- Docker CLI or bash for direct command-line management.
- Alpine Linux CLI for deeper system control.
4.3.1 Netconf access
we can login to devices simply by ssh to the ip address of the node with default credentials root:clab123
ubu@ubu:~/Juniper_cRPD_testing$ ssh root@172.20.20.21
(root@172.20.20.21) Password:
===>
Containerized Routing Protocols Daemon (CRPD)
Copyright (C) 2020-2023, Juniper Networks, Inc. All rights reserved.
<===
root@leaf1:~#
4.3.2 Docker CLI or bash access
no username or passwords need to be used (should have direct access)
ubu@ubu:~/Juniper_cRPD_testing$
ubu@ubu:~/Juniper_cRPD_testing$ docker exec -it clab-clos-spine-leaf-topology-leaf1 bash
===>
Containerized Routing Protocols Daemon (CRPD)
Copyright (C) 2020-2023, Juniper Networks, Inc. All rights reserved.
<===
root@leaf1:/# exit
exit
ubu@ubu:~/Juniper_cRPD_testing$ docker exec -it clab-clos-spine-leaf-topology-leaf1 cli
root@leaf1>
root@leaf1> exit
ubu@ubu:~/Juniper_cRPD_testing$
4.3.3 Accessing alpine linux cli
cli of alpine can be accessed using the command docker exec -it clab-clos-spine-leaf-topology-ws1 ash
ubu@ubu:~/Juniper_cRPD_testing$ docker exec -it clab-clos-spine-leaf-topology-ws1 ash
/ # pwd
/
/ # ls
bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
/ #
/ # exit
ubu@ubu:~/Juniper_cRPD_testing$
4.4 License management for cRPD instances
4.4.1. Check the license status of the deployed nodes
ubu@ubu:~/Juniper_cRPD_testing$ docker exec -it clab-clos-spine-leaf-topology-leaf1 cli
root@leaf1> show system license
License usage: none
Licenses installed: none
root@leaf1>
4.4.2 Transfer the license file to the cRPD instances
ubu@ubu:~/Juniper_cRPD_testing$ ll | grep cRPD
-rw-r--r-- 1 ubu ubu 238 Dec 15 18:25 cRPD_license.lic
ubu@ubu:~/Juniper_cRPD_testing$
ubu@ubu:~/Juniper_cRPD_testing$ docker cp cRPD_license.lic clab-clos-spine-leaf-topology-leaf1:/var/tmp
Successfully copied 2.05kB to clab-clos-spine-leaf-topology-leaf1:/var/tmp
ubu@ubu:~/Juniper_cRPD_testing$ docker cp cRPD_license.lic clab-clos-spine-leaf-topology-leaf2:/var/tmp
Successfully copied 2.05kB to clab-clos-spine-leaf-topology-leaf2:/var/tmp
ubu@ubu:~/Juniper_cRPD_testing$ docker cp cRPD_license.lic clab-clos-spine-leaf-topology-leaf3:/var/tmp
Successfully copied 2.05kB to clab-clos-spine-leaf-topology-leaf3:/var/tmp
ubu@ubu:~/Juniper_cRPD_testing$
ubu@ubu:~/Juniper_cRPD_testing$ docker cp cRPD_license.lic clab-clos-spine-leaf-topology-spine1:/var/tmp
Successfully copied 2.05kB to clab-clos-spine-leaf-topology-spine1:/var/tmp
ubu@ubu:~/Juniper_cRPD_testing$ docker cp cRPD_license.lic clab-clos-spine-leaf-topology-spine2:/var/tmp
Successfully copied 2.05kB to clab-clos-spine-leaf-topology-spine2:/var/tmp
ubu@ubu:~/Juniper_cRPD_testing$
4.4.3 Load the system license
login to each instance of cRPD and load the system license using request system license add /var/tmp/cRPD_license.lic
ubu@ubu:~/Juniper_cRPD_testing$ docker exec -it clab-clos-spine-leaf-topology-leaf1 cli
root@leaf1> request system license add /var/tmp/cRPD_license.lic
E20231213001: successfully added
add license complete (no errors)
root@leaf1>
4.4.4 Check the license status again
check the license status using show system license
root@leaf1> show system license
License usage:
Licensed Licensed Licensed
Feature Feature Feature
Feature name used installed needed Expiry
containerized-rpd-advanced 1 1 0 2025-06-13 18:12:47 UTC
Licenses installed:
License identifier: **truncated output**
License version: 4
Order Type: trial
Software Serial Number: **truncated output**
Customer ID: โJuniperโ
Features:
containerized-rpd-advanced - Containerized routing protocol daemon with advanced features
date-based, 2024-12-15 18:12:47 UTC - 2025-06-13 18:12:47 UTC
root@leaf1>
Repeat the same process for all the spine and leaf images to activate the license.
4.5 Add-on Features to Enhance Your Lab
4.5.1 Inspect and monitor lab topology
We can always check the node IPs ans states using sudo containerlab inspect --all
ubu@ubu:~/Juniper_cRPD_testing$ sudo containerlab inspect --all
[sudo] password for ubu:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฎ
โ Topology โ Lab Name โ Name โ Kind/Image โ State โ IPv4/6 Address โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clos_topology.clab.yaml โ clos-spine-leaf-topology โ clab-clos-spine-leaf-topology-leaf1 โ crpd โ running โ 172.20.20.21 โ
โ โ โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::5 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-leaf2 โ crpd โ running โ 172.20.20.22 โ
โ โ โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::4 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-leaf3 โ crpd โ running โ 172.20.20.23 โ
โ โ โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::3 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-spine1 โ crpd โ running โ 172.20.20.11 โ
โ โ โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::6 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-spine2 โ crpd โ running โ 172.20.20.12 โ
โ โ โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::2 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-ws1 โ linux โ running โ 172.20.20.3 โ
โ โ โ โ alpine:latest โ โ 3fff:172:20:20::8 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-ws2 โ linux โ running โ 172.20.20.2 โ
โ โ โ โ alpine:latest โ โ 3fff:172:20:20::7 โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ โ โ clab-clos-spine-leaf-topology-ws3 โ linux โ running โ 172.20.20.4 โ
โ โ โ โ alpine:latest โ โ 3fff:172:20:20::9 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโฏ
ubu@ubu:~/Juniper_cRPD_testing$
4.5.2 Container state
It can be vital to verify the container states using docker ps
ubu@ubu:~/Juniper_cRPD_testing$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1dee2894e01a alpine:latest "/bin/sh" 23 minutes ago Up 23 minutes clab-clos-spine-leaf-topology-ws2
76845031138a alpine:latest "/bin/sh" 23 minutes ago Up 23 minutes clab-clos-spine-leaf-topology-ws1
718e681a6c41 alpine:latest "/bin/sh" 23 minutes ago Up 23 minutes clab-clos-spine-leaf-topology-ws3
6cf691b5b58a crpd:23.2R1.13 "/sbin/runit-init.sh" 23 minutes ago Up 23 minutes 22/tcp, 179/tcp, 830/tcp, 3784/tcp, 4784/tcp, 6784/tcp, 7784/tcp, 50051/tcp clab-clos-spine-leaf-topology-spine1
734f3458c0b6 crpd:23.2R1.13 "/sbin/runit-init.sh" 23 minutes ago Up 23 minutes 22/tcp, 179/tcp, 830/tcp, 3784/tcp, 4784/tcp, 6784/tcp, 7784/tcp, 50051/tcp clab-clos-spine-leaf-topology-leaf1
659c030cd2bf crpd:23.2R1.13 "/sbin/runit-init.sh" 23 minutes ago Up 23 minutes 22/tcp, 179/tcp, 830/tcp, 3784/tcp, 4784/tcp, 6784/tcp, 7784/tcp, 50051/tcp clab-clos-spine-leaf-topology-leaf2
5fff97427ccd crpd:23.2R1.13 "/sbin/runit-init.sh" 23 minutes ago Up 23 minutes 22/tcp, 179/tcp, 830/tcp, 3784/tcp, 4784/tcp, 6784/tcp, 7784/tcp, 50051/tcp clab-clos-spine-leaf-topology-spine2
33a3b9c4b677 crpd:23.2R1.13 "/sbin/runit-init.sh" 23 minutes ago Up 23 minutes 22/tcp, 179/tcp, 830/tcp, 3784/tcp, 4784/tcp, 6784/tcp, 7784/tcp, 50051/tcp clab-clos-spine-leaf-topology-leaf3
ubu@ubu:~/Juniper_cRPD_testing$
4.5.3 Save the lab
Saving and reloading lab configurations for repeatable setups could be done by just issuing clab save command.
INFO[0000] Parsing & checking topology file: clos_topology.clab.yaml
INFO[0000] saved cRPD configuration from leaf3 node to /home/ubu/Juniper_cRPD_testing/clab-clos-spine-leaf-topology/leaf3/config/juniper.conf
INFO[0000] saved cRPD configuration from spine1 node to /home/ubu/Juniper_cRPD_testing/clab-clos-spine-leaf-topology/spine1/config/juniper.conf
INFO[0000] saved cRPD configuration from leaf2 node to /home/ubu/Juniper_cRPD_testing/clab-clos-spine-leaf-topology/leaf2/config/juniper.conf
INFO[0000] saved cRPD configuration from spine2 node to /home/ubu/Juniper_cRPD_testing/clab-clos-spine-leaf-topology/spine2/config/juniper.conf
INFO[0000] saved cRPD configuration from leaf1 node to /home/ubu/Juniper_cRPD_testing/clab-clos-spine-leaf-topology/leaf1/config/juniper.conf
4.5.4 Tearing down the Lab
Tear down the lab when done to optimize resources, once you are done with the lab:
sudo containerlab destroy -t clos_topology.clab.yaml
INFO[0000] Parsing & checking topology file: clos_topology.clab.yaml
INFO[0000] Parsing & checking topology file: clos_topology.clab.yaml
INFO[0000] Destroying lab: clos-spine-leaf-topology
INFO[0000] Removed container: clab-clos-spine-leaf-topology-ws2
INFO[0000] Removed container: clab-clos-spine-leaf-topology-ws3
INFO[0000] Removed container: clab-clos-spine-leaf-topology-spine1
INFO[0000] Removed container: clab-clos-spine-leaf-topology-ws1
INFO[0000] Removed container: clab-clos-spine-leaf-topology-leaf3
INFO[0000] Removed container: clab-clos-spine-leaf-topology-leaf1
INFO[0000] Removed container: clab-clos-spine-leaf-topology-spine2
INFO[0000] Removed container: clab-clos-spine-leaf-topology-leaf2
INFO[0000] Removing containerlab host entries from /etc/hosts file
INFO[0000] Removing ssh config for containerlab nodes
4.5.5 Visualize the lab topology
The graphical view of the lab topology can be seen locally or on a remote server for better insights.
4.5.5.1 Graphical view of topology on local server
ubu@ubu:~/Juniper_cRPD_testing$ sudo clab graph -t clos_topology.clab.yaml
INFO[0000] Parsing & checking topology file: clos_topology.clab.yaml
INFO[0000] Serving topology graph on http://0.0.0.0:50080
open your local browser and use the above mentioned url http://0.0.0.0:50080

4.5.5.2 Graphical view of topology on remote server
If containerlab is running on remote server, we can leverage the port forwarding to get this view on our local browser
- The port forwarding will stay active as long as the SSH session is open. To keep it running in the background, use:
ssh -L 50080:localhost:50080 username@remote_server_ip
open your local browser and use the url http://localhost:50080/
4.5.6 Alternate linux workstation
We used alpine because it is lightest(as I know) linux workstation which can be used for checking the basic ip connectivity, however we can use ubuntu instead of alpine as workstation, the only change need to be done in topology file, please refer following clos-spine-leaf-topology with ubuntu workstations.
---
name: clos-spine-leaf-topology # Name of the containerlab topology
topology:
nodes: # Definition of network nodes
spine1: # First spine node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt-ipv4: 172.20.20.11 # Management IP address
spine2: # Second spine node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt-ipv4: 172.20.20.12 # Management IP address
leaf1: # First leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt-ipv4: 172.20.20.21 # Management IP address
leaf2: # Second leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt-ipv4: 172.20.20.22 # Management IP address
leaf3: # Third leaf node
kind: crpd # Node type (Juniper cRPD)
image: crpd:23.2R1.13 # Docker image for the node
mgmt-ipv4: 172.20.20.23 # Management IP address
ws1: # First workstation node
kind: linux # Node type (Linux)
image: ubuntu:latest # Docker image for the node
ws2: # Second workstation node
kind: linux # Node type (Linux)
image: ubuntu:latest # Docker image for the node
ws3: # Third workstation node
kind: linux # Node type (Linux)
image: ubuntu:latest # Docker image for the node
links: # Network links between nodes
- endpoints: ["spine1:eth1", "leaf1:eth1"] # Link between spine1 and leaf1
- endpoints: ["spine1:eth2", "leaf2:eth1"] # Link between spine1 and leaf2
- endpoints: ["spine1:eth3", "leaf3:eth1"] # Link between spine1 and leaf3
- endpoints: ["spine2:eth1", "leaf1:eth2"] # Link between spine2 and leaf1
- endpoints: ["spine2:eth2", "leaf2:eth2"] # Link between spine2 and leaf2
- endpoints: ["spine2:eth3", "leaf3:eth2"] # Link between spine2 and leaf3
- endpoints: ["leaf1:eth3", "ws1:eth1"] # Link between leaf1 and ws1
- endpoints: ["leaf2:eth3", "ws2:eth1"] # Link between leaf2 and ws2
- endpoints: ["leaf3:eth3", "ws3:eth1"] # Link between leaf3 and ws3
output would looks like as following:
INFO[0011] Adding ssh config for containerlab nodes
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโฎ
โ Name โ Kind/Image โ State โ IPv4/6 Address โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf1 โ crpd โ running โ 172.20.20.21 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::6 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf2 โ crpd โ running โ 172.20.20.22 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::4 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-leaf3 โ crpd โ running โ 172.20.20.23 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::5 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-spine1 โ crpd โ running โ 172.20.20.11 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::3 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-spine2 โ crpd โ running โ 172.20.20.12 โ
โ โ crpd:23.2R1.13 โ โ 3fff:172:20:20::2 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws1 โ linux โ running โ 172.20.20.2 โ
โ โ ubuntu:latest โ โ 3fff:172:20:20::7 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws2 โ linux โ running โ 172.20.20.4 โ
โ โ ubuntu:latest โ โ 3fff:172:20:20::9 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโค
โ clab-clos-spine-leaf-topology-ws3 โ linux โ running โ 172.20.20.3 โ
โ โ ubuntu:latest โ โ 3fff:172:20:20::8 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโฏ
ubu@ubu:~/Juniper_cRPD_testing$
5. Conclusion
Congratulations! Youโve deployed a fully functional network lab using Juniper cRPD and Containerlab. This setup is a powerful tool for testing configurations, simulating network scenarios, and automating workflows.