Update Lab00 authored by Katharina Renk's avatar Katharina Renk
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:
![lab00-network](uploads/8368a36fc08940d10ec416b8875c70a8/lab00-network.png)
## 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
```
![CLI_image](uploads/155116353627ae3070a53b3fdaeda421/CLI_image.PNG)
## 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)
![login_password](uploads/01ef770d924f8d3f85726bbf124f93fd/login_password.PNG)
### Set-up the PND ID
```bash
pnd use (Choose ID from the displayed menu)
```
![PND_id_display](uploads/2a9f123cc63f6bc1b046beca92c6d0b2/PND_id_display.PNG)
![PND_success](uploads/1f9ec97b38ee90fcdcf0c157972297a1/PND_success.PNG)
## 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:![Lab00_mne_list](uploads/23ec897ac1b9a307e733786529cf875f/Lab00_mne_list.png)
**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>
![Lab00_mne_get_path](uploads/bf90335d558c8b904d658683446fa427/Lab00_mne_get_path.png)
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>
```
![Lab00_change_commit_confirm](uploads/e53eb1a9b7eb44b8fc459917872a4c5a/Lab00_change_commit_confirm.png)
If we execute the get-command again, we can confirm that the change took place:
```bash
mne path get <UUID> system/config/hostname
```
![Lab00_mne_get_path_new_hostname](uploads/4319202ec04c381ace695de8ffc774cf/Lab00_mne_get_path_new_hostname.png)
\ No newline at end of file