A R Karthick | 1fa6654 | 2017-08-10 14:15:29 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 16 | dpid=${1:-001122334455} |
| 17 | num_ports=${2:-200} |
| 18 | controller=${3:-$ONOS_CONTROLLER_IP} |
| 19 | num_ports=$(($num_ports-1)) |
| 20 | my_ip=`ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d":" -f2 |cut -d" " -f1` |
| 21 | if_list="veth1" |
| 22 | for port in $(seq 3 2 $num_ports); do |
| 23 | if_list="$if_list"",""veth$port" |
| 24 | done |
| 25 | service openvswitch-switch stop |
| 26 | nohup ofdatapath --no-slicing --datapath-id=$dpid --interfaces=$if_list ptcp:6653 2>&1 >/tmp/nohup.out & |
| 27 | nohup ofprotocol tcp:$my_ip:6653 tcp:$controller:6633 2>&1 >/tmp/nohup.out & |