Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | bridge="$1" |
| 3 | controller="$2" |
| 4 | if [ x"$bridge" = "x" ]; then |
Chetan Gaonker | b92e153 | 2016-04-20 10:31:18 -0700 | [diff] [blame] | 5 | bridge="ovsbr0" |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 6 | fi |
| 7 | if [ x"$controller" = "x" ]; then |
| 8 | controller=$ONOS_CONTROLLER_IP |
| 9 | fi |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 10 | pkill -9 ofdatapath |
| 11 | pkill -9 ofprotocol |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 12 | service openvswitch-switch start |
| 13 | echo "Configuring ovs bridge $bridge" |
| 14 | ovs-vsctl del-br $bridge |
| 15 | ovs-vsctl add-br $bridge |
| 16 | my_ip=`ifconfig docker0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1` |
A R Karthick | 4682c76 | 2016-07-20 18:56:05 -0700 | [diff] [blame^] | 17 | #ovs-vsctl set-controller $bridge ptcp:6653:$my_ip tcp:$controller:6633 |
| 18 | ovs-vsctl set-controller $bridge tcp:$controller:6653 |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 19 | ovs-vsctl set controller $bridge max_backoff=1000 |
| 20 | ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 |
| 21 | ovs-vsctl show |
| 22 | ovs-ofctl show $bridge |