1
1
#! /bin/sh
2
-
2
+ # create ovs database if not exist.
3
3
ovsdb-tool create /host/var/lib/openvswitch/conf.db 2> /dev/null
4
+ # run ovsdb server
4
5
ovsdb-server \
5
6
--unixctl=/host/var/run/openvswitch/ovsdb-server.0.ctl \
6
7
--pidfile=/host/var/run/openvswitch/ovsdb-server.pid \
7
8
--remote=punix:/host/var/run/openvswitch/db.sock \
8
9
--overwrite-pidfile \
9
10
--detach \
10
11
/host/var/lib/openvswitch/conf.db
11
-
12
+ # run openvswitch daemon
12
13
ovs-vswitchd \
13
14
--unixctl=/host/var/run/openvswitch/ovs-vswitchd.0.ctl \
14
15
--pidfile=/host/var/run/openvswitch/ovs-vswitchd.pid \
15
16
--overwrite-pidfile \
16
17
--detach \
17
18
unix:/host/var/run/openvswitch/db.sock
18
-
19
19
# create default public external internet bridge
20
- ovs-vsctl --db=unix:/host/var/run/openvswitch/db.sock add-br $OVS_BRIDGE 2> /dev/null
21
- ovs-vsctl --db=unix:/host/var/run/openvswitch/db.sock add-port $OVS_BRIDGE $NODE_NIC 2> /dev/null
20
+ ovs-vsctl --db=unix:/host/var/run/openvswitch/db.sock add-br $DEFAULT_OVS_BRIDGE 2> /dev/null
21
+ ovs-vsctl --db=unix:/host/var/run/openvswitch/db.sock add-port $DEFAULT_OVS_BRIDGE $NODE_NIC 2> /dev/null
22
22
23
23
# Isolataion for default public external network
24
- ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock del-flows $OVS_BRIDGE
25
- ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $OVS_BRIDGE " priority=0,actions=drop"
26
- ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $OVS_BRIDGE " in_port=$NODE_NIC ,actions=NORMAL"
27
- ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $OVS_BRIDGE " actions=output=$NODE_NIC "
24
+ ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock del-flows $DEFAULT_OVS_BRIDGE
25
+ ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $DEFAULT_OVS_BRIDGE " priority=0,actions=drop"
26
+ ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $DEFAULT_OVS_BRIDGE " in_port=$NODE_NIC ,actions=NORMAL"
27
+ ovs-ofctl --db=unix:/host/var/run/openvswitch/db.sock add-flow $DEFAULT_OVS_BRIDGE " actions=output=$NODE_NIC "
28
+
29
+ # run the agent
30
+ ./beaveragent
0 commit comments