Commit 42fa12d9 authored by Pedro Oliveira's avatar Pedro Oliveira

use kathara instead of netkit

parent ca26ca39
# pim
# PIM-DM - Test Neighborhood establishment
### Topology
![topology](topology.png)
### Execute test
### Requirements
- Kathara (https://www.kathara.org/)
- Docker
- gnome-terminal
### Execute lab test
```sh
$ . script.sh
```
### Close test
This script file will clone pim-dm repository to get the most updated version on the lab environment. Then will start the VMs through Kathara and change some settings on the virtual bridges that connect the VMs.
### Close lab test
```sh
$ cd emulation/
$ lcrash
$ kathara wipe
```
LAB_DESCRIPTION="Lab for testing the discovery of neighbors on PIM-DM"
LAB_VERSION=1.0
LAB_AUTHOR="Pedro Oliveira"
LAB_EMAIL=pedro.francisco.oliveira@tecnico.ulisboa.pt
#########################################
# Router setup
#########################################
router1[0]=A
router1[1]=tap,192.168.2.1,192.168.2.2
router1[bridged]=true
router1[mem]=256
router1[image]="pedrofran12/kathara-hpim-dm"
router2[0]=B
router2[mem]=256
router2[image]="pedrofran12/kathara-hpim-dm"
router3[0]=C
router3[mem]=256
router3[image]="pedrofran12/kathara-hpim-dm"
router4[0]=D
router4[mem]=256
router4[image]="pedrofran12/kathara-hpim-dm"
#########################################
# Switch setup
......@@ -22,4 +32,5 @@ switch1[1]=B
switch1[2]=C
switch1[3]=D
switch1[mem]=256
switch1[image]="pedrofran12/kathara-hpim-dm"
ip addr add dev eth0 10.0.0.1/24
ip -6 addr add 2001:0:0:1::1/64 dev eth0
ip link set dev eth0 up
......@@ -4,4 +4,5 @@ python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R1 10.0.0.5
python3 Run.py -ai eth0
python3 Run.py -ai eth0 -6
python3 Run.py -v
ip addr add dev eth0 10.0.0.2/24
ip -6 addr add 2001:0:0:1::2/64 dev eth0
ip link set dev eth0 up
......@@ -4,4 +4,5 @@ python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R2 10.0.0.5
python3 Run.py -ai eth0
python3 Run.py -ai eth0 -6
python3 Run.py -v
ip addr add dev eth0 10.0.0.3/24
ip -6 addr add 2001:0:0:1::3/64 dev eth0
ip link set dev eth0 up
......@@ -4,4 +4,5 @@ python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R3 10.0.0.5
python3 Run.py -ai eth0
python3 Run.py -ai eth0 -6
python3 Run.py -v
ip addr add dev eth0 10.0.0.4/24
ip -6 addr add 2001:0:0:1::4/64 dev eth0
ip link set dev eth0 up
......@@ -5,4 +5,5 @@ python3 Run.py -stop
python3 Run.py -start
python3 Run.py -t R4 10.0.0.5
python3 Run.py -ai eth0
python3 Run.py -ai eth0 -6
python3 Run.py -v
#!/bin/bash
if [ ! -d "netkit-ng" ]; then
# se pasta netkit-ng nao existir descomprimir ficheiros
wget -nc https://github.com/netkit-ng/netkit-ng-core/releases/download/3.0.4/netkit-ng-core-32-3.0.4.tar.bz2
wget -nc https://web.ist.utl.pt/~ist177956/netkit/netkit-ng-filesystem-i386-F7.0-0.1.3.tar.bz2
wget -nc https://github.com/netkit-ng/netkit-ng-build/releases/download/0.1.3/netkit-ng-kernel-i386-K3.2-0.1.3.tar.bz2
tar -xjSf netkit-ng-core-32-3.0.4.tar.bz2
tar -xjSf netkit-ng-filesystem-i386-F7.0-0.1.3.tar.bz2
tar -xjSf netkit-ng-kernel-i386-K3.2-0.1.3.tar.bz2
fi
if [ ! -d "emulation/shared/root/pim_dm" ]; then
# if project does not exist, clone it
git clone https://github.com/pedrofran12/pim_dm.git emulation/shared/root/pim_dm
fi
export NETKIT_HOME=$(pwd)/netkit-ng
export MANPATH=:$NETKIT_HOME/man
export PATH=$NETKIT_HOME/bin:$PATH
cd emulation/
sudo kathara lclean
sudo kathara lstart --privileged
cd netkit-ng
OUTPUT=$(./check_configuration.sh);
if echo $OUTPUT | grep -q "failed"; then
#erro na instalacao do netkit
echo "$OUTPUT"
exit
fi
# open terminal of all nodes
for f in *; do
if [ -d "$f" -a "$f"=~"shared" ]; then
gnome-terminal -- kathara connect "$f";
fi
done
for f in $(ls /sys/devices/virtual/net/ | grep "kt"); do
sudo bash -c "echo 0 > /sys/devices/virtual/net/$f/bridge/multicast_snooping"
done
cd ../emulation/
lstart -p
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment