Skip to content

Latest commit

 

History

History
59 lines (55 loc) · 1.73 KB

File metadata and controls

59 lines (55 loc) · 1.73 KB

Module 2 Extra 2: Containerlab Multi-Node Topology (SRL)

Concept:

Building more complex network topologies with multiple SR Linux nodes and interconnections using Containerlab.

Challenge:

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.

Code Example (Containerlab Topology):

# 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:

  1. Save the YAML as srl_2_nodes.clab.yaml.
  2. Deploy the lab: sudo containerlab deploy -t srl_2_nodes.clab.yaml --reconfigure.
  3. Verify connectivity from srl1: docker exec -it clab-srl-2-nodes-srl1 sr_cli "ping 10.0.0.2".
  4. Destroy the lab when done: sudo containerlab destroy -t srl_2_nodes.clab.yaml --cleanup.