Building more complex network topologies with multiple SR Linux nodes and interconnections using Containerlab.
Create a Containerlab topology with two SR Linux nodes connected by an ethernet-1/1 interface on both ends. Configure basic IP addresses on these interfaces using the startup-config block in the YAML.
# srl_2_nodes.clab.yaml
name: srl-2-nodes
topology:
nodes:
srl1:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux
startup-config: |
system {
name {
host-name srl1
}
}
interface ethernet-1/1 {
admin-state enable
subinterface 0 {
admin-state enable
ipv4 {
address 10.0.0.1/24
}
}
}
srl2:
kind: nokia_srlinux
image: ghcr.io/nokia/srlinux
startup-config: |
system {
name {
host-name srl2
}
}
interface ethernet-1/1 {
admin-state enable
subinterface 0 {
admin-state enable
ipv4 {
address 10.0.0.2/24
}
}
}
links:
- endpoints: ["srl1:ethernet-1/1", "srl2:ethernet-1/1"]Instructions:
- Save the YAML as
srl_2_nodes.clab.yaml. - Deploy the lab:
sudo containerlab deploy -t srl_2_nodes.clab.yaml --reconfigure. - Verify connectivity from
srl1:docker exec -it clab-srl-2-nodes-srl1 sr_cli "ping 10.0.0.2". - Destroy the lab when done:
sudo containerlab destroy -t srl_2_nodes.clab.yaml --cleanup.