blob: 8ad125d9e2423fd2cf723ffd31a3935015999ae4 [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`
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