blob: 5bd3ba79be2daaca8d962794f10a3bffe622e708 [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
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
16my_ip=`ifconfig docker0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1`
A R Karthick4682c762016-07-20 18:56:05 -070017#ovs-vsctl set-controller $bridge ptcp:6653:$my_ip tcp:$controller:6633
18ovs-vsctl set-controller $bridge tcp:$controller:6653
Chetan Gaonker4ca5cca2016-04-11 13:59:35 -070019ovs-vsctl set controller $bridge max_backoff=1000
20ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
21ovs-vsctl show
22ovs-ofctl show $bridge