### Run Containerlab Quick Setup Script Source: https://containerlab.dev/windows This command downloads and executes the Containerlab setup script, installing both Docker and Containerlab on your WSL system. ```bash curl -sL https://containerlab.dev/setup | sudo -E bash -s "all" ``` -------------------------------- ### Setup Bash Prompt with Setup Script Source: https://containerlab.dev/install Installs a custom bash prompt for a better user experience. ```bash curl -sL https://containerlab.dev/setup | sudo -E bash -s "setup-bash-prompt" ``` -------------------------------- ### Copy Lab Catalog Example Source: https://containerlab.dev/lab-examples/lab-examples Use this command to copy lab example directories from the default installation path to your working directory. This ensures local modifications are not overwritten during upgrades. ```bash # copy over the srl02 lab files cp -a /etc/containerlab/lab-examples/* . ``` -------------------------------- ### Install Docker Only with Setup Script Source: https://containerlab.dev/install Installs only the Docker component using the Containerlab setup script. ```bash curl -sL https://containerlab.dev/setup | sudo -E bash -s "install-docker" ``` -------------------------------- ### Install Containerlab with Wget Source: https://containerlab.dev/install Installs Containerlab using wget to download and execute the installation script. ```bash bash -c "$(wget -qO - https://get.containerlab.dev)" ``` -------------------------------- ### Install Containerlab WSL Distribution Source: https://containerlab.dev/windows Install the Containerlab WSL distribution by double-clicking the downloaded .wsl file or using the `wsl --install --from-file` command with the path to the file. ```powershell wsl --install --from-file C:\path\to\clab.wsl ``` -------------------------------- ### Quick Setup Script for Containerlab Source: https://containerlab.dev/install Installs Docker, Containerlab, and gh CLI. Configure sshd for increased max auth tries. Can be turned off by setting SETUP_SSHD to false. ```bash curl -sL https://containerlab.dev/setup | sudo -E bash -s "all" ``` ```bash export SETUP_SSHD="false" ``` -------------------------------- ### Example Cloud-Init Configuration for vManage Source: https://containerlab.dev/manual/kinds/cisco_sdwan An example cloud-init file that sets the system personality and writes zCloud XML content to a specific path for vManage initialization. ```yaml #cloud-config write_files: - path: /etc/default/personality content: "vmanage\n" - path: /etc/confd/init/zcloud.xml content: | ``` -------------------------------- ### Display New Bash Prompt Source: https://containerlab.dev/install Example of the new two-line prompt after running the setup-bash-prompt script. ```bash [*]─[clab]─[~] └──> ``` -------------------------------- ### MD-CLI Partial Configuration Example Source: https://containerlab.dev/manual/kinds/sros Example of a partial configuration file in MD-CLI syntax to add a static route. This syntax is appended to the existing startup configuration. ```clish configure { router "Base" { static-routes { route 192.168.200.200/32 route-type unicast { next-hop "192.168.0.1" { admin-state enable } } } } } ``` -------------------------------- ### Example DOCKER-USER chain rules Source: https://containerlab.dev/manual/network An example output of the DOCKER-USER chain, illustrating ACCEPT rules for Containerlab's management network. ```text Chain DOCKER-USER (1 references) pkts bytes target prot opt in out source destination 0 0 ACCEPT 0 -- br-1351328e1855 * 0.0.0.0/0 0.0.0.0/0 /* set by containerlab */ 0 0 ACCEPT 0 -- * br-1351328e1855 0.0.0.0/0 0.0.0.0/0 /* set by containerlab */ 0 0 RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0 ``` -------------------------------- ### Install Containerlab Source: https://containerlab.dev/quickstart Installs Containerlab on RHEL or Debian-based systems using a setup script. Ensure you have curl installed. ```bash curl -sL https://containerlab.dev/setup | sudo -E bash -s "all" ``` -------------------------------- ### SR OS Interface Naming Examples Source: https://containerlab.dev/manual/kinds/sros Examples illustrating the mapping between SR OS interface names and their corresponding card, MDA, and port components. ```text 1/2/3 -> card 1, mda 2, port 3 1/2/c3/1 -> card 1, mda 2, connector 3, port 1 2/2/c3/4 -> card 2, mda 2, connector 3, port 4 1/x2/3/4 -> card 1, xiom 2, mda 3, port 4 1/x2/3/c4/5 -> card 1, xiom 2, mda 3, connector 4, port 5 ``` -------------------------------- ### Example zCloud XML Configuration for vManage Source: https://containerlab.dev/manual/kinds/cisco_sdwan An example of a zCloud XML file used for vManage startup configuration, defining system parameters, host-name, and user credentials. ```xml vmanage vmanage my-vmanage admin MyPassword netadmin 512 eth0 true ``` -------------------------------- ### Minimal BNG Topology Example Source: https://containerlab.dev/manual/kinds/veesix_osvbng This Containerlab topology defines a minimal BNG setup with a Veesix OSVBNG node, a BNG Blaster for subscriber simulation, and an FRR core router. It includes specific image versions and bind mounts for configuration files. ```yaml name: osvbng01 topology: nodes: bng1: kind: veesix_osvbng image: veesixnetworks/osvbng:v0.3.1 startup-config: bng1/osvbng.yaml corerouter1: kind: linux image: frrouting/frr:v8.4.1 binds: - corerouter1/daemons:/etc/frr/daemons - corerouter1/frr.conf:/etc/frr/frr.conf subscribers: kind: linux image: veesixnetworks/bngblaster:0.9.30 binds: - subscribers/config.json:/config/config.json links: - endpoints: ["subscribers:eth1", "bng1:eth1"] - endpoints: ["bng1:eth2", "corerouter1:eth1"] ``` -------------------------------- ### Install WSL with Debian Source: https://containerlab.dev/windows If WSL is not installed or you wish to use Debian, run this command. It installs WSL and the Debian distribution. ```bash wsl --install -d Debian ``` -------------------------------- ### SSH Connection Example to SRL Node Source: https://containerlab.dev/manual/inventory Example of initiating an SSH connection to a Containerlab SRL node after configuring the SSH client. ```bash ❯ ssh clab-srl-srl ``` -------------------------------- ### Start Single Node by Topology File Source: https://containerlab.dev/cmd/start Use this command to start a specific node defined in a topology file. Ensure the topology file path and node name are correct. ```bash containerlab start -t mylab.clab.yml --node r1 ``` -------------------------------- ### Start All Nodes by Topology File Source: https://containerlab.dev/cmd/start This command starts all nodes defined in the specified topology file. It's useful for bringing up an entire lab when all nodes need to be restarted. ```bash containerlab start -t mylab.clab.yml ``` -------------------------------- ### Install and Enable KSM on Debian/Ubuntu Source: https://containerlab.dev/manual/vrnetlab Installs the ksmtuned package, checks the service status, restarts it, and enables KSM. Use this to apply memory deduplication. ```bash sudo apt-get update -y sudo apt-get install -y ksmtuned sudo systemctl status ksm.service sudo systemctl restart ksm.service sudo echo 1 > /sys/kernel/mm/ksm/run grep . /sys/kernel/mm/ksm/* ``` -------------------------------- ### SR Linux Default Configuration Example Source: https://containerlab.dev/manual/kinds/srl This example shows a topology file where a Nokia SR Linux node is defined without a custom startup-config. Containerlab will apply its default configuration to this node. ```yaml # example of a topo file that does not define a custom startup-config # as a result, the default configuration will be used by this node name: srl_lab topology: nodes: srl1: kind: nokia_srlinux type: ixr-d3 ``` -------------------------------- ### Start API Server with Default Settings Source: https://containerlab.dev/cmd/tools/api-server/start Use this command to start the API server with default configurations. It automatically generates a JWT secret and uses default ports and directories. ```bash ❯ containerlab tools api-server start 10:28:35 INFO Generated random JWT secret for API server 10:28:35 INFO Pulling image ghcr.io/srl-labs/clab-api-server/clab-api-server:latest... 10:28:35 INFO Creating API server container clab-api-server 10:28:35 INFO Creating container name=clab-api-server 10:28:36 INFO API server container clab-api-server started successfully. 10:28:36 INFO API Server available at: http://localhost:8080 ``` -------------------------------- ### Example Containerlab Topology File Source: https://containerlab.dev/manual/clabernetes/quickstart An example of a 'topo.clab.yaml' file used by Containerlab, defining nodes, images, and network links. ```yaml name: clabernetes-client1 prefix: "" topology: defaults: ports: - 60000:21/tcp - 60001:22/tcp - 60002:23/tcp - 60003:80/tcp - 60000:161/udp - 60004:443/tcp - 60005:830/tcp - 60006:5000/tcp - 60007:5900/tcp - 60008:6030/tcp - 60009:9339/tcp - 60010:9340/tcp - 60011:9559/tcp - 60012:57400/tcp nodes: client1: kind: linux image: ghcr.io/srl-labs/alpine exec: - ash -c '/config.sh 1' binds: - configs/client.sh:/config.sh ports: [] links: - endpoints: - client1:eth1 - host:client1-eth1 debug: false ``` -------------------------------- ### Example Output of Version Check Source: https://containerlab.dev/cmd/version/check This is an example of the output you might see when a newer Containerlab version is available. It provides details on the new version and instructions for upgrading. ```text 🎉 A newer containerlab version (0.62.2) is available! Release notes: https://containerlab.dev/rn/0.62/#0622 Run 'sudo clab version upgrade' or see https://containerlab.dev/install/ for installation options. ``` -------------------------------- ### Manual Containerlab Installation from Archive Source: https://containerlab.dev/install Installs Containerlab manually by downloading a tar.gz archive. This method is for Linux distributions that do not support deb/rpm packages. It extracts the binary to /etc/containerlab and optionally moves it to /usr/bin. ```bash # get the latest available tag LATEST=$(curl -sLo /dev/null -w '%{url_effective}' \ https://github.com/srl-labs/containerlab/releases/latest | sed 's|.*/v||') # download tar.gz archive curl -L -o /tmp/clab.tar.gz "https://github.com/srl-labs/containerlab/releases/download/v${LATEST}/containerlab_${LATEST}_Linux_amd64.tar.gz" # create containerlab directory mkdir -p /etc/containerlab # extract downloaded archive into the containerlab directory tar -zxvf /tmp/clab.tar.gz -C /etc/containerlab # (optional) move containerlab binary somewhere in the $PATH mv /etc/containerlab/containerlab /usr/bin && chmod a+x /usr/bin/containerlab ``` -------------------------------- ### Start Containerlab API Server Source: https://containerlab.dev/cmd/tools/api-server/start This command starts the Containerlab API server in a container. It allows for programmatic management of Containerlab operations. Various flags can be used to configure the server's behavior, such as port, host, image, and security settings. ```bash containerlab tools api-server start [flags] ``` -------------------------------- ### Start API Server with Custom Port and Labs Directory Source: https://containerlab.dev/cmd/tools/api-server/start Start the API server on a custom port and specify a custom directory for labs. This is useful for running multiple instances or organizing lab files. ```bash ❯ containerlab tools api-server start -p 9090 -l /home/user/containerlab/labs 11:40:03 INFO Pulling image ghcr.io/srl-labs/clab-api-server/clab-api-server:latest... 11:40:03 INFO Generated random JWT secret for API server 11:40:03 INFO Creating API server container clab-api-server 11:40:03 INFO API server container clab-api-server started successfully. 11:40:03 INFO API Server available at: http://localhost:9090 ``` -------------------------------- ### Install curl on WSL Source: https://containerlab.dev/windows Before running the Containerlab setup script, ensure curl is installed on your WSL distribution by running this command. ```bash sudo apt update && sudo apt -y install curl ``` -------------------------------- ### Define Kind-Level and Node-Specific Startup Configurations Source: https://containerlab.dev/manual/kinds/ceos Demonstrates setting a default startup configuration at the kind level and overriding it with a node-specific configuration. ```yaml name: ceos topology: kinds: arista_ceos: startup-config: ceos-custom-startup.cfg nodes: ceos1: kind: arista_ceos image: ceos:4.32.0F ceos2: kind: arista_ceos image: ceos:4.32.0F startup-config: node-specific-startup.cfg links: - endpoints: ["ceos1:eth1", "ceos2:eth1"] ``` -------------------------------- ### SR Linux CLI Configuration Example Source: https://containerlab.dev/manual/kinds/srl This is a sample CLI configuration that can be saved to a file and used as a startup configuration for SR Linux nodes. ```clicfg network-instance default { interface ethernet-1/1.0 { } interface ethernet-1/2.0 { } protocols { bgp { admin-state enable autonomous-system 65001 router-id 10.0.0.1 group rs { peer-as 65003 ipv4-unicast { admin-state enable } } neighbor 192.168.13.2 { peer-group rs } } } } ``` -------------------------------- ### Install Clabernetes with Helm (Self-hosted) Source: https://containerlab.dev/manual/clabernetes/quickstart Alias 'helm' to use the 'alpine/helm' container image for installing Clabernetes. This setup mounts necessary directories and configurations for Helm operations within the container. ```bash alias helm='docker run --network host -ti --rm -v $(pwd):/apps -w /apps \ -v ~/.kube:/root/.kube -v ~/.helm:/root/.helm \ -v ~/.config/helm:/root/.config/helm \ -v ~/.cache/helm:/root/.cache/helm \ alpine/helm:3.12.3' ``` -------------------------------- ### Full Startup Configuration for Nokia SR OS Source: https://containerlab.dev/manual/kinds/vr-sros Use a full startup-config to replace the default configuration entirely. Ensure the provided file contains all necessary configurations for the node. ```yaml name: sros_lab topology: nodes: sros: kind: nokia_sros startup-config: myconfig.txt ``` -------------------------------- ### Basic Node Configuration Example Source: https://containerlab.dev/manual/nodes Defines a Nokia SR Linux node with specific image, startup configuration, binds, ports, user, environment variables, and command. ```yaml # part of topology definition file topology: nodes: node1: # node name kind: nokia_srlinux type: ixr-d2l image: ghcr.io/nokia/srlinux startup-config: /root/mylab/node1.cfg binds: - /usr/local/bin/gobgp:/root/gobgp - /root/files:/root/files:ro ports: - 80:8080 - 55555:43555/udp - 55554:43554/tcp user: test env: ENV1: VAL1 cmd: /bin/bash script.sh ``` -------------------------------- ### Verify Connectivity with Ping Source: https://containerlab.dev/lab-examples/cvx02 After starting the lab, nodes should be able to ping each other. This example shows a successful ping from the Cumulus Linux switch to the host. ```bash $ clab-cvx02-sw1 Warning: Permanently added 'clab-cvx02-sw1,3fff:172:20:20::3' (ECDSA) to the list of known hosts. root@clab-cvx02-sw1's password: Linux sw1 5.10.16.3-networkop+ #17 SMP Mon May 24 15:22:51 BST 2021 x86_64 root@sw1:mgmt:~# ping 12.12.12.2 vrf-wrapper.sh: switching to vrf "default"; use '--no-vrf-switch' to disable PING 12.12.12.2 (12.12.12.2) 56(84) bytes of data. 64 bytes from 12.12.12.2: icmp_seq=1 ttl=64 time=0.297 ms ^C --- 12.12.12.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.297/0.297/0.297/0.000 ms root@sw1:mgmt:~# ``` -------------------------------- ### Ping between Cumulus Linux and FRR nodes Source: https://containerlab.dev/lab-examples/cvx01 After starting the lab, nodes can ping each other. This example shows a successful ping from the Cumulus Linux node to the FRR node. ```bash ssh lab-cvx01-sw1 Warning: Permanently added 'clab-cvx01-sw1,192.168.223.2' (ECDSA) to the list of known hosts. root@clab-cvx01-sw1's password: Linux 1c3f259f31872500 4.19.0-cl-1-amd64 #1 SMP Cumulus 4.19.149-1+cl4.3u1 (2021-01-28) x86_64 root@1c3f259f31872500:mgmt:~# ping 12.12.12.2 -c 1 vrf-wrapper.sh: switching to vrf "default"; use '--no-vrf-switch' to disable PING 12.12.12.2 (12.12.12.2) 56(84) bytes of data. 64 bytes from 12.12.12.2: icmp_seq=1 ttl=64 time=0.400 ms --- 12.12.12.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.400/0.400/0.400/0.000 ms ``` -------------------------------- ### Full Startup Configuration for Nokia SR OS Source: https://containerlab.dev/manual/kinds/sros Use this to provide a complete configuration file for a node. Containerlab copies the file and mounts it as the startup configuration. ```yaml name: sros topology: nodes: sros: kind: nokia_srsim startup-config: myconfig.txt ``` -------------------------------- ### Unregister Ubuntu and Install Debian Source: https://containerlab.dev/windows If you have an existing Ubuntu WSL installation and prefer Debian, use these commands to unregister Ubuntu and then install Debian. ```bash wsl --unregister Ubuntu wsl --install -d Debian ``` -------------------------------- ### Configure Cisco vIOS Startup Configuration Source: https://containerlab.dev/manual/kinds/cisco_vios Example of specifying a custom startup configuration file for a Cisco vIOS node. Containerlab will mount 'myconfig.txt' as the startup-config. ```yaml topology: nodes: node: kind: cisco_vios startup-config: myconfig.txt ``` -------------------------------- ### Install Containerlab with Yum Source: https://containerlab.dev/install Installs a specific release of Containerlab using the yum package manager. The package installs the 'containerlab' binary to /usr/bin and creates a 'clab' symlink. ```bash yum install https://github.com/srl-labs/containerlab/releases/download/v0.7.0/containerlab_0.7.0_linux_386.rpm ``` -------------------------------- ### Sample cJunosEvolved CLI Boot Output Source: https://containerlab.dev/manual/kinds/cjunosevolved A sample output showing the system boot status and eventual readiness for configuration on a cJunosEvolved node. ```bash # docker exec -ti clab-srlcjunosevo-cevo cli System is not yet ready... System is not yet ready... System is not yet ready... System is not yet ready... System is not yet ready... System is not yet ready... System is not yet ready... Waiting for editing of configuration to be ready. root@HOSTNAME> ``` -------------------------------- ### SR Linux 'set' Command Configuration Example Source: https://containerlab.dev/manual/kinds/srl An alternative CLI configuration format using 'set' commands, suitable for startup configurations. ```clicfg set / network-instance default protocols bgp admin-state enable set / network-instance default protocols bgp router-id 10.10.10.1 set / network-instance default protocols bgp autonomous-system 65001 set / network-instance default protocols bgp group ibgp ipv4-unicast admin-state enable set / network-instance default protocols bgp group ibgp export-policy export-lo set / network-instance default protocols bgp neighbor 192.168.1.2 admin-state enable set / network-instance default protocols bgp neighbor 192.168.1.2 peer-group ibgp set / network-instance default protocols bgp neighbor 192.168.1.2 peer-as 65001 ``` -------------------------------- ### Install wget for VS Code Server Source: https://containerlab.dev/windows When using VS Code with devcontainers on Windows, you may need to install wget in your WSL instance to support the VS Code server component installation. ```bash sudo apt -y install wget ``` -------------------------------- ### Example iptables version output Source: https://containerlab.dev/manual/network Example output indicating that iptables is using the nf_tables backend. ```text iptables v1.8.5 (nf_tables) ``` -------------------------------- ### Clone and Deploy a Simple VPP Lab Source: https://containerlab.dev/manual/kinds/fdio_vpp Quickly set up a basic lab with two VPP instances and two Alpine Linux clients. Clone the repository and deploy using containerlab. ```bash git clone https://git.ipng.ch/ipng/vpp-containerlab.git cd vpp-containerlab containerlab deploy ``` -------------------------------- ### Uninstall Containerlab with yum Source: https://containerlab.dev/install Removes Containerlab when it was installed via an installation script or packages on an RPM-based system. ```bash yum remove containerlab ``` -------------------------------- ### Uninstall Containerlab with apt Source: https://containerlab.dev/install Removes Containerlab when it was installed via an installation script or packages on a Debian-based system. ```bash apt remove containerlab ``` -------------------------------- ### Install Specific Containerlab Version Source: https://containerlab.dev/install Installs a specific version of Containerlab using the bash script and version flag. ```bash bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.10.3 ``` -------------------------------- ### Launch Containerlab WSL Source: https://containerlab.dev/windows Open the Containerlab WSL distribution either from the Start Menu or by executing `wsl -d Containerlab` in Command Prompt or PowerShell. ```powershell wsl -d Containerlab ``` -------------------------------- ### Containerlab Topology Breakout Interface Example Source: https://containerlab.dev/manual/kinds/srl Example of defining links for breakout (channelised) interfaces in a Containerlab topology file. ```yaml links: # srlinux's first breakout port ethernet-1/3/1 # is connected to sros port 2 - endpoints: ["srlinux:ethernet-1/3/1", "sros:1/1/2"] # srlinux's second breakout port ethernet-1/3/2 # is connected to vEOS port Et1/2 - endpoints: ["srlinux:ethernet-1/3/2", "veos:Et1/2"] ``` -------------------------------- ### Install Latest Containerlab Release Source: https://containerlab.dev/install Installs the latest Containerlab release using a bash script. May require sudo privileges. ```bash bash -c "$(curl -sL https://get.containerlab.dev)" ``` -------------------------------- ### Embed Startup Configuration Directly in Topology File Source: https://containerlab.dev/manual/config-mgmt Provide the startup configuration as a multiline string directly within the topology YAML file. ```yaml topology: nodes: srl: startup-config: | system information location "I am an embedded config" ``` -------------------------------- ### Define Juniper vQFX Node with Startup Configuration Source: https://containerlab.dev/manual/kinds/vr-vqfx Configure a Juniper vQFX node to boot with a custom startup configuration file. The 'startup-config' property specifies the path to the configuration file, which Containerlab will mount into the container. ```yaml topology: nodes: node: kind: juniper_vqfx startup-config: myconfig.txt ``` -------------------------------- ### VyOS Kind and Node Specific Startup Configurations Source: https://containerlab.dev/manual/kinds/vyosnetworks_vyos A Containerlab topology demonstrating how to set a default startup configuration for all VyOS nodes of a kind, and override it for specific nodes. ```yaml name: vyos_lab topology: kinds: vyosnetworks_vyos: startup-config: vyos-custom-startup.cfg nodes: # vyos1 will boot with vyos-custom-startup.cfg as set in the kind parameters vyos1: kind: vyosnetworks_vyos image: vyos:latest # vyos2 will boot with its own specific startup config, as it overrides the kind variables vyos2: kind: vyosnetworks_vyos image: vyos:latest startup-config: node-specific-startup.cfg links: - endpoints: ["vyos1:eth1", "vyos2:eth1"] ``` -------------------------------- ### Install WSL on Windows 11 Source: https://containerlab.dev/windows Use this command in Command Prompt or PowerShell to install WSL on Windows 11. A reboot is required afterward. ```powershell wsl --install ``` -------------------------------- ### Specify Local Startup Configuration File Source: https://containerlab.dev/manual/config-mgmt Provide a path to a local file containing the startup configuration for a node. ```yaml topology: nodes: srl: startup-config: ./some/path/to/startup-config.cfg ``` -------------------------------- ### Install Specific Clabernetes Version Source: https://containerlab.dev/manual/clabernetes/install Installs a specific version of the Clabernetes manager using Helm. Replace '0.0.25' with the desired version number. ```bash helm upgrade --version 0.0.25 --install \ clabernetes oci://ghcr.io/srl-labs/clabernetes/clabernetes ``` -------------------------------- ### Invoke Capture Script Example Source: https://containerlab.dev/manual/wireshark Example of how to invoke the pcap.sh script to capture traffic from the 'e1-1' interface of the 'srl' container on the 'clab-vm' host. ```bash pcap.sh clab-vm srl e1-1 ``` -------------------------------- ### Configure OSPF on SR Linux Source: https://containerlab.dev/lab-examples/srl-crpd Configure loopback and data interfaces, then enable OSPFv2 on SR Linux. Commit the configuration to apply changes. ```bash # enter candidate datastore enter candidate # configure loopback and data interfaces set / interface ethernet-1/1 admin-state enable set / interface ethernet-1/1 subinterface 0 admin-state enable set / interface ethernet-1/1 subinterface 0 ipv4 address 192.168.1.1/24 set / interface lo0 subinterface 0 admin-state enable set / interface lo0 subinterface 0 ipv4 address 10.10.10.1/32 # configure OSPF set / network-instance default router-id 10.10.10.1 set / network-instance default interface ethernet-1/1.0 set / network-instance default interface lo0.0 set / network-instance default protocols ospf instance main admin-state enable set / network-instance default protocols ospf instance main version ospf-v2 set / network-instance default protocols ospf instance main area 0.0.0.0 interface ethernet-1/1.0 interface-type point-to-point set / network-instance default protocols ospf instance main area 0.0.0.0 interface ethernet-1/1.0 # commit config commit now ``` -------------------------------- ### Topology Definition Example Source: https://containerlab.dev/manual/node-filtering This is an example topology file defining four nodes and their interconnections. It serves as a basis for demonstrating node filtering operations. ```yaml name: filter topology: defaults: image: alpine:3 nodes: node1: node2: node3: node4: links: - endpoints: ["node1:eth1", "node2:eth1"] - endpoints: ["node1:eth2", "node3:eth2"] - endpoints: ["node1:eth3", "node4:eth3"] - endpoints: ["node2:eth2", "node4:eth2"] - endpoints: ["node3:eth1", "node4:eth1"] ``` -------------------------------- ### Containerlab Topology Link Example Source: https://containerlab.dev/manual/kinds/srl Example of defining links in a Containerlab topology file connecting SR Linux interfaces to other network devices. ```yaml links: # srlinux port ethernet-1/3 is connected to vsrx port ge-0/0/3 - endpoints: ["srlinux:ethernet-1/3", "vsrx:ge-0/0/3"] # srlinux port ethernet-1/5 is connected to sros port 2 - endpoints: ["srlinux:ethernet-1/5", "sros:1/1/2"] ``` -------------------------------- ### Partial Startup Configuration for Nokia SR OS Source: https://containerlab.dev/manual/kinds/vr-sros Apply a partial configuration on top of the default Containerlab configuration. The filename must include `.partial`. ```yaml name: sros_lab topology: nodes: sros: kind: nokia_sros startup-config: myconfig.partial.txt ``` -------------------------------- ### Manually Install Latest Containerlab Release Source: https://containerlab.dev/install Manually installs the latest Containerlab release using package managers, first determining the latest version. ```bash # manually install latest release with package managers LATEST=$(curl -sLo /dev/null -w '%{url_effective}' https://github.com/srl-labs/containerlab/releases/latest | sed 's|.*/v||') # with yum yum install "https://github.com/srl-labs/containerlab/releases/download/v${LATEST}/containerlab_${LATEST}_linux_amd64.rpm" # with dpkg curl -sL -o /tmp/clab.deb "https://github.com/srl-labs/containerlab/releases/download/v${LATEST}/containerlab_${LATEST}_linux_amd64.deb" && dpkg -i /tmp/clab.deb ``` -------------------------------- ### Apply Startup Configuration Source: https://containerlab.dev/manual/kinds/vr-n9kv Configure a Cisco Nexus 9000v node to boot with a custom startup configuration file. The file is copied to the container and used as the startup-config. ```yaml topology: nodes: node: kind: cisco_n9kv startup-config: myconfig.txt ``` -------------------------------- ### Example Static Route Addition on Windows Source: https://containerlab.dev/manual/kinds/spirent_stc An example of adding a static route on Windows for a management subnet of 172.20.20.0/24 with a containerlab host IP of 192.168.1.200. ```bash route add 172.20.20.0 MASK 255.255.255.0 192.168.1.200 ``` -------------------------------- ### Partial Startup Configuration for Nokia SR OS Source: https://containerlab.dev/manual/kinds/sros Apply a partial configuration on top of the default. The filename must contain '.partial'. This is useful for adding specific configurations like interfaces or services. ```yaml name: sros_lab topology: nodes: sros: kind: nokia_srsim startup-config: myconfig.partial.txt ``` -------------------------------- ### Navigate to Lab Directory Source: https://containerlab.dev/lab-examples/ost-srl Change into the specific lab directory before deploying. ```bash cd containerlab/lab-examples/ost-srl ``` -------------------------------- ### Use Relative Paths for Startup Configurations Source: https://containerlab.dev/manual/config-mgmt Reference startup configuration files using relative paths within the lab directory structure. ```yaml name: mylab topology: nodes: node1: startup-config: cfgs/node1.partial.cfg node2: startup-config: cfgs/node2.partial.cfg ``` -------------------------------- ### Start All Nodes by Lab Name Source: https://containerlab.dev/cmd/start This command starts all nodes within a lab identified by its name. It's a convenient way to restart all components of a deployed lab. ```bash containerlab start --name mylab ``` -------------------------------- ### MD-CLI Syntax for Partial Configuration Source: https://containerlab.dev/manual/kinds/vr-sros Example of a partial configuration file using MD-CLI syntax to add a static route. Containerlab handles entering configuration mode and committing changes. ```text configure { router "Base" { static-routes { route 192.168.200.200/32 route-type unicast { next-hop "192.168.0.1" { admin-state enable } } } } } ``` -------------------------------- ### Configure FTOSv Startup Configuration Source: https://containerlab.dev/manual/kinds/vr-ftosv Specify a custom startup configuration file for Dell FTOSv nodes. The file 'myconfig.txt' will be mounted and used as the startup-config. ```yaml topology: nodes: node: kind: dell_ftosv startup-config: myconfig.txt ``` -------------------------------- ### Start Multiple Nodes by Lab Name Source: https://containerlab.dev/cmd/start This command starts multiple specified nodes within a lab identified by its name. The nodes can be listed as a comma-separated string. ```bash containerlab start --name mylab --node r1,r2 ``` -------------------------------- ### Configure vManage with Cloud-Init Startup Configuration Source: https://containerlab.dev/manual/kinds/cisco_sdwan Use a cloud-init file for 'startup-config' to configure the vManage node, including setting the personality and providing zCloud XML content. ```yaml topology: nodes: sdwan-manager: kind: cisco_sdwan type: manager startup-config: sdwan-manager-cloud-init.yaml ``` -------------------------------- ### Basic c8000 Lab Topology Example Source: https://containerlab.dev/manual/kinds/c8000 A basic ContainerLab topology defining two c8000 nodes and a link between them. This example specifies the image and pull policy for the nodes. ```yaml name: test topology: nodes: Cisco8201-1: kind: cisco_c8000 image: 8201-32fh-clab:7.9.1 image-pull-policy: Never Cisco8201-2: kind: cisco_c8000 image: 8201-32fh-clab:7.9.1 image-pull-policy: Never links: - endpoints: ["Cisco8201-1:FH0_0_0_0", "Cisco8201-2:FH0_0_0_0"] ``` -------------------------------- ### Verifying Templated Interface Descriptions Source: https://containerlab.dev/manual/config-mgmt This command verifies that the interface descriptions have been correctly set by the startup configuration template. ```bash docker exec clab-srl-srl1 sr_cli info interface ethernet-1/\{2,4\} description ``` -------------------------------- ### Define ASAv Startup Configuration Source: https://containerlab.dev/manual/kinds/cisco_asav Configure an ASAv node to boot with a custom startup configuration file. The file is mounted into the container at `/config/startup-config.cfg`. ```yaml topology: nodes: asav: kind: cisco_asav startup-config: myconfig.txt ```