backing up
[vsorcdistro/.git] / scripts / basic2.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 2 and 3"
8 curl -X DELETE http://localhost:8080/stats/flowentry/clear/2
9 curl -X DELETE http://localhost:8080/stats/flowentry/clear/3
10 echo "adding new flows entry to switches 2 and 3"
11
12 curl -X POST -d '{
13     "dpid": 2,
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         "eth_type":0x0800,
23         "in_port":1
24
25     },
26     "actions":[
27         {
28             "type":"EMPTY"
29         }
30     ]
31  }' http://localhost:8080/stats/flowentry/add
32
33 curl -X POST -d '{
34     "dpid": 2,
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         "eth_type":0x0800,
44         "in_port":2
45
46     },
47     "actions":[
48         {
49             "type":"EMPTY"
50         }
51     ]
52  }' http://localhost:8080/stats/flowentry/add
53 curl -X POST -d '{
54     "dpid": 3,
55     "cookie": 1,
56     "cookie_mask": 1,
57     "table_id": 0,
58     "idle_timeout": 0,
59     "hard_timeout": 0,
60     "priority": 11111,
61     "flags": 1,
62     "match":{
63         "eth_type":0x0800,
64         "in_port":1
65
66     },
67     "actions":[
68         {
69             "type":"EMPTY"
70         }
71     ]
72  }' http://localhost:8080/stats/flowentry/add
73
74 curl -X POST -d '{
75     "dpid": 3,
76     "cookie": 1,
77     "cookie_mask": 1,
78     "table_id": 0,
79     "idle_timeout": 0,
80     "hard_timeout": 0,
81     "priority": 22222,
82     "flags": 1,
83     "match":{
84         "eth_type":0x0800,
85         "in_port":2
86     },
87     "actions":[
88         {
89             "type":"EMPTY"
90         }
91     ]
92  }' http://localhost:8080/stats/flowentry/add
93 echo "Connectivity from h2 to h3 droped"
94 echo "Done"
95