Update Lab02 authored by Katharina Renk's avatar Katharina Renk
**UNDER CONSTRUCTION!**
In this lab, we will set up a simple topology with [containerlab](https://containerlab.dev/) and configure two cEOS switches 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:
![lab01-network.drawio](uploads/740f134f3313299bee3a76b76274ec3d/lab01-network.drawio.png)
## Run the containerlab
Go to the directory of gosdn and use following command:
```
make containerlab-start
```
## Download the folder below and place it into the artifacts folder of your gosdn folder
[lab01.zip](uploads/e7bbf3f0575a4e471c8ba8862c0b2dde/lab01.zip)
Or get it with wget:
```
wget https://code.fbi.h-da.de/danet/gosdn/-/wikis/uploads/e7bbf3f0575a4e471c8ba8862c0b2dde/lab01.zip
```
## 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
```
![CLI_image](uploads/155116353627ae3070a53b3fdaeda421/CLI_image.PNG)
## 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)
![login_password](uploads/01ef770d924f8d3f85726bbf124f93fd/login_password.PNG)
## Set up the PND ID
```
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 devices/switches
```
mne create --address 172.100.0.11:6030 --name switch1 --username admin --password admin --type plugin
mne create --address 172.100.0.12:6030 --name switch2 --username admin --password admin --type plugin
```
## Check for the devices
```
mne list
```
## Configuration of the switches(the UUID have to be changed according to the output from the devices)
### Switch 1
```
mne set 401982c5-fb98-4402-b98f-1b6d30915fc4 network-instances/network-instance[name=default]/config --file ./lab01/enable-routing.json --force-push
mne set 401982c5-fb98-4402-b98f-1b6d30915fc4 interfaces/interface[name=Ethernet1] --file ./lab01/s01-ethernet01.json --force-push
mne set 401982c5-fb98-4402-b98f-1b6d30915fc4 interfaces/interface[name=Ethernet2] --file ./lab01/s01-ethernet02.json --force-push
mne set 401982c5-fb98-4402-b98f-1b6d30915fc4 network-instances/network-instance[name=default]/protocols --file ./lab01/s01-route.json --force-push
mne set 401982c5-fb98-4402-b98f-1b6d30915fc4 network-instances/network-instance[name=default]/tables --file ./lab01/tables.json --force-push
```
### Switch 2
```
mne set c724b95b-c751-4728-9f19-376e0d570104 network-instances/network-instance[name=default]/config --file ./lab01/enable-routing.json --force-push
mne set c724b95b-c751-4728-9f19-376e0d570104 interfaces/interface[name=Ethernet1] --file ./lab01/s02-ethernet01.json --force-push
mne set c724b95b-c751-4728-9f19-376e0d570104 interfaces/interface[name=Ethernet2] --file ./lab01/s02-ethernet02.json --force-push
mne set c724b95b-c751-4728-9f19-376e0d570104 network-instances/network-instance[name=default]/protocols --file ./lab01/s02-route.json --force-push
mne set c724b95b-c751-4728-9f19-376e0d570104 network-instances/network-instance[name=default]/tables --file ./lab01/tables.json --force-push
```
If you've cloned the goSDN repo from [here](https://code.fbi.h-da.de/danet/gosdn) and have all the requirements, then you can start the containerlab topology (which is defined below) using the command `make containerlab-start` from within the root of the repository
## CLI and the controller
### Setup centos devices
Since we do not have access via gNMI on those devices, we have to perform some steps manually, within the container itself.
First we have to get into the centos device via
`docker exec -it clab-gosdn_csbi_arista_base-centos1 bash`
and run the following commands:
```
[root@centos1 /]# ip address add 10.0.0.100/24 dev eth1
[root@centos1 /]# ip route del default
[root@centos1 /]# ip route add default via 10.0.0.1 dev eth1
[root@centos1 /]# exit
```
`docker exec -it clab-gosdn_csbi_arista_base-centos2 bash`
```
[root@centos2 /]# ip address add 192.168.0.100/24 dev eth1
[root@centos2 /]# ip route del default
[root@centos2 /]# ip route add default via 192.168.0.1 dev eth1
[root@centos2 /]# exit
```
## Testing our setup
### Ping the centos devices with the ip's
```
docker exec -ti clab-gosdn_csbi_arista_base-centos1 ping 192.168.0.1
docker exec -ti clab-gosdn_csbi_arista_base-centos2 ping 10.0.0.1
```
\ No newline at end of file