refactor(testbed): Split node scripts from ./10-host_setup.sh

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2024-12-30 17:25:17 +01:00
parent 66d1e9eb58
commit f3e97a4619
4 changed files with 52 additions and 49 deletions

View File

@@ -105,20 +105,21 @@ respective IP.
This script is run with `bfshell -b $(pwd)/04-wedge_route_configure.py`
### 10-host_setup.sh
### 10-host*setup*\*.sh
> This script needs to be run on the respective nodes with the section
> of the hosts commented in and the other sections commented out.
> These scripts need to be run on the respective nodes.
This script executes multiple scripts which setup the hosts.
In our setup we'll only have two hosts, but this can be extended to other
hosts as well.
Information needed to do so is:
This script executes the helper scripts to
- The interface name which is connected to the switch
- MAC address of the interface
- Unused IP address
- And take a look at the appendix under "Adding new node"
- Setup Namespaces
- Setup Interfaces
- Setup IP Addresses
- Setup ARP Table Entries
on the respective node.
./10-host_setup_node1.sh needs to be executed on node1.
./10-host_setup_node2.sh needs to be executed on node2.
### 19-cleanup.sh
@@ -263,11 +264,13 @@ bfrt.l1switch.pipe.SwitchIngress.t_l1_forwarding.add_with_send(
- egress_port: Value at the `D_P` column at the output of the last script.
#### Adjust ./10-host_setup.sh
#### Add ./10-host_setup_node3.sh
Add a section for you new node like this:
Create a new script
```sh
#!/bin/bash
# node3
sudo ./30-add_namespaces.sh tb_node3_if0
sudo ./30-add_namespaces.sh tb_node3_if1
@@ -290,7 +293,6 @@ Adjust [./32-setup_arp.sh](./32-setup_arp.sh) before running this script.
#### Adjust ./32-setup_arp.sh
Add the following section for your new interfaces like this:
Replace the placeholder mac address with the actual MAC addresses of the interfaces.
```sh
ip netns exec "$NS" arp -i "$IF" -s 10.0.3.1 00:00:00:00:00:01
@@ -298,3 +300,5 @@ ip netns exec "$NS" arp -i "$IF" -s 10.0.3.2 00:00:00:00:00:02
ip netns exec "$NS" arp -i "$IF" -s 10.0.3.3 00:00:00:00:00:03
ip netns exec "$NS" arp -i "$IF" -s 10.0.3.4 00:00:00:00:00:04
```
Replace the placeholder mac address with the actual MAC addresses of the interfaces.