]>
Commit | Line | Data |
---|---|---|
31eae3e3 | 1 | #!/bin/bash |
47a3a827 | 2 | # SPDX-License-Identifier: MIT |
31eae3e3 CF |
3 | # |
4 | # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF") | |
31eae3e3 CF |
5 | |
6 | # Load shared functions | |
7 | CDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
8 | . $CDIR/funcs.sh | |
9 | ||
10 | # | |
11 | # Script begin | |
12 | # | |
13 | ||
14 | log_info "Configuring OpenvSwitch...." | |
15 | ||
16 | # Configure OpenvSwitch so we are able to run mininet | |
17 | mkdir -p /var/run/openvswitch | |
18 | ovsdb-tool create /etc/openvswitch/conf.db \ | |
19 | /usr/share/openvswitch/vswitch.ovsschema | |
20 | ovsdb-server /etc/openvswitch/conf.db \ | |
21 | --remote=punix:/var/run/openvswitch/db.sock \ | |
22 | --remote=ptcp:6640 --pidfile=ovsdb-server.pid >/dev/null 2>/dev/null & \ | |
23 | disown | |
24 | ovs-vswitchd >/dev/null 2>/dev/null & disown | |
25 | ||
26 | sleep 2 | |
27 | ||
28 | ovs-vsctl --no-wait -- init | |
29 | ovs_version=$(ovs-vsctl -V | grep ovs-vsctl | awk '{print $4}') | |
30 | ovs_db_version=$(\ | |
31 | ovsdb-tool schema-version /usr/share/openvswitch/vswitch.ovsschema) | |
32 | ovs-vsctl --no-wait -- set Open_vSwitch . db-version="${ovs_db_version}" | |
33 | ovs-vsctl --no-wait -- set Open_vSwitch . ovs-version="${ovs_version}" | |
34 | ovs-vsctl --no-wait -- set Open_vSwitch . system-type="docker-ovs" | |
35 | ovs-vsctl --no-wait -- set Open_vSwitch . system-version="0.1" | |
36 | ovs-vsctl --no-wait -- \ | |
37 | set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid` | |
38 | ovs-vsctl --no-wait -- set-manager ptcp:6640 | |
39 | ovs-appctl -t ovsdb-server \ | |
40 | ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options |