-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathovsinstall.sh
61 lines (47 loc) · 1.64 KB
/
ovsinstall.sh
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
#!/bin/bash
# Make sure only root can run this script
if [ "$(id -u)" != "0" ]; then
echo "you need to be 'root'" 1>&2
exit 1
fi
version = "2.5.6"
if [ "$1" != "" ]; then
version = $1
fi
#install
#apt-get update
#apt-get install -y build-essential
echo "==================INSTALL OpenvSwitch-$1==============="
#apt-get install -y uml-utilities libtool python-qt4 python-twisted-conch debhelper python-all
if [ -f openvswitch-$1.tar.gz ]
then
echo "openvswitch-$1.tar.gz has exit"
else
wget https://www.openvswitch.org/releases/openvswitch-$1.tar.gz
fi
if [ -d openvswitch-$1 ]
then
rm -r openvswitch-$1
fi
tar -xzf openvswitch-$1.tar.gz
# install openvswitch
cd openvswitch-$1
make clean
./configure --with-linux=/lib/modules/`uname -r`/build 2>/dev/null
make && make install
# install Open vSwitch kernel module
insmod datapath/linux/openvswitch.ko
make modules_install
mkdir -p /usr/local/etc/openvswitch
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema 2>/dev/null
ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
--pidfile --detach
#ovsdb-server -v --remote=punix:/usr/local/var/run/openvswitch/db.sock --pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
ovs-vsctl show
depmod -A openvswitch