Skip to content
Snippets Groups Projects
Commit 8b3738cf authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Hackfest:

- Added ContainerLab exercise
parent 726c44d9
No related branches found
No related tags found
3 merge requests!142Release TeraFlowSDN 2.1,!132NetSoft Hackfest extensions, gNMI Driver, gNMI L3NM Service Handler, multiple fixes,!113Draft: NetSoft Hackfest extensions
# Avoid including these folders when building the components
coverage/
data/
deploy/
manifests/
hackfest/
scripts/
clab-tfs-scenario
.tfs-scenario.clab.yml.bak
############
# ContainerLab
############
Refs:
https://documentation.nokia.com/srlinux/22-6/SR_Linux_Book_Files/SysMgmt_Guide/data-models.html#openconfig-ov
https://documentation.nokia.com/srlinux/SR_Linux_HTML_R21-11/SysMgmt_Guide/gnmi-interface.html#ai9ersv4qe
https://github.com/openconfig/kne/blob/v0.1.9/examples/nokia/srlinux-services/srl-openconfig.cfg.json
https://containerlab.dev/manual/kinds/srl/#default-node-configuration
https://learn.srlinux.dev/tutorials/infrastructure/kne/srl-with-oc-services/
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md
https://gnmic.kmrd.dev/cmd/get/
IMPORTANT: for Nokia SR Linux, use kind "srl" and type "ixr6"
## Download and install the latest release
$ sudo bash -c "$(curl -sL https://get.containerlab.dev)"
## Deploy proposed two SR node scenario
$ cd ~/tfs-ctrl/hackfest/containerlab
$ sudo containerlab deploy --topo tfs-scenario.clab.yml
## Access SR Bash
$ docker exec -it clab-tfs-scenario-srl1 bash
## Acess SR CLI
$ docker exec -it clab-tfs-scenario-srl1 sr_cli
## Destroy scenario
$ sudo containerlab destroy --topo tfs-scenario.clab.yml
## Install gNMIc
$ sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)"
## gNMI Capabilities request
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities
## gNMI Get request
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interface[name=mgmt0]
## gNMI Set request
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/name/host-name --update-value slr11
(we check the changed value)
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name
## Subscribe request
$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics
(In another terminal, you can generate traffic)
$ssh admin@clab-srlinux-srl1
## Enable OpenConfig data models and set as default:
$ docker exec -it clab-tfs-scenario-srl1 sr_cli
# enter candidate
# system management openconfig admin-state enable
# system gnmi-server network-instance mgmt yang-models openconfig
# commit stay
# quit
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Example based on clos01 example (http://containerlab.dev/lab-examples/min-clos/)
# TFS 2 Nokia SR Linux nodes + 2 Linux clients
name: tfs-scenario
mgmt:
network: mgmt-net
ipv4-subnet: 172.100.100.0/24
topology:
kinds:
srl:
image: ghcr.io/nokia/srlinux
linux:
image: ghcr.io/hellt/network-multitool
nodes:
srl1:
kind: srl
type: ixr6
cpu: 0.5
memory: 500MB
mgmt-ipv4: 172.100.100.101
#startup-config: srl1.cli
srl2:
kind: srl
type: ixr6
cpu: 0.5
memory: 500MB
mgmt-ipv4: 172.100.100.102
#startup-config: srl2.cli
client1:
kind: linux
cpu: 0.1
memory: 100MB
mgmt-ipv4: 172.100.100.201
client2:
kind: linux
cpu: 0.1
memory: 100MB
mgmt-ipv4: 172.100.100.202
links:
- endpoints: ["srl1:e1-1", "srl2:e1-1"]
- endpoints: ["client1:eth1", "srl1:e1-2"]
- endpoints: ["client2:eth1", "srl2:e1-2"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment