]> git.proxmox.com Git - pve-docs.git/blame_incremental - pvesdn.adoc
bump version to 8.0.1
[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 you to create
9virtual networks (VNets) at the 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 Software Defined Network (SDN) integration, you need
21to install the `libpve-network-perl` and `ifupdown2` packages on every node:
22
23----
24apt update
25apt install libpve-network-perl ifupdown2
26----
27
28NOTE: {pve} version 7 and above come installed with ifupdown2.
29
30After this, you need to add the following line to the end of the
31`/etc/network/interfaces` configuration file, so that the SDN configuration gets
32included and activated.
33
34----
35source /etc/network/interfaces.d/*
36----
37
38
39Basic Overview
40--------------
41
42The {pve} SDN allows for separation and fine-grained control of virtual guest
43networks, using flexible, software-controlled configurations.
44
45Separation is managed through zones, where a zone is its own virtual separated
46network area. A 'VNet' is a type of a virtual network connected to a zone.
47Depending on which type or plugin the zone uses, it can behave differently and
48offer different features, advantages, and disadvantages. Normally, a 'VNet'
49appears as a common Linux bridge with either a VLAN or 'VXLAN' tag, however,
50some can also use layer 3 routing for control. 'VNets' are deployed locally on
51each node, after being configured from the cluster-wide datacenter SDN
52administration interface.
53
54
55Main Configuration
56~~~~~~~~~~~~~~~~~~
57
58Configuration is done at the datacenter (cluster-wide) level and is saved in
59files located in the shared configuration file system:
60`/etc/pve/sdn`
61
62On the web-interface, SDN features 3 main sections:
63
64* SDN: An overview of the SDN state
65
66* Zones: Create and manage the virtually separated network zones
67
68* VNets: Create virtual network bridges and manage subnets
69
70In addition to this, the following options are offered:
71
72* Controller: For controlling layer 3 routing in complex setups
73
74* Subnets: Used to defined IP networks on VNets
75
76* IPAM: Enables the use of external tools for IP address management (guest
77 IPs)
78
79* DNS: Define a DNS server API for registering virtual guests' hostname and IP
80 addresses
81
82[[pvesdn_config_main_sdn]]
83
84SDN
85~~~
86
87This is the main status panel. Here you can see the deployment status of zones
88on different nodes.
89
90The 'Apply' button is used to push and reload local configuration on all cluster
91nodes.
92
93
94[[pvesdn_local_deployment_monitoring]]
95Local Deployment Monitoring
96~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
98After applying the configuration through the main SDN panel,
99the local network configuration is generated locally on each node in
100the file `/etc/network/interfaces.d/sdn`, and reloaded with ifupdown2.
101
102You can monitor the status of local zones and VNets through the main tree.
103
104
105[[pvesdn_config_zone]]
106Zones
107-----
108
109A zone defines a virtually separated network. Zones can be restricted to
110specific nodes and assigned permissions, in order to restrict users to a certain
111zone and its contained VNets.
112
113Different technologies can be used for separation:
114
115* VLAN: Virtual LANs are the classic method of subdividing a LAN
116
117* QinQ: Stacked VLAN (formally known as `IEEE 802.1ad`)
118
119* VXLAN: Layer2 VXLAN
120
121* Simple: Isolated Bridge. A simple layer 3 routing bridge (NAT)
122
123* EVPN (BGP EVPN): VXLAN using layer 3 border gateway protocol (BGP) routing
124
125Common options
126~~~~~~~~~~~~~~
127
128The following options are available for all zone types:
129
130nodes:: The nodes which the zone and associated VNets should be deployed on
131
132ipam:: Optional. Use an IP Address Management (IPAM) tool to manage IPs in the
133 zone.
134
135dns:: Optional. DNS API server.
136
137reversedns:: Optional. Reverse DNS API server.
138
139dnszone:: Optional. DNS domain name. Used to register hostnames, such as
140 `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
141
142
143[[pvesdn_zone_plugin_simple]]
144Simple Zones
145~~~~~~~~~~~~
146
147This is the simplest plugin. It will create an isolated VNet bridge.
148This bridge is not linked to a physical interface, and VM traffic is only
149local between the node(s).
150It can also be used in NAT or routed setups.
151
152[[pvesdn_zone_plugin_vlan]]
153VLAN Zones
154~~~~~~~~~~
155
156This plugin reuses an existing local Linux or OVS bridge, and manages the VLANs
157on it. The benefit of using the SDN module is that you can create different
158zones with specific VNet VLAN tags, and restrict virtual machines to separated
159zones.
160
161Specific `VLAN` configuration options:
162
163bridge:: Reuse this local bridge or OVS switch, already configured on *each*
164 local node.
165
166[[pvesdn_zone_plugin_qinq]]
167QinQ Zones
168~~~~~~~~~~
169
170QinQ also known as VLAN stacking, wherein the first VLAN tag is defined for the
171zone (the 'service-vlan'), and the second VLAN tag is defined for the
172VNets.
173
174NOTE: Your physical network switches must support stacked VLANs for this
175configuration!
176
177Below are the configuration options specific to QinQ:
178
179bridge:: A local, VLAN-aware bridge that is already configured on each local
180 node
181
182service vlan:: The main VLAN tag of this zone
183
184service vlan protocol:: Allows you to choose between an 802.1q (default) or
185 802.1ad service VLAN type.
186
187mtu:: Due to the double stacking of tags, you need 4 more bytes for QinQ VLANs.
188 For example, you must reduce the MTU to `1496` if you physical interface MTU is
189 `1500`.
190
191[[pvesdn_zone_plugin_vxlan]]
192VXLAN Zones
193~~~~~~~~~~~
194
195The VXLAN plugin establishes a tunnel (overlay) on top of an existing
196network (underlay). This encapsulates layer 2 Ethernet frames within layer
1974 UDP datagrams, using `4789` as the default destination port. You can, for
198example, create a private IPv4 VXLAN network on top of public internet network
199nodes.
200
201This is a layer 2 tunnel only, so no routing between different VNets is
202possible.
203
204Each VNet will have a specific VXLAN ID in the range 1 - 16777215.
205
206Specific EVPN configuration options:
207
208peers address list:: A list of IP addresses from each node through which you
209 want to communicate. Can also be external nodes.
210
211mtu:: Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes
212 lower than the outgoing physical interface.
213
214[[pvesdn_zone_plugin_evpn]]
215EVPN Zones
216~~~~~~~~~~
217
218This is the most complex of all the supported plugins.
219
220BGP-EVPN allows you to create a routable layer 3 network. The VNet of EVPN can
221have an anycast IP address and/or MAC address. The bridge IP is the same on each
222node, meaning a virtual guest can use this address as gateway.
223
224Routing can work across VNets from different zones through a VRF (Virtual
225Routing and Forwarding) interface.
226
227The configuration options specific to EVPN are as follows:
228
229VRF VXLAN tag:: This is a VXLAN-ID used for routing interconnect between VNets.
230 It must be different than the VXLAN-ID of the VNets.
231
232controller:: An EVPN-controller must to be defined first (see controller plugins
233 section).
234
235VNet MAC address:: A unique, anycast MAC address for all VNets in this zone.
236 Will be auto-generated if not defined.
237
238Exit Nodes:: Optional. This is used if you want to define some {pve} nodes as
239 exit gateways from the EVPN network, through the real network. The configured
240 nodes will announce a default route in the EVPN network.
241
242Primary Exit Node:: Optional. If you use multiple exit nodes, this forces
243 traffic to a primary exit node, instead of load-balancing on all nodes. This
244 is required if you want to use SNAT or if your upstream router doesn't support
245 ECMP.
246
247Exit Nodes local routing:: Optional. This is a special option if you need to
248 reach a VM/CT service from an exit node. (By default, the exit nodes only
249 allow forwarding traffic between real network and EVPN network).
250
251Advertise Subnets:: Optional. If you have silent VMs/CTs (for example, if you
252 have multiple IPs and the anycast gateway doesn't see traffic from theses IPs,
253 the IP addresses won't be able to be reach inside the EVPN network). This
254 option will announce the full subnet in the EVPN network in this case.
255
256Disable Arp-Nd Suppression:: Optional. Don't suppress ARP or ND packets.
257 This is required if you use floating IPs in your guest VMs
258 (IP are MAC addresses are being moved between systems).
259
260Route-target import:: Optional. Allows you to import a list of external EVPN
261 route targets. Used for cross-DC or different EVPN network interconnects.
262
263MTU:: Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes
264 less than the maximal MTU of the outgoing physical interface.
265
266
267[[pvesdn_config_vnet]]
268VNets
269-----
270
271A `VNet` is, in its basic form, a Linux bridge that will be deployed locally on
272the node and used for virtual machine communication.
273
274The VNet configuration properties are:
275
276ID:: An 8 character ID to name and identify a VNet
277
278Alias:: Optional longer name, if the ID isn't enough
279
280Zone:: The associated zone for this VNet
281
282Tag:: The unique VLAN or VXLAN ID
283
284VLAN Aware:: Enable adding an extra VLAN tag in the virtual machine or
285container's vNIC configuration, to allow the guest OS to manage the VLAN's tag.
286
287[[pvesdn_config_subnet]]
288Subnets
289~~~~~~~~
290
291A subnetwork (subnet) allows you to define a specific IP network
292(IPv4 or IPv6). For each VNet, you can define one or more subnets.
293
294A subnet can be used to:
295
296* Restrict the IP addresses you can define on a specific VNet
297* Assign routes/gateways on a VNet in layer 3 zones
298* Enable SNAT on a VNet in layer 3 zones
299* Auto assign IPs on virtual guests (VM or CT) through IPAM plugins
300* DNS registration through DNS plugins
301
302If an IPAM server is associated with the subnet zone, the subnet prefix will be
303automatically registered in the IPAM.
304
305Subnet properties are:
306
307ID:: A CIDR network address, for example 10.0.0.0/8
308
309Gateway:: The IP address of the network's default gateway. On layer 3 zones
310 (Simple/EVPN plugins), it will be deployed on the VNet.
311
312SNAT:: Optional. Enable SNAT for layer 3 zones (Simple/EVPN plugins), for this
313 subnet. The subnet's source IP will be NATted to server's outgoing interface/IP.
314 On EVPN zones, this is only done on EVPN gateway-nodes.
315
316Dnszoneprefix:: Optional. Add a prefix to the domain registration, like
317<hostname>.prefix.<domain>
318
319[[pvesdn_config_controllers]]
320Controllers
321-----------
322
323Some zone types need an external controller to manage the VNet control-plane.
324Currently this is only required for the `bgp-evpn` zone plugin.
325
326[[pvesdn_controller_plugin_evpn]]
327EVPN Controller
328~~~~~~~~~~~~~~~
329
330For `BGP-EVPN`, we need a controller to manage the control plane.
331The currently supported software controller is the "frr" router.
332You may need to install it on each node where you want to deploy EVPN zones.
333
334----
335apt install frr frr-pythontools
336----
337
338Configuration options:
339
340asn:: A unique BGP ASN number. It's highly recommended to use a private ASN
341 number (64512 – 65534, 4200000000 – 4294967294), as otherwise you could end up
342 breaking global routing by mistake.
343
344peers:: An IP list of all nodes where you want to communicate for the EVPN
345 (could also be external nodes or route reflectors servers)
346
347
348[[pvesdn_controller_plugin_BGP]]
349BGP Controller
350~~~~~~~~~~~~~~~
351
352The BGP controller is not used directly by a zone.
353You can use it to configure FRR to manage BGP peers.
354
355For BGP-EVPN, it can be used to define a different ASN by node, so doing EBGP.
356
357Configuration options:
358
359node:: The node of this BGP controller
360
361asn:: A unique BGP ASN number. It's highly recommended to use a private ASN
362 number in the range (64512 - 65534) or (4200000000 - 4294967294), as otherwise
363 you could break global routing by mistake.
364
365peers:: A list of peer IP addresses you want to communicate with using the
366 underlying BGP network.
367
368ebgp:: If your peer's remote-AS is different, this enables EBGP.
369
370loopback:: Use a loopback or dummy interface as the source of the EVPN network
371 (for multipath).
372
373ebgp-mutltihop:: Increase the number of hops to reach peers, in case they are
374 not directly connected or they use loopback.
375
376bgp-multipath-as-path-relax:: Allow ECMP if your peers have different ASN.
377
378[[pvesdn_config_ipam]]
379IPAMs
380-----
381
382IPAM (IP Address Management) tools are used to manage/assign the IP addresses of
383guests on the network. It can be used to find free IP addresses when you create
384a VM/CT for example (not yet implemented).
385
386An IPAM can be associated with one or more zones, to provide IP addresses
387for all subnets defined in those zones.
388
389[[pvesdn_ipam_plugin_pveipam]]
390{pve} IPAM Plugin
391~~~~~~~~~~~~~~~~~
392
393This is the default internal IPAM for your {pve} cluster, if you don't have
394external IPAM software.
395
396[[pvesdn_ipam_plugin_phpipam]]
397phpIPAM Plugin
398~~~~~~~~~~~~~~
399https://phpipam.net/
400
401You need to create an application in phpIPAM and add an API token with admin
402privileges.
403
404The phpIPAM configuration properties are:
405
406url:: The REST-API endpoint: `http://phpipam.domain.com/api/<appname>/`
407
408token:: An API access token
409
410section:: An integer ID. Sections are a group of subnets in phpIPAM. Default
411 installations use `sectionid=1` for customers.
412
413[[pvesdn_ipam_plugin_netbox]]
414NetBox IPAM Plugin
415~~~~~~~~~~~~~~~~~~
416
417NetBox is an IP address management (IPAM) and datacenter infrastructure
418management (DCIM) tool. See the source code repository for details:
419https://github.com/netbox-community/netbox
420
421You need to create an API token in NetBox to use it:
422https://netbox.readthedocs.io/en/stable/api/authentication
423
424The NetBox configuration properties are:
425
426url:: The REST API endpoint: `http://yournetbox.domain.com/api`
427
428token:: An API access token
429
430[[pvesdn_config_dns]]
431DNS
432---
433
434The DNS plugin in {pve} SDN is used to define a DNS API server for registration
435of your hostname and IP address. A DNS configuration is associated with one or
436more zones, to provide DNS registration for all the subnet IPs configured for
437a zone.
438
439[[pvesdn_dns_plugin_powerdns]]
440PowerDNS Plugin
441~~~~~~~~~~~~~~~
442https://doc.powerdns.com/authoritative/http-api/index.html
443
444You need to enable the web server and the API in your PowerDNS config:
445
446----
447api=yes
448api-key=arandomgeneratedstring
449webserver=yes
450webserver-port=8081
451----
452
453The PowerDNS configuration options are:
454
455url:: The REST API endpoint: http://yourpowerdnserver.domain.com:8081/api/v1/servers/localhost
456
457key:: An API access key
458
459ttl:: The default TTL for records
460
461
462Examples
463--------
464
465[[pvesdn_setup_example_vlan]]
466VLAN Setup Example
467~~~~~~~~~~~~~~~~~~
468
469TIP: While we show plaintext configuration content here, almost everything
470should be configurable using the web-interface only.
471
472Node1: /etc/network/interfaces
473
474----
475auto vmbr0
476iface vmbr0 inet manual
477 bridge-ports eno1
478 bridge-stp off
479 bridge-fd 0
480 bridge-vlan-aware yes
481 bridge-vids 2-4094
482
483#management ip on vlan100
484auto vmbr0.100
485iface vmbr0.100 inet static
486 address 192.168.0.1/24
487
488source /etc/network/interfaces.d/*
489----
490
491Node2: /etc/network/interfaces
492
493----
494auto vmbr0
495iface vmbr0 inet manual
496 bridge-ports eno1
497 bridge-stp off
498 bridge-fd 0
499 bridge-vlan-aware yes
500 bridge-vids 2-4094
501
502#management ip on vlan100
503auto vmbr0.100
504iface vmbr0.100 inet static
505 address 192.168.0.2/24
506
507source /etc/network/interfaces.d/*
508----
509
510Create a VLAN zone named `myvlanzone':
511
512----
513id: myvlanzone
514bridge: vmbr0
515----
516
517Create a VNet named `myvnet1' with `vlan-id` `10' and the previously created
518`myvlanzone' as its zone.
519
520----
521id: myvnet1
522zone: myvlanzone
523tag: 10
524----
525
526Apply the configuration through the main SDN panel, to create VNets locally on
527each node.
528
529Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
530
531Use the following network configuration for this VM:
532
533----
534auto eth0
535iface eth0 inet static
536 address 10.0.3.100/24
537----
538
539Create a second virtual machine (vm2) on node2, with a vNIC on the same VNet
540`myvnet1' as vm1.
541
542Use the following network configuration for this VM:
543
544----
545auto eth0
546iface eth0 inet static
547 address 10.0.3.101/24
548----
549
550Following this, you should be able to ping between both VMs over that network.
551
552
553[[pvesdn_setup_example_qinq]]
554QinQ Setup Example
555~~~~~~~~~~~~~~~~~~
556
557TIP: While we show plaintext configuration content here, almost everything
558should be configurable using the web-interface only.
559
560Node1: /etc/network/interfaces
561
562----
563auto vmbr0
564iface vmbr0 inet manual
565 bridge-ports eno1
566 bridge-stp off
567 bridge-fd 0
568 bridge-vlan-aware yes
569 bridge-vids 2-4094
570
571#management ip on vlan100
572auto vmbr0.100
573iface vmbr0.100 inet static
574 address 192.168.0.1/24
575
576source /etc/network/interfaces.d/*
577----
578
579Node2: /etc/network/interfaces
580
581----
582auto vmbr0
583iface vmbr0 inet manual
584 bridge-ports eno1
585 bridge-stp off
586 bridge-fd 0
587 bridge-vlan-aware yes
588 bridge-vids 2-4094
589
590#management ip on vlan100
591auto vmbr0.100
592iface vmbr0.100 inet static
593 address 192.168.0.2/24
594
595source /etc/network/interfaces.d/*
596----
597
598Create a QinQ zone named `qinqzone1' with service VLAN 20
599
600----
601id: qinqzone1
602bridge: vmbr0
603service vlan: 20
604----
605
606Create another QinQ zone named `qinqzone2' with service VLAN 30
607
608----
609id: qinqzone2
610bridge: vmbr0
611service vlan: 30
612----
613
614Create a VNet named `myvnet1' with customer VLAN-ID 100 on the previously
615created `qinqzone1' zone.
616
617----
618id: myvnet1
619zone: qinqzone1
620tag: 100
621----
622
623Create a `myvnet2' with customer VLAN-ID 100 on the previously created
624`qinqzone2' zone.
625
626----
627id: myvnet2
628zone: qinqzone2
629tag: 100
630----
631
632Apply the configuration on the main SDN web-interface panel to create VNets
633locally on each nodes.
634
635Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
636
637Use the following network configuration for this VM:
638
639----
640auto eth0
641iface eth0 inet static
642 address 10.0.3.100/24
643----
644
645Create a second virtual machine (vm2) on node2, with a vNIC on the same VNet
646`myvnet1' as vm1.
647
648Use the following network configuration for this VM:
649
650----
651auto eth0
652iface eth0 inet static
653 address 10.0.3.101/24
654----
655
656Create a third virtual machine (vm3) on node1, with a vNIC on the other VNet
657`myvnet2'.
658
659Use the following network configuration for this VM:
660
661----
662auto eth0
663iface eth0 inet static
664 address 10.0.3.102/24
665----
666
667Create another virtual machine (vm4) on node2, with a vNIC on the same VNet
668`myvnet2' as vm3.
669
670Use the following network configuration for this VM:
671
672----
673auto eth0
674iface eth0 inet static
675 address 10.0.3.103/24
676----
677
678Then, you should be able to ping between the VMs 'vm1' and 'vm2', as well as
679between 'vm3' and 'vm4'. However, neither of VMs 'vm1' or 'vm2' can ping VMs
680'vm3' or 'vm4', as they are on a different zone with a different service-vlan.
681
682
683[[pvesdn_setup_example_vxlan]]
684VXLAN Setup Example
685~~~~~~~~~~~~~~~~~~~
686
687TIP: While we show plaintext configuration content here, almost everything
688is configurable through the web-interface.
689
690node1: /etc/network/interfaces
691
692----
693auto vmbr0
694iface vmbr0 inet static
695 address 192.168.0.1/24
696 gateway 192.168.0.254
697 bridge-ports eno1
698 bridge-stp off
699 bridge-fd 0
700 mtu 1500
701
702source /etc/network/interfaces.d/*
703----
704
705node2: /etc/network/interfaces
706
707----
708auto vmbr0
709iface vmbr0 inet static
710 address 192.168.0.2/24
711 gateway 192.168.0.254
712 bridge-ports eno1
713 bridge-stp off
714 bridge-fd 0
715 mtu 1500
716
717source /etc/network/interfaces.d/*
718----
719
720node3: /etc/network/interfaces
721
722----
723auto vmbr0
724iface vmbr0 inet static
725 address 192.168.0.3/24
726 gateway 192.168.0.254
727 bridge-ports eno1
728 bridge-stp off
729 bridge-fd 0
730 mtu 1500
731
732source /etc/network/interfaces.d/*
733----
734
735Create a VXLAN zone named `myvxlanzone', using a lower MTU to ensure the extra
73650 bytes of the VXLAN header can fit. Add all previously configured IPs from
737the nodes to the peer address list.
738
739----
740id: myvxlanzone
741peers address list: 192.168.0.1,192.168.0.2,192.168.0.3
742mtu: 1450
743----
744
745Create a VNet named `myvnet1' using the VXLAN zone `myvxlanzone' created
746previously.
747
748----
749id: myvnet1
750zone: myvxlanzone
751tag: 100000
752----
753
754Apply the configuration on the main SDN web-interface panel to create VNets
755locally on each nodes.
756
757Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
758
759Use the following network configuration for this VM (note the lower MTU).
760
761----
762auto eth0
763iface eth0 inet static
764 address 10.0.3.100/24
765 mtu 1450
766----
767
768Create a second virtual machine (vm2) on node3, with a vNIC on the same VNet
769`myvnet1' as vm1.
770
771Use the following network configuration for this VM:
772
773----
774auto eth0
775iface eth0 inet static
776 address 10.0.3.101/24
777 mtu 1450
778----
779
780Then, you should be able to ping between between 'vm1' and 'vm2'.
781
782
783[[pvesdn_setup_example_evpn]]
784EVPN Setup Example
785~~~~~~~~~~~~~~~~~~
786
787node1: /etc/network/interfaces
788
789----
790auto vmbr0
791iface vmbr0 inet static
792 address 192.168.0.1/24
793 gateway 192.168.0.254
794 bridge-ports eno1
795 bridge-stp off
796 bridge-fd 0
797 mtu 1500
798
799source /etc/network/interfaces.d/*
800----
801
802node2: /etc/network/interfaces
803
804----
805auto vmbr0
806iface vmbr0 inet static
807 address 192.168.0.2/24
808 gateway 192.168.0.254
809 bridge-ports eno1
810 bridge-stp off
811 bridge-fd 0
812 mtu 1500
813
814source /etc/network/interfaces.d/*
815----
816
817node3: /etc/network/interfaces
818
819----
820auto vmbr0
821iface vmbr0 inet static
822 address 192.168.0.3/24
823 gateway 192.168.0.254
824 bridge-ports eno1
825 bridge-stp off
826 bridge-fd 0
827 mtu 1500
828
829source /etc/network/interfaces.d/*
830----
831
832Create an EVPN controller, using a private ASN number and the above node
833addresses as peers.
834
835----
836id: myevpnctl
837asn: 65000
838peers: 192.168.0.1,192.168.0.2,192.168.0.3
839----
840
841Create an EVPN zone named `myevpnzone', using the previously created
842EVPN-controller. Define 'node1' and 'node2' as exit nodes.
843
844----
845id: myevpnzone
846vrf vxlan tag: 10000
847controller: myevpnctl
848mtu: 1450
849vnet mac address: 32:F4:05:FE:6C:0A
850exitnodes: node1,node2
851----
852
853Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone'.
854----
855id: myvnet1
856zone: myevpnzone
857tag: 11000
858----
859
860Create a subnet 10.0.1.0/24 with 10.0.1.1 as gateway on `myvnet1`.
861
862----
863subnet: 10.0.1.0/24
864gateway: 10.0.1.1
865----
866
867Create the second VNet named `myvnet2' using the same EVPN zone `myevpnzone', a
868different IPv4 CIDR network.
869
870----
871id: myvnet2
872zone: myevpnzone
873tag: 12000
874----
875
876Create a different subnet 10.0.2.0/24 with 10.0.2.1 as gateway on vnet2
877
878----
879subnet: 10.0.2.0/24
880gateway: 10.0.2.1
881----
882
883
884Apply the configuration from the main SDN web-interface panel to create VNets
885locally on each node and generate the FRR config.
886
887Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
888
889Use the following network configuration for this VM:
890
891----
892auto eth0
893iface eth0 inet static
894 address 10.0.1.100/24
895 gateway 10.0.1.1 #this is the ip of the vnet1
896 mtu 1450
897----
898
899Create a second virtual machine (vm2) on node2, with a vNIC on the other VNet
900`myvnet2'.
901
902Use the following network configuration for this VM:
903
904----
905auto eth0
906iface eth0 inet static
907 address 10.0.2.100/24
908 gateway 10.0.2.1 #this is the ip of the myvnet2
909 mtu 1450
910----
911
912
913Then, you should be able to ping vm2 from vm1, and vm1 from vm2.
914
915If you ping an external IP from 'vm2' on the non-gateway 'node3', the packet
916will go to the configured 'myvnet2' gateway, then will be routed to the exit
917nodes ('node1' or 'node2') and from there it will leave those nodes over the
918default gateway configured on node1 or node2.
919
920NOTE: You need to add reverse routes for the '10.0.1.0/24' and '10.0.2.0/24'
921networks to node1 and node2 on your external gateway, so that the public network
922can reply back.
923
924If you have configured an external BGP router, the BGP-EVPN routes (10.0.1.0/24
925and 10.0.2.0/24 in this example), will be announced dynamically.
926
927
928Notes
929-----
930
931Multiple EVPN Exit Nodes
932~~~~~~~~~~~~~~~~~~~~~~~~
933
934If you have multiple gateway nodes, you should disable the `rp_filter` (Strict
935Reverse Path Filter) option, because packets can arrive at one node but go out
936from another node.
937
938.sysctl.conf disabling `rp_filter`
939-----
940net.ipv4.conf.default.rp_filter=0
941net.ipv4.conf.all.rp_filter=0
942-----
943
944VXLAN IPSEC Encryption
945~~~~~~~~~~~~~~~~~~~~~~
946
947If you need to add encryption on top of a VXLAN, it's possible to do so with
948IPSEC, through `strongswan`. You'll need to reduce the 'MTU' by 60 bytes (IPv4)
949or 80 bytes (IPv6) to handle encryption.
950
951So with default real 1500 MTU, you need to use a MTU of 1370 (1370 + 80 (IPSEC)
952+ 50 (VXLAN) == 1500).
953
954.Install strongswan
955----
956apt install strongswan
957----
958
959Add configuration to `/etc/ipsec.conf'. We only need to encrypt traffic from
960the VXLAN UDP port '4789'.
961
962----
963conn %default
964 ike=aes256-sha1-modp1024! # the fastest, but reasonably secure cipher on modern HW
965 esp=aes256-sha1!
966 leftfirewall=yes # this is necessary when using Proxmox VE firewall rules
967
968conn output
969 rightsubnet=%dynamic[udp/4789]
970 right=%any
971 type=transport
972 authby=psk
973 auto=route
974
975conn input
976 leftsubnet=%dynamic[udp/4789]
977 type=transport
978 authby=psk
979 auto=route
980----
981
982Then generate a pre-shared key with:
983
984----
985openssl rand -base64 128
986----
987
988and add the key to `/etc/ipsec.secrets', so that the file contents looks like:
989
990----
991: PSK <generatedbase64key>
992----
993
994You need to copy the PSK and the configuration onto the other nodes.