|
|
In this lab, we will set up a simple topology with [containerlab](https://containerlab.dev/). We will create and modify gnmi-target-switch0 (server with a gNMI-target, handled as switch) that we manage with the goSDN controller.
|
|
|
|
|
|
**Please note: You need to have the lab-vm or all the software in [Prerequisites](Labs/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 command to build the docker image for the gNMI target
|
|
|
|
|
|
First, go to your local gnmi-target repository:
|
|
|
|
|
|
```bash
|
|
|
cd gnmi-target
|
|
|
```
|
|
|
Next, build the image:
|
|
|
|
|
|
```bash
|
|
|
git checkout develop
|
|
|
make container
|
|
|
```
|
|
|
|
|
|
## Run the containerlab
|
|
|
|
|
|
Go to the directory of gosdn and use following command:
|
|
|
```bash
|
|
|
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
|
|
|
|
|
|
```bash
|
|
|
make build
|
|
|
cd artifacts
|
|
|
./gosdnc prompt
|
|
|
```
|
|
|
|
|
|

|
|
|
|
|
|
## Login into the controller with the credentials
|
|
|
|
|
|
```bash
|
|
|
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
|
|
|
|
|
|
```bash
|
|
|
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
|
|
|
|
|
|
```bash
|
|
|
pnd use (Choose ID from the displayed menu)
|
|
|
```
|
|
|
|
|
|

|
|
|

|
|
|
|
|
|
## Set-up the switches
|
|
|
Switch0:
|
|
|
```bash
|
|
|
mne create --address 172.100.0.11:7030 --name switch0 --username admin --password admin --tls --plugin-id d1c269a2-6482-4010-b0d8-679dff73153b
|
|
|
```
|
|
|
Switch1:
|
|
|
```bash
|
|
|
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
|
|
|
|
|
|
```bash
|
|
|
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:
|
|
|
```bash
|
|
|
mne path get <UUID> system/config/hostname
|
|
|
```
|
|
|
We get following output:<br>
|
|
|

|
|
|
|
|
|
Now, we want to change the hostname gnmi-target-switch0 to switch0:
|
|
|
```bash
|
|
|
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:
|
|
|
```bash
|
|
|
change list
|
|
|
```
|
|
|
After getting the change-id, we will execute following command:
|
|
|
```bash
|
|
|
change commit <change-id>
|
|
|
```
|
|
|
Now we have to confirm the commit:
|
|
|
```bash
|
|
|
change confirm <change-id>
|
|
|
```
|
|
|

|
|
|
|
|
|
If we execute the get-command again, we can confirm that the change took place:
|
|
|
```bash
|
|
|
mne path get <UUID> system/config/hostname
|
|
|
```
|
|
|
 |
|
|
\ No newline at end of file |