-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmininet_beba_install.sh
More file actions
99 lines (81 loc) · 2.62 KB
/
mininet_beba_install.sh
File metadata and controls
99 lines (81 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env bash
# Beba install script for Mininet 2.2.1 on Ubuntu 14.04 (64 bit)
# (https://github.com/mininet/mininet/wiki/Mininet-VM-Images)
# This script is based on "Mininet install script" by Brandon Heller
# (brandonh@stanford.edu)
#
# Authors: Davide Sanvito, Luca Pollini, Carmelo Cascone
SWITCHURL="https://github.com/beba-eu/beba-switch.git"
CTRLURL="https://github.com/beba-eu/beba-ctrl.git"
# Exit immediately if a command exits with a non-zero status.
set -e
# Exit immediately if a command tries to use an unset variable
set -o nounset
function beba-switch {
sudo apt-get -y install cmake
echo "Installing Beba switch based on ofsoftswitch13..."
cd ~/
if [ -d "beba-switch" ]; then
read -p "A directory named beba-switch already exists, by proceeding \
it will be deleted. Are you sure? (y/n) " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf ~/beba-switch
else
echo "User abort!"
return -1
fi
fi
git clone ${SWITCHURL} beba-switch
# Resume the install:
cd ~/beba-switch
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
cd ~/
sudo chown -R mininet:mininet ~/beba-switch
}
# Install beba-ctrl
function beba-ctrl {
echo "Installing Beba controller based on RYU..."
# install beba-ctrl dependencies"
sudo apt-get -y install autoconf automake g++ libtool python make libxml2 \
libxslt-dev python-pip python-dev python-matplotlib
sudo pip install gevent pbr pulp networkx fnss numpy
sudo pip install -I six==1.9.0
# fetch beba-ctrl
cd ~/
if [ -d "beba-ctrl" ]; then
read -p "A directory named beba-ctrl already exists, by proceeding it will be \
deleted. Are you sure? (y/n) " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf ~/beba-ctrl
else
echo "User abort!"
return -1
fi
fi
git clone ${CTRLURL} beba-ctrl
cd beba-ctrl
# install beba-ctrl
sudo pip install -r tools/pip-requires
sudo pip install -I eventlet==0.17.4
sudo python ./setup.py install
sudo chown -R mininet:mininet ~/beba-ctrl
}
# Download BEBA node for Mininet
function download-mininet-node {
echo "Downloading BEBA node for Mininet..."
sudo apt-get -y install valgrind
cd ~/
wget https://raw.githubusercontent.com/beba-eu/beba-utilities/master/beba.py
}
sudo apt-get update
~/mininet/util/install.sh -nt
download-mininet-node
beba-ctrl
beba-switch
echo "All set!"