2 # SPDX-License-Identifier: MIT
4 # Copyright 2018 Network Device Education Foundation, Inc. ("NetDEF")
6 # Load shared functions
7 CDIR
="$(cd "$
(dirname "${BASH_SOURCE[0]}")" && pwd)"
14 log_info
"Configuring OpenvSwitch...."
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
& \
24 ovs-vswitchd
>/dev
/null
2>/dev
/null
& disown
28 ovs-vsctl
--no-wait -- init
29 ovs_version
=$
(ovs-vsctl
-V |
grep ovs-vsctl |
awk '{print $4}')
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