blob: 8dfc5ade0d08fa0f1931b2f31b6ae5919d703421 [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
A R Karthickb7e80902016-05-17 09:38:31 -070010pkill -9 ofdatapath
11pkill -9 ofprotocol
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -070012service openvswitch-switch start
13echo "Configuring ovs bridge $bridge"
14ovs-vsctl del-br $bridge
15ovs-vsctl add-br $bridge
16my_ip=`ifconfig docker0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1`
17ovs-vsctl set-controller $bridge ptcp:6653:$my_ip tcp:$controller:6633
18ovs-vsctl set controller $bridge max_backoff=1000
19ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
20ovs-vsctl show
21ovs-ofctl show $bridge