b7f251c4590c9100dbd3206eac979b523c6034c0
[vsorcdistro/.git] / scripts / basicflow.sh
1 #!/bin/bash
2 : '
3 Written by: Felix G. Tejada
4
5 This script is applied to a linear 3 topo, just for show the example
6 '
7 echo "Cleaning all flows entry switch dpid 1 and 2"
8 curl -X DELETE http://localhost:8080/stats/flowentry/clear/1
9 curl -X DELETE http://localhost:8080/stats/flowentry/clear/2
10 echo "adding new flows entry to switches 1 and 2"
11
12 curl -X POST -d '{
13     "dpid": 1,
14     "cookie": 1,
15     "cookie_mask": 1,
16     "table_id": 0,
17     "idle_timeout": 0,
18     "hard_timeout": 0,
19     "priority": 11111,
20     "flags": 1,
21     "match":{
22         "in_port":1
23     },
24     "actions":[
25         {
26             "type":"OUTPUT",
27             "port": 2
28         }
29     ]
30  }' http://localhost:8080/stats/flowentry/add
31
32 curl -X POST -d '{
33     "dpid": 1,
34     "cookie": 1,
35     "cookie_mask": 1,
36     "table_id": 0,
37     "idle_timeout": 0,
38     "hard_timeout": 0,
39     "priority": 22222,
40     "flags": 1,
41     "match":{
42         "in_port":2
43     },
44     "actions":[
45         {
46             "type":"OUTPUT",
47             "port": 1
48         }
49     ]
50  }' http://localhost:8080/stats/flowentry/add
51 curl -X POST -d '{
52     "dpid": 2,
53     "cookie": 1,
54     "cookie_mask": 1,
55     "table_id": 0,
56     "idle_timeout": 0,
57     "hard_timeout": 0,
58     "priority": 11111,
59     "flags": 1,
60     "match":{
61         "in_port":2
62     },
63     "actions":[
64         {
65             "type":"OUTPUT",
66             "port": 1
67         }
68     ]
69  }' http://localhost:8080/stats/flowentry/add
70
71 curl -X POST -d '{
72     "dpid": 2,
73     "cookie": 1,
74     "cookie_mask": 1,
75     "table_id": 0,
76     "idle_timeout": 0,
77     "hard_timeout": 0,
78     "priority": 22222,
79     "flags": 1,
80     "match":{
81         "in_port":1
82     },
83     "actions":[
84         {
85             "type":"OUTPUT",
86             "port": 2
87         }
88     ]
89  }' http://localhost:8080/stats/flowentry/add
90 echo "Connectivity from h1 to h2"
91 echo "Done"
92