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