From 48c8e9afad686267fd434145be4973b1470eacab Mon Sep 17 00:00:00 2001 From: ubaumann Date: Thu, 10 Aug 2023 14:32:58 +0200 Subject: [PATCH 1/3] Update lab-example clos02 --- lab-examples/clos02/README.md | 3 +++ lab-examples/clos02/configs/leaf1.yaml | 11 +++++++++++ lab-examples/clos02/configs/leaf2.yaml | 11 +++++++++++ lab-examples/clos02/configs/leaf3.yaml | 11 +++++++++++ lab-examples/clos02/configs/leaf4.yaml | 11 +++++++++++ lab-examples/clos02/configs/spine1.yaml | 11 +++++++++++ lab-examples/clos02/configs/spine2.yaml | 11 +++++++++++ lab-examples/clos02/configs/spine3.yaml | 11 +++++++++++ lab-examples/clos02/configs/spine4.yaml | 11 +++++++++++ lab-examples/clos02/configs/superspine1.yaml | 9 +++++++++ lab-examples/clos02/configs/superspine2.yaml | 9 +++++++++ lab-examples/clos02/setup.sh | 6 +++++- 12 files changed, 114 insertions(+), 1 deletion(-) diff --git a/lab-examples/clos02/README.md b/lab-examples/clos02/README.md index 5bce3ad94..4c7aa845f 100644 --- a/lab-examples/clos02/README.md +++ b/lab-examples/clos02/README.md @@ -11,6 +11,9 @@ $ chmod +x setup.sh $ ./setup.sh ``` +!!!note + The setup script needs [gnmic](https://gnmic.openconfig.net/) + ### Setup Configures 1. NEs with Management, System and Ethernet IP Addresses. 2. Clients with eth0 (Management) and eth1 interface. diff --git a/lab-examples/clos02/configs/leaf1.yaml b/lab-examples/clos02/configs/leaf1.yaml index 4329271f3..713523989 100644 --- a/lab-examples/clos02/configs/leaf1.yaml +++ b/lab-examples/clos02/configs/leaf1.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.0/31 ipv6: + admin-state: enable address: - ip-prefix: '1000:10::/127' - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.2/31 ipv6: + admin-state: enable address: - ip-prefix: '1000:10::2/127' - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.24/31 ipv6: + admin-state: enable address: - ip-prefix: '1000:10::24/127' - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65001 router-id: 30.0.0.1 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/leaf2.yaml b/lab-examples/clos02/configs/leaf2.yaml index d38eb18db..f5be2cac1 100644 --- a/lab-examples/clos02/configs/leaf2.yaml +++ b/lab-examples/clos02/configs/leaf2.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.4/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::4/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.6/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::6/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.26/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::26/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65002 router-id: 30.0.0.2 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/leaf3.yaml b/lab-examples/clos02/configs/leaf3.yaml index 1a08aad11..d8a167875 100644 --- a/lab-examples/clos02/configs/leaf3.yaml +++ b/lab-examples/clos02/configs/leaf3.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.12/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::12/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.14/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::14/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.28/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::28/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65003 router-id: 30.0.0.3 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/leaf4.yaml b/lab-examples/clos02/configs/leaf4.yaml index dde39ccf7..814496491 100644 --- a/lab-examples/clos02/configs/leaf4.yaml +++ b/lab-examples/clos02/configs/leaf4.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.16/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::16/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.18/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::18/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.30/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::30/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65004 router-id: 30.0.0.4 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/spine1.yaml b/lab-examples/clos02/configs/spine1.yaml index eebed04b9..99e22591e 100644 --- a/lab-examples/clos02/configs/spine1.yaml +++ b/lab-examples/clos02/configs/spine1.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.1/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::1/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.5/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::5/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.8/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::8/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65056 router-id: 30.0.0.5 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/spine2.yaml b/lab-examples/clos02/configs/spine2.yaml index 68a7c72bb..d05fe5b98 100644 --- a/lab-examples/clos02/configs/spine2.yaml +++ b/lab-examples/clos02/configs/spine2.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.3/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::3/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.7/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::7/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.10/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::10/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65056 router-id: 30.0.0.6 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/spine3.yaml b/lab-examples/clos02/configs/spine3.yaml index 4672c72b1..e8b5e8185 100644 --- a/lab-examples/clos02/configs/spine3.yaml +++ b/lab-examples/clos02/configs/spine3.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.13/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::13/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.17/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::17/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.20/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::20/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65078 router-id: 30.0.0.7 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/spine4.yaml b/lab-examples/clos02/configs/spine4.yaml index 339f01588..5faee9530 100644 --- a/lab-examples/clos02/configs/spine4.yaml +++ b/lab-examples/clos02/configs/spine4.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.15/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::15/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.19/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::19/127 - name: ethernet-1/3 @@ -24,9 +28,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.22/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::22/127 - name: system0 @@ -52,6 +58,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65078 router-id: 30.0.0.8 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/superspine1.yaml b/lab-examples/clos02/configs/superspine1.yaml index 5fec694c7..482365df2 100644 --- a/lab-examples/clos02/configs/superspine1.yaml +++ b/lab-examples/clos02/configs/superspine1.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.9/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::9/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.21/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::21/127 - name: system0 @@ -41,6 +45,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65910 router-id: 30.0.0.9 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/configs/superspine2.yaml b/lab-examples/clos02/configs/superspine2.yaml index 3f10202e0..94a7f68cb 100644 --- a/lab-examples/clos02/configs/superspine2.yaml +++ b/lab-examples/clos02/configs/superspine2.yaml @@ -4,9 +4,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.11/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::11/127 - name: ethernet-1/2 @@ -14,9 +16,11 @@ srl_nokia-interfaces:interface: subinterface: - index: 0 ipv4: + admin-state: enable address: - ip-prefix: 10.0.0.23/31 ipv6: + admin-state: enable address: - ip-prefix: 1000:10::23/127 - name: system0 @@ -41,6 +45,11 @@ srl_nokia-network-instance:network-instance: srl_nokia-bgp:bgp: autonomous-system: 65910 router-id: 30.0.0.10 + afi-safi: + - afi-safi-name: ipv4-unicast + admin-state: enable + - afi-safi-name: ipv6-unicast + admin-state: enable group: - group-name: clos02 admin-state: enable diff --git a/lab-examples/clos02/setup.sh b/lab-examples/clos02/setup.sh index aa93fac7c..062376a25 100644 --- a/lab-examples/clos02/setup.sh +++ b/lab-examples/clos02/setup.sh @@ -3,7 +3,7 @@ CFG_DIR=./configs configure_SRL() { - OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p admin -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) + OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p $PASSWORD -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) echo $OUT | grep -q -e '\"operation\": \"UPDATE\"' if [ $? -eq 0 ]; then docker exec clab-clos02-$1 sr_cli "save startup" > /dev/null @@ -23,6 +23,10 @@ PIDS="" NE=("leaf1" "leaf2" "leaf3" "leaf4" "spine1" "spine2" "spine3" "spine4" "superspine1" "superspine2") CLIENT=("client1" "client2" "client3" "client4") +echo Enter SR Linux password: +read -s PASSWORD +echo + for VARIANT in ${NE[@]}; do ( configure_SRL $VARIANT ) & REF=$! From ef0085546397e7e8932fb3353a7b4fb4b8efdac7 Mon Sep 17 00:00:00 2001 From: ubaumann Date: Thu, 10 Aug 2023 14:55:40 +0200 Subject: [PATCH 2/3] Pin SRL in clos02 --- lab-examples/clos02/setup.clos02.clab.yml | 2 +- lab-examples/clos02/setup.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lab-examples/clos02/setup.clos02.clab.yml b/lab-examples/clos02/setup.clos02.clab.yml index 1329b0004..f974382c9 100644 --- a/lab-examples/clos02/setup.clos02.clab.yml +++ b/lab-examples/clos02/setup.clos02.clab.yml @@ -8,7 +8,7 @@ mgmt: topology: kinds: srl: - image: ghcr.io/nokia/srlinux + image: ghcr.io/nokia/srlinux:23.3.3 linux: image: ghcr.io/hellt/network-multitool nodes: diff --git a/lab-examples/clos02/setup.sh b/lab-examples/clos02/setup.sh index 062376a25..44612ba32 100644 --- a/lab-examples/clos02/setup.sh +++ b/lab-examples/clos02/setup.sh @@ -3,7 +3,7 @@ CFG_DIR=./configs configure_SRL() { - OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p $PASSWORD -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) + OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p NokiaSrl1! -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) echo $OUT | grep -q -e '\"operation\": \"UPDATE\"' if [ $? -eq 0 ]; then docker exec clab-clos02-$1 sr_cli "save startup" > /dev/null @@ -23,10 +23,6 @@ PIDS="" NE=("leaf1" "leaf2" "leaf3" "leaf4" "spine1" "spine2" "spine3" "spine4" "superspine1" "superspine2") CLIENT=("client1" "client2" "client3" "client4") -echo Enter SR Linux password: -read -s PASSWORD -echo - for VARIANT in ${NE[@]}; do ( configure_SRL $VARIANT ) & REF=$! From 6a40b2abdd04330f4c1daddc4912aa1b1c50a61d Mon Sep 17 00:00:00 2001 From: ubaumann Date: Thu, 10 Aug 2023 15:02:06 +0200 Subject: [PATCH 3/3] Lab clos02: Move password to variable --- lab-examples/clos02/setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lab-examples/clos02/setup.sh b/lab-examples/clos02/setup.sh index 44612ba32..6f88cf559 100644 --- a/lab-examples/clos02/setup.sh +++ b/lab-examples/clos02/setup.sh @@ -1,9 +1,10 @@ #!/bin/bash CFG_DIR=./configs +SRL_PASSWORD=NokiaSrl1! configure_SRL() { - OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p NokiaSrl1! -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) + OUT=$(gnmic -a clab-clos02-$1 --timeout 30s -u admin -p $SRL_PASSWORD -e json_ietf --skip-verify set --update-path / --update-file $CFG_DIR/$1.yaml 2>&1) echo $OUT | grep -q -e '\"operation\": \"UPDATE\"' if [ $? -eq 0 ]; then docker exec clab-clos02-$1 sr_cli "save startup" > /dev/null