]> git.proxmox.com Git - pve-docs.git/blame_incremental - pvesdn.adoc
sdn: add some reference anchors, some polishing
[pve-docs.git] / pvesdn.adoc
... / ...
CommitLineData
1[[chapter_pvesdn]]
2Software Defined Network
3========================
4ifndef::manvolnum[]
5:pve-toplevel:
6endif::manvolnum[]
7
8The **S**oftware **D**efined **N**etwork (SDN) feature allows one to create
9virtual networks (vnets) at datacenter level.
10
11WARNING: SDN is currently an **experimental feature** in {pve}. This
12Documentation for it is also still under development, ask on our
13xref:getting_help[mailing lists or in the forum] for questions and feedback.
14
15
16[[pvesdn_installation]]
17Installation
18------------
19
20To enable the experimental SDN integration, you need to install
21"libpve-network-perl" package
22
23----
24apt install libpve-network-perl
25----
26
27You need to have `ifupdown2` package installed on each node to manage local
28configuration reloading without reboot:
29
30----
31apt install ifupdown2
32----
33
34Basic Overview
35--------------
36
37The {pve} SDN allows separation and fine grained control of Virtual Guests
38networks, using flexible software controlled configurations.
39
40Separation consists of zones, a zone is it's own virtual separated area.
41A Zone can be used by one or more 'VNets'. A 'VNet' is virtual network in a
42zone. Normally it shows up as a common Linux bridge with either a VLAN or
43'VXLAN' tag, or using layer 3 routing for control.
44The 'VNets' are deployed locally on each node, after configuration was commited
45from the cluster wide datacenter level.
46
47
48Main configuration
49------------------
50
51The configuration is done at datacenter (cluster-wide) level, it will be saved
52in configuration files located in the shared configuration file system:
53`/etc/pve/sdn`
54
55On the web-interface SDN feature have 4 main sections for the configuration
56
57* SDN: a overview of the SDN state
58
59* Zones: Create and manage the virtual separated network Zones
60
61* VNets: The per-node building block to provide a Zone for VMs
62
63* Controller:
64
65
66[[pvesdn_config_main_sdn]]
67SDN
68~~~
69
70This is the main status panel. Here you can see deployment status of zones on
71different nodes.
72
73There is an 'Apply' button, to push and reload local configuration on all
74cluster nodes nodes.
75
76
77[[pvesdn_config_zone]]
78Zones
79~~~~~
80
81A zone will define a virtually separated network.
82
83It can use different technologies for separation:
84
85* VLAN: Virtual LANs are the classic method to sub-divide a LAN
86
87* QinQ: stacked VLAN (formally known as `IEEE 802.1ad`)
88
89* VXLAN: (layer2 vxlan)
90
91* bgp-evpn: vxlan using layer3 border gateway protocol routing
92
93You can restrict a zone to specific nodes.
94
95It's also possible to add permissions on a zone, to restrict user to use only a
96specific zone and only the VNets in that zone
97
98[[pvesdn_config_vnet]]
99VNets
100~~~~~
101
102A `VNet` is in its basic form just a Linux bridge that will be deployed locally
103on the node and used for Virtual Machine communication.
104
105VNet properties are:
106
107* ID: a 8 characters ID to name and identify a VNet
108
109* Alias: Optional longer name, if the ID isn't enough
110
111* Zone: The associated zone for this VNet
112
113* Tag: The unique VLAN or VXLAN id
114
115* IPv4: an anycast IPv4 address, it will be configured on the underlying bridge
116 on each node part of the Zone. It's only useful for `bgp-evpn` routing.
117
118* IPv6: an anycast IPv6 address, it will be configured on the underlying bridge
119 on each node part of the Zone. It's only useful for `bgp-evpn` routing.
120
121
122[[pvesdn_config_controllers]]
123Controllers
124~~~~~~~~~~~
125
126Some zone types need an external controller to manage the VNet control-plane.
127Currently this is only required for the `bgp-evpn` zone plugin.
128
129
130[[pvesdn_zone_plugins]]
131Zones Plugins
132-------------
133
134Common options
135~~~~~~~~~~~~~~
136
137nodes:: Deploy and allow to use a VNets configured for this Zone only on these
138nodes.
139
140[[pvesdn_zone_plugin_vlan]]
141VLAN Zones
142~~~~~~~~~~
143
144This is the simplest plugin, it will reuse an existing local Linux or OVS
145bridge, and manage VLANs on it.
146The benefit of using SDN module, is that you can create different zones with
147specific VNets VLAN tag, and restrict Virtual Machines to separated zones.
148
149Specific `VLAN` configuration options:
150
151bridge:: Reuse this local VLAN-aware bridge, or OVS interface, already
152configured on *each* local node.
153
154[[pvesdn_zone_plugin_qinq]]
155QinQ Zones
156~~~~~~~~~~
157
158QinQ is stacked VLAN. The first VLAN tag defined for the zone
159(so called 'service-vlan'), and the second VLAN tag defined for the vnets
160
161NOTE: Your physical network switchs must support stacked VLANs!
162
163Specific QinQ configuration options:
164
165bridge:: A local VLAN-aware bridge already configured on each local node
166
167service vlan:: The main VLAN tag of this zone
168
169mtu:: Due to the double stacking of tags you need 4 more bytes for QinQ VLANs.
170For example, you reduce the MTU to `1496` if you physical interface MTU is
171`1500`.
172
173[[pvesdn_zone_plugin_vxlan]]
174VXLAN Zones
175~~~~~~~~~~~
176
177The VXLAN plugin will establish a tunnel (named overlay) on top of an existing
178network (named underlay). It encapsulate layer 2 Ethernet frames within layer
1794 UDP datagrams, using `4789` as the default destination port. You can, for
180example, create a private IPv4 VXLAN network on top of public internet network
181nodes.
182This is a layer2 tunnel only, no routing between different VNets is possible.
183
184Each VNet will have use specific VXLAN id from the range (1 - 16777215).
185
186Specific EVPN configuration options:
187
188peers address list:: A list of IPs from all nodes through which you want to
189communicate. Can also be external nodes.
190
191mtu:: Because VXLAN encapsulation use 50bytes, the MTU need to be 50 bytes
192lower than the outgoing physical interface.
193
194[[pvesdn_zone_plugin_evpn]]
195EVPN Zones
196~~~~~~~~~~
197
198This is the most complex of all supported plugins.
199
200BGP-EVPN allows one to create routable layer3 network. The VNet of EVPN can
201have an anycast IP-address and or MAC-address. The bridge IP is the same on each
202node, with this a virtual guest can use that address as gateway.
203
204Routing can work across VNets from different zones through a VRF (Virtual
205Routing and Forwarding) interface.
206
207Specific EVPN configuration options:
208
209VRF VXLAN Tag:: This is a vxlan-id used for routing interconnect between vnets,
210it must be different than VXLAN-id of VNets
211
212controller:: an EVPN-controller need to be defined first (see controller
213plugins section)
214
215mtu:: because VXLAN encapsulation use 50bytes, the MTU need to be 50 bytes
216lower than the outgoing physical interface.
217
218
219[[pvesdn_controller_plugins]]
220Controllers Plugins
221-------------------
222
223[[pvesdn_controller_plugin_evpn]]
224EVPN Controller
225~~~~~~~~~~~~~~~
226
227For `BGP-EVPN`, we need a controller to manage the control plane.
228The currently supported software controller is the "frr" router.
229You may need to install it on each node where you want to deploy EVPN zones.
230
231----
232apt install frr
233----
234
235Configuration options:
236
237asn:: A unique BGP ASN number. It's highly recommended to use private ASN
238number (64512 – 65534, 4200000000 – 4294967294), as else you could end up
239breaking, or get broken, by global routing by mistake.
240
241peers:: An ip list of all nodes where you want to communicate (could be also
242external nodes or route reflectors servers)
243
244Additionally, if you want to route traffic from a SDN BGP-EVPN network to
245external world:
246
247gateway-nodes:: The proxmox nodes from where the bgp-evpn traffic will exit to
248external through the nodes default gateway
249
250gateway-external-peers:: If you want that gateway nodes don't use the default
251gateway, but, for example, sent traffic to external BGP routers, which handle
252(reverse) routing then dynamically you can use. For example
253`192.168.0.253,192.168.0.254'
254
255
256[[pvesdn_local_deployment_monitoring]]
257Local Deployment Monitoring
258---------------------------
259
260After applying the configuration through the main SDN web-interface panel,
261the local network configuration is generated locally on each node in
262`/etc/network/interfaces.d/sdn`, and with ifupdown2 reloaded.
263
264You can monitor the status of local zones and vnets through the main tree.
265
266
267[[pvesdn_setup_example_vlan]]
268VLAN Setup Example
269------------------
270
271TIP: While we show plain configuration content here, almost everything should
272be configurable using the web-interface only.
273
274Node1: /etc/network/interfaces
275
276----
277auto vmbr0
278iface vmbr0 inet manual
279 bridge-ports eno1
280 bridge-stp off
281 bridge-fd 0
282 bridge-vlan-aware yes
283 bridge-vids 2-4094
284
285#management ip on vlan100
286auto vmbr0.100
287iface vmbr0.100 inet static
288 address 192.168.0.1/24
289
290source /etc/network/interfaces.d/*
291----
292
293Node2: /etc/network/interfaces
294
295----
296auto vmbr0
297iface vmbr0 inet manual
298 bridge-ports eno1
299 bridge-stp off
300 bridge-fd 0
301 bridge-vlan-aware yes
302 bridge-vids 2-4094
303
304#management ip on vlan100
305auto vmbr0.100
306iface vmbr0.100 inet static
307 address 192.168.0.2/24
308
309source /etc/network/interfaces.d/*
310----
311
312Create a VLAN zone named `myvlanzone':
313
314----
315id: myvlanzone
316bridge: vmbr0
317----
318
319Create a VNet named `myvnet1' with `vlan-id` `10' and the previously created
320`myvlanzone' as it's zone.
321
322----
323id: myvnet1
324zone: myvlanzone
325tag: 10
326----
327
328Apply the configuration through the main SDN panel, to create VNets locally on
329each nodes.
330
331Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
332
333Use the following network configuration for this VM:
334
335----
336auto eth0
337iface eth0 inet static
338 address 10.0.3.100/24
339----
340
341Create a second Virtual Machine (vm2) on node2, with a vNIC on the same VNet
342`myvnet1' as vm1.
343
344Use the following network configuration for this VM:
345
346----
347auto eth0
348iface eth0 inet static
349 address 10.0.3.101/24
350----
351
352Then, you should be able to ping between both VMs over that network.
353
354
355[[pvesdn_setup_example_qinq]]
356QinQ Setup Example
357------------------
358
359TIP: While we show plain configuration content here, almost everything should
360be configurable using the web-interface only.
361
362Node1: /etc/network/interfaces
363
364----
365auto vmbr0
366iface vmbr0 inet manual
367 bridge-ports eno1
368 bridge-stp off
369 bridge-fd 0
370 bridge-vlan-aware yes
371 bridge-vids 2-4094
372
373#management ip on vlan100
374auto vmbr0.100
375iface vmbr0.100 inet static
376 address 192.168.0.1/24
377
378source /etc/network/interfaces.d/*
379----
380
381Node2: /etc/network/interfaces
382
383----
384auto vmbr0
385iface vmbr0 inet manual
386 bridge-ports eno1
387 bridge-stp off
388 bridge-fd 0
389 bridge-vlan-aware yes
390 bridge-vids 2-4094
391
392#management ip on vlan100
393auto vmbr0.100
394iface vmbr0.100 inet static
395 address 192.168.0.2/24
396
397source /etc/network/interfaces.d/*
398----
399
400Create an QinQ zone named `qinqzone1' with service VLAN 20
401
402----
403id: qinqzone1
404bridge: vmbr0
405service vlan: 20
406----
407
408Create another QinQ zone named `qinqzone2' with service VLAN 30
409
410----
411id: qinqzone2
412bridge: vmbr0
413service vlan: 30
414----
415
416Create a VNet named `myvnet1' with customer vlan-id 100 on the previously
417created `qinqzone1' zone.
418
419----
420id: myvnet1
421zone: qinqzone1
422tag: 100
423----
424
425Create a `myvnet2' with customer VLAN-id 100 on the previously created
426`qinqzone2' zone.
427
428----
429id: myvnet2
430zone: qinqzone1
431tag: 100
432----
433
434Apply the configuration on the main SDN web-interface panel to create VNets
435locally on each nodes.
436
437Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
438
439Use the following network configuration for this VM:
440
441----
442auto eth0
443iface eth0 inet static
444 address 10.0.3.100/24
445----
446
447Create a second Virtual Machine (vm2) on node2, with a vNIC on the same VNet
448`myvnet1' as vm1.
449
450Use the following network configuration for this VM:
451
452----
453auto eth0
454iface eth0 inet static
455 address 10.0.3.101/24
456----
457
458Create a third Virtual Machine (vm3) on node1, with a vNIC on the other VNet
459`myvnet2'.
460
461Use the following network configuration for this VM:
462
463----
464auto eth0
465iface eth0 inet static
466 address 10.0.3.102/24
467----
468
469Create another Virtual Machine (vm4) on node2, with a vNIC on the same VNet
470`myvnet2' as vm3.
471
472Use the following network configuration for this VM:
473
474----
475auto eth0
476iface eth0 inet static
477 address 10.0.3.103/24
478----
479
480Then, you should be able to ping between the VMs 'vm1' and 'vm2', also
481between 'vm3' and 'vm4'. But, none of VMs 'vm1' or 'vm2' can ping the VMs 'vm3'
482or 'vm4', as they are on a different zone with different service-vlan.
483
484
485[[pvesdn_setup_example_vxlan]]
486VXLAN Setup Example
487-------------------
488
489TIP: While we show plain configuration content here, almost everything should
490be configurable using the web-interface only.
491
492node1: /etc/network/interfaces
493
494----
495auto vmbr0
496iface vmbr0 inet static
497 address 192.168.0.1/24
498 gateway 192.168.0.254
499 bridge-ports eno1
500 bridge-stp off
501 bridge-fd 0
502 mtu 1500
503
504source /etc/network/interfaces.d/*
505----
506
507node2: /etc/network/interfaces
508
509----
510auto vmbr0
511iface vmbr0 inet static
512 address 192.168.0.2/24
513 gateway 192.168.0.254
514 bridge-ports eno1
515 bridge-stp off
516 bridge-fd 0
517 mtu 1500
518
519source /etc/network/interfaces.d/*
520----
521
522node3: /etc/network/interfaces
523
524----
525auto vmbr0
526iface vmbr0 inet static
527 address 192.168.0.3/24
528 gateway 192.168.0.254
529 bridge-ports eno1
530 bridge-stp off
531 bridge-fd 0
532 mtu 1500
533
534source /etc/network/interfaces.d/*
535----
536
537Create an VXLAN zone named `myvxlanzone', use the lower MTU to ensure the extra
53850 bytes of the VXLAN header can fit. Add all previously configured IPs from
539the nodes as peer address list.
540
541----
542id: myvxlanzone
543peers address list: 192.168.0.1,192.168.0.2,192.168.0.3
544mtu: 1450
545----
546
547Create a VNet named `myvnet1' using the VXLAN zone `myvxlanzone' created
548previously.
549
550----
551id: myvnet1
552zone: myvxlanzone
553tag: 100000
554----
555
556Apply the configuration on the main SDN web-interface panel to create VNets
557locally on each nodes.
558
559Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
560
561Use the following network configuration for this VM, note the lower MTU here.
562
563----
564auto eth0
565iface eth0 inet static
566 address 10.0.3.100/24
567 mtu 1450
568----
569
570Create a second Virtual Machine (vm2) on node3, with a vNIC on the same VNet
571`myvnet1' as vm1.
572
573Use the following network configuration for this VM:
574
575----
576auto eth0
577iface eth0 inet static
578 address 10.0.3.101/24
579 mtu 1450
580----
581
582Then, you should be able to ping between between 'vm1' and 'vm2'.
583
584
585[[pvesdn_setup_example_evpn]]
586EVPN Setup Example
587------------------
588
589node1: /etc/network/interfaces
590
591----
592auto vmbr0
593iface vmbr0 inet static
594 address 192.168.0.1/24
595 gateway 192.168.0.254
596 bridge-ports eno1
597 bridge-stp off
598 bridge-fd 0
599 mtu 1500
600
601source /etc/network/interfaces.d/*
602----
603
604node2: /etc/network/interfaces
605
606----
607auto vmbr0
608iface vmbr0 inet static
609 address 192.168.0.2/24
610 gateway 192.168.0.254
611 bridge-ports eno1
612 bridge-stp off
613 bridge-fd 0
614 mtu 1500
615
616source /etc/network/interfaces.d/*
617----
618
619node3: /etc/network/interfaces
620
621----
622auto vmbr0
623iface vmbr0 inet static
624 address 192.168.0.3/24
625 gateway 192.168.0.254
626 bridge-ports eno1
627 bridge-stp off
628 bridge-fd 0
629 mtu 1500
630
631source /etc/network/interfaces.d/*
632----
633
634Create a EVPN controller, using a private ASN number and above node addreesses
635as peers. Define 'node1' and 'node2' as gateway nodes.
636
637----
638id: myevpnctl
639asn: 65000
640peers: 192.168.0.1,192.168.0.2,192.168.0.3
641gateway nodes: node1,node2
642----
643
644Create an EVPN zone named `myevpnzone' using the previously created
645EVPN-controller.
646
647----
648id: myevpnzone
649vrf vxlan tag: 10000
650controller: myevpnctl
651mtu: 1450
652----
653
654Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone', a IPv4
655CIDR network and a random MAC address.
656
657----
658id: myvnet1
659zone: myevpnzone
660tag: 11000
661ipv4: 10.0.1.1/24
662mac address: 8C:73:B2:7B:F9:60 #random generate mac addres
663----
664
665Create the second VNet named `myvnet2' using the same EVPN zone `myevpnzone', a
666different IPv4 CIDR network and a different random MAC address than `myvnet1'.
667
668----
669id: myvnet2
670zone: myevpnzone
671tag: 12000
672ipv4: 10.0.2.1/24
673mac address: 8C:73:B2:7B:F9:61 #random mac, need to be different on each vnet
674----
675
676Apply the configuration on the main SDN web-interface panel to create VNets
677locally on each nodes and generate the FRR config.
678
679
680Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
681
682Use the following network configuration for this VM:
683
684----
685auto eth0
686iface eth0 inet static
687 address 10.0.1.100/24
688 gateway 10.0.1.1 #this is the ip of the vnet1
689 mtu 1450
690----
691
692Create a second Virtual Machine (vm2) on node2, with a vNIC on the other VNet
693`myvnet2'.
694
695Use the following network configuration for this VM:
696
697----
698auto eth0
699iface eth0 inet static
700 address 10.0.2.100/24
701 gateway 10.0.2.1 #this is the ip of the vnet2
702 mtu 1450
703----
704
705
706Then, you should be able to ping vm2 from vm1, and vm1 from vm2.
707
708If you ping an external IP from 'vm2' on the non-gateway 'node3', the packet
709will go to the configured 'myvnet2' gateway, then will be routed to gateway
710nodes ('node1' or 'node2') and from there it will leave those nodes over the
711default gateway configured on node1 or node2.
712
713NOTE: Of course you need to add reverse routes for the '10.0.1.0/24' and
714'10.0.2.0/24' network to node1, node2 on your external gateway, so that the
715public network can reply back.
716
717If you have configured an external BGP router, the BGP-EVPN routes (10.0.1.0/24
718and 10.0.2.0/24 in this example), will be announced dynamically.