blob: 114725d2b2e140c1d3d6d6ecb8c1da6dde2522a3 [file] [log] [blame]
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -07001#!/usr/bin/env bash
2bridge="$1"
3controller="$2"
4if [ x"$bridge" = "x" ]; then
Chetan Gaonkerb92e1532016-04-20 10:31:18 -07005 bridge="ovsbr0"
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -07006fi
7if [ x"$controller" = "x" ]; then
8 controller=$ONOS_CONTROLLER_IP
9fi
10service openvswitch-switch start
11echo "Configuring ovs bridge $bridge"
12ovs-vsctl del-br $bridge
13ovs-vsctl add-br $bridge
14my_ip=`ifconfig docker0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1`
15ovs-vsctl set-controller $bridge ptcp:6653:$my_ip tcp:$controller:6633
16ovs-vsctl set controller $bridge max_backoff=1000
17ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
18ovs-vsctl show
19ovs-ofctl show $bridge