blob: 6abfae6371a3f16761be85bb82dc0496f42ffd13 [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
A R Karthick2b93d6a2016-09-06 15:19:09 -07008 controller="$ONOS_CONTROLLER_IP"
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -07009fi
A R Karthickb7e80902016-05-17 09:38:31 -070010pkill -9 ofdatapath
11pkill -9 ofprotocol
A R Karthicka013a272016-08-16 16:40:19 -070012service openvswitch-switch restart
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -070013echo "Configuring ovs bridge $bridge"
14ovs-vsctl del-br $bridge
15ovs-vsctl add-br $bridge
A R Karthick2b93d6a2016-09-06 15:19:09 -070016ctlr=""
17for ip in `echo $controller | tr ',' '\n'`; do
18 ctlr="$ctlr tcp:$ip:6653"
19done
20ovs-vsctl set-controller $bridge $ctlr
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -070021ovs-vsctl set controller $bridge max_backoff=1000
22ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
23ovs-vsctl show
24ovs-ofctl show $bridge