regions-topo-2
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Test topology
host=${1:-127.0.0.1}
onos ${host} null-simulation stop custom
onos ${host} wipe-out please
onos ${host} null-simulation start custom
onos ${host} <<-EOF
null-create-device switch s1 10 0 0
null-create-device switch s2 10 0 0
null-create-device switch s3 10 0 0
null-create-device switch s4 10 0 0
null-create-device switch s5 10 0 0
null-create-device switch s6 10 0 0
null-create-device switch s7 10 0 0
null-create-device switch s8 10 0 0
null-create-device switch s9 10 0 0
# null-create-device switch s10 10 0 0
null-create-link direct s1 s2
null-create-link direct s2 s3
null-create-link direct s2 s4
null-create-link direct s3 s4
null-create-link direct s3 s5
null-create-link direct s6 s5
null-create-link direct s6 s8
null-create-link direct s7 s9
null-create-link direct s8 s9
null-create-link direct s5 s7
null-create-link direct s8 s7
EOF
onos ${host} <<-EOF
region-add r1 Region1 METRO ${host}
region-add r2 Region2 METRO ${host}
region-add r3 Region3 CAMPUS ${host}
region-add-devices r1 \
of:0000000000000002 \
of:0000000000000003 \
of:0000000000000004
region-add-devices r2 \
of:0000000000000005 \
of:0000000000000006
region-add-devices r3 \
of:0000000000000007 \
of:0000000000000008 \
of:0000000000000009
regions
layout-add l1 r1
layout-add l2 r2
layout-add l3 r3 l2
layouts
EOF