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 |
A R Karthick | 2b93d6a | 2016-09-06 15:19:09 -0700 | [diff] [blame] | 8 | controller="$ONOS_CONTROLLER_IP" |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 9 | fi |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 10 | pkill -9 ofdatapath |
| 11 | pkill -9 ofprotocol |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 12 | service openvswitch-switch restart |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 13 | echo "Configuring ovs bridge $bridge" |
| 14 | ovs-vsctl del-br $bridge |
| 15 | ovs-vsctl add-br $bridge |
A R Karthick | 2b93d6a | 2016-09-06 15:19:09 -0700 | [diff] [blame] | 16 | ctlr="" |
| 17 | for ip in `echo $controller | tr ',' '\n'`; do |
| 18 | ctlr="$ctlr tcp:$ip:6653" |
| 19 | done |
| 20 | ovs-vsctl set-controller $bridge $ctlr |
Chetan Gaonker | 4ca5cca | 2016-04-11 13:59:35 -0700 | [diff] [blame] | 21 | ovs-vsctl set controller $bridge max_backoff=1000 |
| 22 | ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 |
| 23 | ovs-vsctl show |
| 24 | ovs-ofctl show $bridge |