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 |
| 5 | bridge="br0" |
| 6 | fi |
| 7 | if [ x"$controller" = "x" ]; then |
| 8 | controller=$ONOS_CONTROLLER_IP |
| 9 | fi |
| 10 | service openvswitch-switch start |
| 11 | echo "Configuring ovs bridge $bridge" |
| 12 | ovs-vsctl del-br $bridge |
| 13 | ovs-vsctl add-br $bridge |
| 14 | my_ip=`ifconfig docker0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1` |
| 15 | ovs-vsctl set-controller $bridge ptcp:6653:$my_ip tcp:$controller:6633 |
| 16 | ovs-vsctl set controller $bridge max_backoff=1000 |
| 17 | ovs-vsctl set bridge $bridge protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 |
| 18 | ovs-vsctl show |
| 19 | ovs-ofctl show $bridge |