Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
############
# 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