In this lab, we will set up a simple topology with containerlab. We will create gnmi-target-switch0 and gnmi-target-switch1 (servers with a gNMI-target, handled as switches) that we manage with the goSDN controller. Afterwards, we change the name of gnmi-target-switch0 to switch0.
Please note: You need to have the lab-vm or all the software in Prerequisites installed to run this lab.
The figure below shows what we want to set up using the goSDN-Controller, goSDN-CLI and gNMI:
Run the containerlab
Go to the directory of gosdn and use following command:
make containerlab-slim-start
Open a new terminal and start the CLI to talk to the controller (Do not close the previous terminal)
Build command prompt
make build
cd artifacts
./gosdnc prompt
Login into the controller with the credentials
login --controller 172.100.0.5:55055 --u admin --p <password>
To get the password go to the previous terminal and use the following commands
docker logs clab-gosdn_csbi_arista_base-gosdn
In the end of the script a 16 character alphanumeric password is generated like this: “Generated admin password: uyslboh15gjp9dne” (not the actual password, just an example)
Set-up the PND ID
pnd use (Choose ID from the displayed menu)
Set-up the switches
Switch0:
mne create --address 172.100.0.11:7030 --name switch0 --username admin --password admin --tls --plugin-id d1c269a2-6482-4010-b0d8-679dff73153b
Switch1:
mne create --address 172.100.0.12:7030 --name switch1 --username admin --password admin --tls --plugin-id d1c269a2-6482-4010-b0d8-679dff73153b
Check if the switches were created
mne list
In here, the UUID is also visible which we need for the next step:
Please note that the UUID may vary.
Set another hostname for Switch0
First, we want to see the current hostname:
mne path get <UUID> system/config/hostname
Now, we want to change the hostname gnmi-target-switch0 to switch0:
mne path set <UUID> system/config/hostname switch0
After changing the hostname, we have to commit our change. The change-id may vary too, so you can use the auto-completion tool of the cli or get all changes with following command:
change list
After getting the change-id, we will execute following command:
change commit <change-id>
Now we have to confirm the commit:
change confirm <change-id>
If we execute the get-command again, we can confirm that the change took place:
mne path get <UUID> system/config/hostname
Shut down the containerlab
Go to the directory of gosdn and use following command:
make containerlab-slim-stop