forked from ivalenzuelan/SASE-SDWAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsase_tfg.xml
424 lines (391 loc) · 15.3 KB
/
sase_tfg.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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<?xml version="1.0" encoding="UTF-8"?>
<!--
~~~~~~~~~~~~~~~~~~~~
VNX SD-WAN scenario
~~~~~~~~~~~~~~~~~~~~
Name: SASE
Description: SD-WAN EDGE + REMOTE WORK + SASE-POP
This file is part of the Virtual Networks over LinuX (VNX) Project distribution.
(www: http://www.dit.upm.es/vnx - e-mail: [email protected])
Departamento de Ingenieria de Sistemas Telematicos (DIT)
Universidad Politecnica de Madrid
SPAIN
-->
<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>sase_tfg</scenario_name>
<automac offset="4"/>
<vm_mgmt type="none" />
<vm_defaults>
<console id="0" display="no"/>
<console id="1" display="yes"/>
</vm_defaults>
</global>
<net name="lan1" mode="virtual_bridge" />
<net name="lan2" mode="virtual_bridge" />
<net name="lan3" mode="virtual_bridge" />
<net name="lan0" mode="virtual_bridge" />
<net name="lan11" mode="veth" type="p2p"/>
<net name="lan21" mode="veth" type="p2p"/>
<net name="lan31" mode="veth" type="p2p"/>
<net name="lan10" mode="veth" type="p2p"/>
<net name="wan1" mode="veth" type="p2p"/>
<net name="wan2" mode="veth" type="p2p"/>
<net name="wan3" mode="veth" type="p2p"/>
<net name="lan12" mode="veth" type="p2p"/>
<net name="lan22" mode="veth" type="p2p"/>
<net name="lan32" mode="veth" type="p2p"/>
<net name="wan0" mode="virtual_bridge" />
<net name="int1" mode="virtual_bridge" />
<net name="int2" mode="virtual_bridge" />
<net name="int3" mode="virtual_bridge" />
<net name="int4" mode="virtual_bridge" />
<net name="virbr0" mode="virtual_bridge" managed="no"/>
<vm name="h11" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan1">
<ipv4>10.20.1.2/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTUdf
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<route type="ipv4" gw="10.20.1.1">default</route>
</vm>
<vm name="h21" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan2">
<ipv4>10.20.2.2/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<route type="ipv4" gw="10.20.2.1">default</route>
</vm>
<vm name="h01" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan0">
<ipv4>192.168.65.3/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<route type="ipv4" gw="192.168.65.1">default</route>
</vm>
<vm name="r1" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan1">
<ipv4>10.20.1.1/24</ipv4>
</if>
<if id="2" net="lan11">
<ipv4>10.20.0.1/24</ipv4>
</if>
<if id="3" net="lan12">
<ipv4>192.168.120.3/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="10.20.0.2">10.20.2.0/24</route>
<route type="ipv4" gw="10.20.0.3">192.168.65.0/24</route>
<route type="ipv4" gw="10.20.0.3">192.168.56.0/24</route>
<route type="ipv4" gw="192.168.120.1">0.0.0.0/0</route>
</vm>
<vm name="r2" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan2">
<ipv4>10.20.2.1/24</ipv4>
</if>
<if id="2" net="lan21">
<ipv4>10.20.0.2/24</ipv4>
</if>
<if id="3" net="lan22">
<ipv4>192.168.120.3/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="10.20.0.1">10.20.1.0/24</route>
<route type="ipv4" gw="192.168.120.1">0.0.0.0/0</route>
</vm>
<vm name="r3" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan3">
<ipv4>192.168.56.3/24</ipv4>
</if>
<if id="2" net="lan31">
<ipv4>10.20.0.3/24</ipv4>
</if>
<if id="3" net="lan32">
<ipv4>192.168.120.3/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="10.20.0.1">10.20.1.0/24</route>
<route type="ipv4" gw="192.168.56.2">192.168.65.0/24</route>
<route type="ipv4" gw="192.168.120.1">0.0.0.0/0</route>
</vm>
<vm name="r0" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan0">
<ipv4>192.168.65.1/24</ipv4>
</if>
<if id="2" net="lan10">
<ipv4>192.168.56.2/24</ipv4>
</if>
<exec seq="on_boot" type="verbatim">
# Change interfaces MTU
ifconfig eth1 mtu 1400
sed -i -e '/iface eth1 inet static/a \ mtu 1400' /etc/network/interfaces
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="192.168.56.3">0.0.0.0/0</route>
</vm>
<vm name="sdedge1" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan0">
</if>
<if id="2" net="wan1">
</if>
<if id="3" net="lan11">
</if>
<if id="4" net="lan12">
</if>
<filetree seq="on_boot" root="/root/" perms="755">simple_switch_14.py</filetree>
<filetree seq="on_boot" root="/root/" perms="755">ryu-51.sh</filetree>
<exec seq="on_boot" type="verbatim">
service openvswitch-switch start
sleep 5
ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth2
ovs-vsctl add-port br1 eth4
ip addr add 192.168.120.2/24 dev br1
ip link set br1 up
ip route add 0.0.0.0/0 via 192.168.120.1
ovs-vsctl add-br br0
ovs-vsctl set-fail-mode br0 secure
ovs-vsctl set bridge br0 other-config:hwaddr=00:00:00:00:00:01
ovs-vsctl set bridge br0 other-config:datapath-id=0000000000000001
ovs-vsctl set-controller br0 tcp:127.0.0.1
ip link add veth0 type veth peer name veth1
ifconfig veth0 up
ifconfig veth1 up
ip link add vxlan1 type vxlan id 0 remote 10.100.1.2 dstport 4789
ip link add vxlan2 type vxlan id 1 remote 10.100.1.3 dstport 4789
ip link set vxlan1 up
ip link set vxlan2 up
ovs-vsctl add-port br0 vxlan1
ovs-vsctl add-port br0 vxlan2
ovs-vsctl add-port br0 eth1
ovs-vsctl add-port br0 eth3
ovs-vsctl add-port br0 veth0
ovs-vsctl add-port br1 veth1
</exec>
</vm>
<vm name="sdedge2" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan0">
</if>
<if id="2" net="wan2">
</if>
<if id="3" net="lan21">
</if>
<if id="4" net="lan22">
</if>
<filetree seq="on_boot" root="/root/" perms="755">simple_switch_13.py</filetree>
<filetree seq="on_boot" root="/root/" perms="755">ryu-50.sh</filetree>
<exec seq="on_boot" type="verbatim">
service openvswitch-switch start
sleep 5
ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth2
ovs-vsctl add-port br1 eth4
ip addr add 192.168.120.2/24 dev br1
ip link set br1 up
ip route add 0.0.0.0/0 via 192.168.120.1
ovs-vsctl add-br br0
ovs-vsctl set-fail-mode br0 secure
ovs-vsctl set bridge br0 other-config:hwaddr=00:00:00:00:00:01
ovs-vsctl set bridge br0 other-config:datapath-id=0000000000000001
ovs-vsctl set-controller br0 tcp:127.0.0.1
ip link add veth0 type veth peer name veth1
ifconfig veth0 up
ifconfig veth1 up
ip link add vxlan1 type vxlan id 0 remote 10.100.1.1 dstport 4789
ip link set vxlan1 up
ovs-vsctl add-port br0 vxlan1
ovs-vsctl add-port br0 eth1
ovs-vsctl add-port br0 eth3
ovs-vsctl add-port br0 veth0
ovs-vsctl add-port br1 veth1
</exec>
</vm>
<vm name="sdedge3" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan0">
</if>
<if id="2" net="wan3">
</if>
<if id="3" net="lan31">
</if>
<if id="4" net="lan32">
</if>
<filetree seq="on_boot" root="/root/" perms="755">simple_switch_13.py</filetree>
<filetree seq="on_boot" root="/root/" perms="755">ryu-50.sh</filetree>
<exec seq="on_boot" type="verbatim">
service openvswitch-switch start
sleep 5
ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth2
ovs-vsctl add-port br1 eth4
ip addr add 192.168.120.2/24 dev br1
ip link set br1 up
ip route add 0.0.0.0/0 via 192.168.120.1
ovs-vsctl add-br br0
ovs-vsctl set-fail-mode br0 secure
ovs-vsctl set bridge br0 other-config:hwaddr=00:00:00:00:00:01
ovs-vsctl set bridge br0 other-config:datapath-id=0000000000000001
ip link add veth0 type veth peer name veth1
ovs-vsctl set-controller br0 tcp:127.0.0.1
ifconfig veth0 up
ifconfig veth1 up
ip link add vxlan2 type vxlan id 1 remote 10.100.1.1 dstport 4789
ip link set vxlan2 up
ovs-vsctl add-port br0 vxlan2
ovs-vsctl add-port br0 eth1
ovs-vsctl add-port br0 eth3
ovs-vsctl add-port br0 veth0
ovs-vsctl add-port br1 veth1
</exec>
</vm>
<vm name="sdedge0" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="lan10">
</if>
<if id="2" net="lan3">
</if>
<filetree seq="on_boot" root="/etc/snort/rules" perms="755">Myrules.rules</filetree>
<filetree seq="on_boot" root="/etc/snort" perms="755">snort.conf</filetree>
<filetree seq="on_boot" root="/root/" perms="755">simple_switch_snort.py</filetree>
<filetree seq="on_boot" root="/root/" perms="755">simple_switch_13.py</filetree>
<filetree seq="on_boot" root="/root/" perms="755">ryu-50.sh</filetree>
<filetree seq="on_boot" root="/root/" perms="755">snort-50.sh</filetree>
<filetree seq="on_boot" root="/root/" perms="755">iniciaSnort.sh</filetree>
<exec seq="on_boot" type="verbatim">
service openvswitch-switch start
sleep 5
ifconfig eth1 promisc
ovs-vsctl add-br br1
ovs-vsctl set bridge br1 other-config:hwaddr=00:00:00:00:00:01
ovs-vsctl set bridge br1 other-config:datapath-id=0000000000000001
ovs-vsctl set-controller br1 tcp:127.0.0.1
ovs-vsctl add-port br1 eth1
ovs-vsctl add-port br1 eth2
ip link set br1 up
</exec>
</vm>
<vm name="nat1" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan1">
<ipv4>192.168.120.1/24</ipv4>
</if>
<if id="2" net="int1">
<ipv4>10.100.1.1/24</ipv4>
</if>
<filetree seq="on_boot" root="/usr/bin/" perms="755">/usr/bin/vnx_config_nat</filetree>
<exec seq="on_boot" type="verbatim">
/usr/bin/vnx_config_nat eth1 eth2
iptables -t nat -A PREROUTING -p tcp -d 10.100.1.1 --dport 8080 -j DNAT --to-destination 192.168.120.2
iptables -t nat -A PREROUTING -p udp -d 10.100.1.1 --dport 4789 -j DNAT --to-destination 192.168.120.2
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="192.168.120.3">10.20.1.0/24</route>
<route type="ipv4" gw="10.100.1.254">default</route>
</vm>
<vm name="nat2" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan2">
<ipv4>192.168.120.1/24</ipv4>
</if>
<if id="2" net="int2">
<ipv4>10.100.1.2/24</ipv4>
</if>
<filetree seq="on_boot" root="/usr/bin/" perms="755">/usr/bin/vnx_config_nat</filetree>
<exec seq="on_boot" type="verbatim">
/usr/bin/vnx_config_nat eth1 eth2
iptables -t nat -A PREROUTING -p tcp -d 10.100.1.2 --dport 8080 -j DNAT --to-destination 192.168.120.2
iptables -t nat -A PREROUTING -p udp -d 10.100.1.2 --dport 4789 -j DNAT --to-destination 192.168.120.2
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="192.168.120.3">10.20.2.0/24</route>
<route type="ipv4" gw="10.100.1.254">default</route>
</vm>
<vm name="nat3" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="wan3">
<ipv4>192.168.120.1/24</ipv4>
</if>
<if id="2" net="int4">
<ipv4>10.100.1.3/24</ipv4>
</if>
<filetree seq="on_boot" root="/usr/bin/" perms="755">/usr/bin/vnx_config_nat</filetree>
<exec seq="on_boot" type="verbatim">
/usr/bin/vnx_config_nat eth1 eth2
iptables -t nat -A PREROUTING -p udp -d 10.100.1.3 --dport 4789 -j DNAT --to-destination 192.168.120.2
iptables -t nat -A PREROUTING -p tcp -d 10.100.1.3 --dport 8080 -j DNAT --to-destination 192.168.120.2
</exec>
<forwarding type="ip" />
<route type="ipv4" gw="192.168.120.3">192.168.65.0/24</route>
<route type="ipv4" gw="10.100.1.254">default</route>
</vm>
<vm name="isp" type="lxc" exec_mode="lxc-attach" arch="x86_64">
<filesystem type="cow">/usr/share/vnx/filesystems/rootfs_lxc_ubuntu64</filesystem>
<if id="1" net="int1">
</if>
<if id="2" net="int2">
</if>
<if id="3" net="int3">
</if>
<if id="4" net="int4">
</if>
<if id="9" net="virbr0">
<ipv4>dhcp</ipv4>
</if>
<forwarding type="ip" />
<filetree seq="on_boot" root="/usr/bin/" perms="755">/usr/bin/vnx_config_nat</filetree>
<exec seq="on_boot" type="verbatim">
service openvswitch-switch start
sleep 5
ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth1
ovs-vsctl add-port br1 eth2
ovs-vsctl add-port br1 eth3
ovs-vsctl add-port br1 eth4
ip addr add 10.100.1.254/24 dev br1
ip link set br1 up
/usr/bin/vnx_config_nat br1 eth9
</exec>
</vm>
<host>
<hostif net="int3">
<ipv4>10.100.1.99/24</ipv4>
</hostif>
</host>
</vnx>