pre final lap
[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 curl -X DELETE http://localhost:8080/stats/flowentry/clear/3
11 echo "adding new flows entry to switches 1 and 2"
12
13 curl -X POST -d '{
14     "dpid": 1,
15     "cookie": 1,
16     "cookie_mask": 1,
17     "table_id": 0,
18     "idle_timeout": 0,
19     "hard_timeout": 0,
20     "priority": 11111,
21     "flags": 1,
22     "match":{
23         "in_port":1
24     },
25     "actions":[
26         {
27             "type":"OUTPUT",
28             "port": 2
29         }
30     ]
31  }' http://localhost:8080/stats/flowentry/add
32
33 curl -X POST -d '{
34     "dpid": 1,
35     "cookie": 1,
36     "cookie_mask": 1,
37     "table_id": 0,
38     "idle_timeout": 0,
39     "hard_timeout": 0,
40     "priority": 22222,
41     "flags": 1,
42     "match":{
43         "in_port":2
44     },
45     "actions":[
46         {
47             "type":"OUTPUT",
48             "port": 1
49         }
50     ]
51  }' http://localhost:8080/stats/flowentry/add
52 curl -X POST -d '{
53     "dpid": 2,
54     "cookie": 1,
55     "cookie_mask": 1,
56     "table_id": 0,
57     "idle_timeout": 0,
58     "hard_timeout": 0,
59     "priority": 11111,
60     "flags": 1,
61     "match":{
62         "in_port":2
63     },
64     "actions":[
65         {
66             "type":"OUTPUT",
67             "port": 1
68         }
69     ]
70  }' http://localhost:8080/stats/flowentry/add
71
72 curl -X POST -d '{
73     "dpid": 2,
74     "cookie": 1,
75     "cookie_mask": 1,
76     "table_id": 0,
77     "idle_timeout": 0,
78     "hard_timeout": 0,
79     "priority": 22222,
80     "flags": 1,
81     "match":{
82         "in_port":1
83     },
84     "actions":[
85         {
86             "type":"OUTPUT",
87             "port": 2
88         }
89     ]
90  }' http://localhost:8080/stats/flowentry/add
91 echo "Connectivity from h1 to h2"
92 echo "Done"
93