-
Notifications
You must be signed in to change notification settings - Fork 0
/
ONOS-SDN-IP.xml
executable file
·362 lines (308 loc) · 12.5 KB
/
ONOS-SDN-IP.xml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~~~~~~~~~~~~~~~~~
|ONOS-SDN-IP Scenario|
~~~~~~~~~~~~~~~~~~~~~~
Name: ONOS-SDN-IP
Description: Virtual scenario of SDN-IP service (ONOS/CORD Project)
Author: Luis Bellido Triana, based on the wonderful project by Raúl
Author: Raúl Álvarez Pinilla
-->
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-2.00.xsd">
<global>
<version>2.0</version>
<scenario_name>ONOS-SDN-IP</scenario_name>
<automac/>
<vm_mgmt type="none" />
<!--vm_mgmt type="private" network="10.250.0.0" mask="24" offset="0">
<host_mapping />
</vm_mgmt-->
<vm_defaults>
<console id="0" display="no"/>
<console id="1" display="yes"/>
</vm_defaults>
</global>
<!-- NET DEFINITION -->
<!-- virbr0 (192.168.122.0/24) -->
<net name="virbr0" mode="virtual_bridge" managed="no"/>
<!-- Net101 (10.101.0.0/24) (2001:db8:101::/64) -->
<net name="net101" mode="virtual_bridge"/>
<!-- Net102 (10.102.0.0/24) (2001:db8:102::/64) -->
<net name="net102" mode="virtual_bridge"/>
<!-- Net103 (10.103.0.0/24) (2001:db8:103::/64) -->
<net name="net103" mode="virtual_bridge"/>
<!-- NetMgt (10.100.0.0/24) (2001:db8:100::/64) -->
<net name="netmgt" mode="virtual_bridge"/>
<!--SDN switches -->
<net name="s0" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:01:00">
<connection name='s0i1' net='i1'/>
</net>
<net name="s1" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:01:01">
<connection name='s1i2' net='i2'/>
</net>
<net name="s2" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:01:02">
<connection name='s2i3' net='i3'/>
</net>
<net name="s3" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:01:03">
<connection name='s3i4' net='i4'/>
</net>
<net name="i1" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:02:01">
<connection name='i1s1' net='s1'/>
<connection name='i1i2' net='i2'/>
</net>
<net name="i2" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:02:02">
<connection name='i2s2' net='s2'/>
</net>
<net name="i3" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:02:03">
<connection name='i3s3' net='s3'/>
<connection name='i3i4' net='i4'/>
</net>
<net name="i4" mode="openvswitch" controller="tcp:10.100.11.1:6633,tcp:10.100.11.5:6633" of_version="OpenFlow13" fail_mode="secure" hwaddr="00:00:00:00:02:04">
<connection name='i4s0' net='s0'/>
</net>
<!-- Quagga Server -->
<vm name="quagga" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="netmgt">
<ipv4>10.100.11.2/24</ipv4>
</if>
<if id="2" net="s0">
<ipv4>10.100.100.2/24</ipv4>
</if>
<forwarding type="ip"/>
<route type="ipv4" gw="10.100.11.3">default</route>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/quagga/</filetree>
<!-- Start Quagga Service (IPv4) -->
<exec seq="config-routers" type="verbatim">
cp /root/conf/zebra.conf /usr/local/etc/
cp /root/conf/bgpd_ipv4.conf /usr/local/etc/bgpd.conf
/root/conf/start-quagga.sh
</exec>
<exec seq="config-extrouter" type="verbatim">
ip route add 10.100.1.0/24 via 10.100.100.1
ip route add 10.100.2.0/24 via 10.100.100.1
ip route add 10.100.3.0/24 via 10.100.100.1
</exec>
</vm>
<!-- Router to Internet R-100 -->
<!--vm name="R-100" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="netmgt">
<ipv4>10.100.11.4/24</ipv4>
</if>
<if id="2" net="s0">
<ipv4>10.100.100.3/24</ipv4>
</if>
</vm-->
<!-- ONOS -->
<vm name="ONOS" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="2" net="netmgt">
<ipv4>10.100.11.1/24</ipv4>
</if>
<if id="9" net="virbr0">
<ipv4>dhcp</ipv4>
</if>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/ONOS/start-ONOS.sh</filetree>
<filetree seq="on_boot" root="/opt/onos/">conf/ONOS/options</filetree>
<filetree seq="on_boot" root="/opt/onos/config/network-cfg.json">conf/ONOS/network-cfg_ipv4.json</filetree>
<!-- Configure and Start ONOS (IPv4) -->
<exec seq="config-ONOS" type="verbatim">
echo 'alias onos-client=/opt/onos/karaf/bin/client' >> /root/.bashrc
/root/conf/start-ONOS.sh
</exec>
<exec seq="config-extrouter" type="verbatim">
/opt/onos/karaf/bin/client route-add 0.0.0.0/0 10.100.100.2
</exec>
</vm>
<!-- ONOS1 -->
<vm name="ONOS1" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="2" net="netmgt">
<ipv4>10.100.11.5/24</ipv4>
</if>
<if id="9" net="virbr0">
<ipv4>dhcp</ipv4>
</if>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/ONOS1/start-ONOS.sh</filetree>
<filetree seq="on_boot" root="/opt/onos/">conf/ONOS1/options</filetree>
<filetree seq="on_boot" root="/opt/onos/config/network-cfg.json">conf/ONOS1/network-cfg_ipv4.json</filetree>
<!-- Configure and Start ONOS1 (IPv4) -->
<exec seq="config-ONOS" type="verbatim">
echo 'alias onos-client=/opt/onos/karaf/bin/client' >> /root/.bashrc
/root/conf/start-ONOS.sh
</exec>
<exec seq="config-extrouter" type="verbatim">
/opt/onos/karaf/bin/client route-add 0.0.0.0/0 10.100.100.2
</exec>
</vm>
<!-- CLIENT AS64501 -->
<vm name="client-101" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net101">
<ipv4>10.101.0.2/24</ipv4>
</if>
<!-- Configure gateway -->
<exec seq="on_boot" type="verbatim">
ip route replace default via 10.101.0.1
ip -6 route replace default via 2001:db8:101::1
</exec>
<!-- ping -->
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 10.101.0.1
</exec>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 10.102.0.2
</exec>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 10.103.0.2
ping -c 4 -W 2 -n -q 10.100.1.2
</exec>
<exec seq="testping" type="verbatim">
ping -c 4 -W 2 -n -q 10.100.3.2
</exec>
</vm>
<!-- CLIENT AS64502 -->
<vm name="client-102" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net102">
<ipv4>10.102.0.2/24</ipv4>
</if>
<!-- Configure gateway -->
<exec seq="on_boot" type="verbatim">
ip route replace default via 10.102.0.1
ip -6 route replace default via 2001:db8:102::1
</exec>
</vm>
<!-- CLIENT AS64503 -->
<vm name="client-103" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net103">
<ipv4>10.103.0.2/24</ipv4>
</if>
<!-- Configure gateway -->
<exec seq="on_boot" type="verbatim">
ip route replace default via 10.103.0.1
ip -6 route replace default via 2001:db8:103::1
</exec>
</vm>
<!-- PUBLIC HOST AS64500-1 -->
<vm name="pub-100-1" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="i1">
<ipv4>10.100.1.2/24</ipv4>
</if>
<route type="ipv4" gw="10.100.1.1">default</route>
</vm>
<!-- PUBLIC HOST AS64500-3 -->
<vm name="pub-100-3" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="i3">
<ipv4>10.100.3.2/24</ipv4>
</if>
<route type="ipv4" gw="10.100.3.1">default</route>
</vm>
<!-- PRIVATE HOST AS64500-2 -->
<vm name="pri-100-2" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="i2">
<ipv4>172.16.2.2/24</ipv4>
</if>
<route type="ipv4" gw="172.16.2.1">default</route>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 172.16.2.1
</exec>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 172.16.4.2
</exec>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 10.100.1.2
</exec>
<exec seq="testping" type="verbatim">
ping -c 1 -W 2 -n -q 10.100.3.2
</exec>
</vm>
<!-- PRIVATE HOST AS64500-4 -->
<vm name="pri-100-4" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="i4">
<ipv4>172.16.4.2/24</ipv4>
</if>
<route type="ipv4" gw="172.16.4.1">default</route>
</vm>
<!-- ROUTER AS64501 -->
<vm name="R-101" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net101">
<ipv4>10.101.0.1/24</ipv4>
</if>
<if id="2" net="s1">
<ipv4>10.100.101.2/24</ipv4>
</if>
<!-- Enable IP forwarding in this node -->
<forwarding type="ip"/>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/R-101/</filetree>
<!-- Start Quagga Service (IPv4) -->
<exec seq="config-routers" type="verbatim">
cp /root/conf/zebra.conf /usr/local/etc/
cp /root/conf/bgpd_ipv4.conf /usr/local/etc/bgpd.conf
/root/conf/start-quagga.sh
</exec>
</vm>
<!-- ROUTER AS64502 -->
<vm name="R-102" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net102">
<ipv4>10.102.0.1/24</ipv4>
</if>
<if id="2" net="s2">
<ipv4>10.100.102.2/24</ipv4>
</if>
<!-- Enable IP forwarding in this node -->
<forwarding type="ip"/>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/R-102/</filetree>
<!-- Start Quagga Service (IPv4) -->
<exec seq="config-routers" type="verbatim">
cp /root/conf/zebra.conf /usr/local/etc/
cp /root/conf/bgpd_ipv4.conf /usr/local/etc/bgpd.conf
/root/conf/start-quagga.sh
</exec>
</vm>
<!-- ROUTER AS64503 -->
<vm name="R-103" type="lxc" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-onos-1.11.1</filesystem>
<if id="1" net="net103">
<ipv4>10.103.0.1/24</ipv4>
</if>
<if id="2" net="s3">
<ipv4>10.100.103.2/24</ipv4>
</if>
<!-- Enable IP forwarding in this node -->
<forwarding type="ip"/>
<!-- Copy configuration files -->
<filetree seq="on_boot" root="/root/conf/">conf/R-103/</filetree>
<!-- Start Quagga Service (IPv4) -->
<exec seq="config-routers" type="verbatim">
cp /root/conf/zebra.conf /usr/local/etc/
cp /root/conf/bgpd_ipv4.conf /usr/local/etc/bgpd.conf
/root/conf/start-quagga.sh
</exec>
</vm>
<host>
<hostif net="netmgt">
<ipv4>10.100.11.3/24</ipv4>
</hostif>
<route type="ipv4" gw="10.100.11.2">10.100.1.0/24</route>
<route type="ipv4" gw="10.100.11.2">10.100.2.0/24</route>
<route type="ipv4" gw="10.100.11.2">10.100.3.0/24</route>
<exec seq="config-extrouter" type="verbatim">
vnx_config_nat netmgt enp0s3
</exec>
</host>
</vnx>