]> git.proxmox.com Git - pve-docs.git/blame - pvesdn.adoc
sdn: unify installing sdn and ifupdown2 in one command
[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
9f819242
TL
232Exit Nodes:: This is used if you want to define some proxmox nodes, as exit
233 gateway from evpn network through real network. The configured nodes will
234 announce a default route in the EVPN network.
a6af82c7 235
9f819242
TL
236MTU:: because VXLAN encapsulation use 50 bytes, the MTU needs to be 50 bytes
237 lower than the maximal MTU of the outgoing physical interface.
1556b768
AD
238
239
a6af82c7
AD
240[[pvesdn_config_vnet]]
241VNets
242-----
243
244A `VNet` is in its basic form just a Linux bridge that will be deployed locally
245on the node and used for Virtual Machine communication.
246
247VNet properties are:
248
249ID:: a 8 characters ID to name and identify a VNet
250
251Alias:: Optional longer name, if the ID isn't enough
252
253Zone:: The associated zone for this VNet
254
255Tag:: The unique VLAN or VXLAN id
256
257VLAN Aware:: Allow to add an extra VLAN tag in the virtual machine or
258 container vNIC configurations or allow the guest OS to manage the VLAN's tag.
259
260[[pvesdn_config_subnet]]
261
3093e62d
TL
262Sub-Nets
263~~~~~~~~
264
265A sub-network (subnet or sub-net) allows you to define a specific IP network
266(IPv4 or IPv6). For each VNET, you can define one or more subnets.
1556b768 267
3093e62d 268A subnet can be used to:
a6af82c7 269
3093e62d
TL
270* restrict IP-addresses you can define on a specific VNET
271* assign routes/gateway on a VNET in layer 3 zones
272* enable SNAT on a VNET in layer 3 zones
273* auto assign IPs on virtual guests (VM or CT) through IPAM plugin
274* DNS registration through DNS plugins
a6af82c7 275
3093e62d
TL
276If an IPAM server is associated to the subnet zone, the subnet prefix will be
277automatically registered in the IPAM.
a6af82c7
AD
278
279
280Subnet properties are:
281
282ID:: a cidr network address. Ex: 10.0.0.0/8
283
284Gateway:: ip address for the default gateway of the network.
3093e62d
TL
285 On layer3 zones (simple/evpn plugins), it'll be deployed on the vnet.
286
a6af82c7 287Snat:: Optional, Enable Snat for layer3 zones (simple/evpn plugins) for this subnet.
3093e62d
TL
288 The subnet source ip will be natted to server outgoing interface/ip.
289 On evpn zone, it's done only on evpn gateway-nodes.
a6af82c7
AD
290
291Dnszoneprefix:: Optional, add a prefix to domain registration, like <hostname>.prefix.<domain>
292
293
a6af82c7
AD
294[[pvesdn_config_controllers]]
295Controllers
296-----------
297
298Some zone types need an external controller to manage the VNet control-plane.
299Currently this is only required for the `bgp-evpn` zone plugin.
8ac25ffe 300
4e652aba 301[[pvesdn_controller_plugin_evpn]]
ee6e18c4
TL
302EVPN Controller
303~~~~~~~~~~~~~~~
1556b768 304
ee6e18c4
TL
305For `BGP-EVPN`, we need a controller to manage the control plane.
306The currently supported software controller is the "frr" router.
307You may need to install it on each node where you want to deploy EVPN zones.
1556b768
AD
308
309----
a6af82c7 310apt install frr frr-pythontools
1556b768
AD
311----
312
ee6e18c4 313Configuration options:
1556b768 314
4e652aba 315asn:: A unique BGP ASN number. It's highly recommended to use private ASN
ee6e18c4
TL
316number (64512 – 65534, 4200000000 – 4294967294), as else you could end up
317breaking, or get broken, by global routing by mistake.
1556b768 318
a6af82c7 319peers:: An ip list of all nodes where you want to communicate for the EVPN (could be also
ee6e18c4 320external nodes or route reflectors servers)
1556b768 321
1556b768 322
a6af82c7
AD
323[[pvesdn_controller_plugin_BGP]]
324BGP Controller
325~~~~~~~~~~~~~~~
1556b768 326
a6af82c7
AD
327The bgp controller is not used directly by a zone.
328You can used it to configure frr to manage bgp peers.
1556b768 329
3093e62d 330For BGP-evpn, it can be use to define a different ASN by node, so doing EBGP.
1556b768 331
a6af82c7 332Configuration options:
1556b768 333
9a4f3c95
AD
334node:: The node of this BGP controller
335
a6af82c7 336asn:: A unique BGP ASN number. It's highly recommended to use private ASN
3093e62d
TL
337 number from the range (64512 - 65534) or (4200000000 - 4294967294), as else
338 you could end up breaking, or get broken, by global routing by mistake.
a6af82c7 339
3093e62d
TL
340peers:: An IP list of peers you want to communicate with for the underlying
341 BGP network.
a6af82c7 342
3093e62d 343ebgp:: If your peer's remote-AS is different, it's enabling EBGP.
a6af82c7 344
3093e62d
TL
345loopback:: If you want to use a loopback or dummy interface as source for the
346 evpn network. (for multipath)
a6af82c7 347
9a4f3c95
AD
348ebgp-mutltihop:: if the peers are not directly connected or use loopback, you can increase the
349 number of hops to reach them.
a6af82c7
AD
350
351[[pvesdn_config_ipam]]
3093e62d 352IPAMs
a6af82c7
AD
353-----
354IPAM (IP address management) tools, are used to manage/assign ips on your devices on the network.
355It can be used to find free ip address when you create a vm/ct for example (not yet implemented).
356
357An IPAM is associated to 1 or multiple zones, to provide ip addresses for all subnets defined in this zone.
358
359
360[[pvesdn_ipam_plugin_pveipam]]
3093e62d
TL
361{pve} IPAM plugin
362~~~~~~~~~~~~~~~~~
a6af82c7 363
3093e62d
TL
364This is the default internal IPAM for your proxmox cluster if you don't have
365external ipam software
a6af82c7
AD
366
367[[pvesdn_ipam_plugin_phpipam]]
3093e62d 368phpIPAM plugin
a6af82c7
AD
369~~~~~~~~~~~~~~
370https://phpipam.net/
371
3093e62d
TL
372You need to create an application in phpipam, and add an api token with admin
373permission
a6af82c7 374
3093e62d 375phpIPAM properties are:
a6af82c7 376
3093e62d
TL
377url:: The REST-API endpoint: `http://phpipam.domain.com/api/<appname>/`
378token:: An API access token
379section:: An integer ID. Sections are group of subnets in phpIPAM. Default
380 installations use `sectionid=1` for customers.
a6af82c7
AD
381
382[[pvesdn_ipam_plugin_netbox]]
3093e62d 383Netbox IPAM plugin
a6af82c7 384~~~~~~~~~~~~~~~~~~
3093e62d
TL
385
386NetBox is an IP address management (IPAM) and data center infrastructure
387management (DCIM) tool, see the source code repository for details:
a6af82c7
AD
388https://github.com/netbox-community/netbox
389
3093e62d 390You need to create an api token in netbox
a6af82c7
AD
391https://netbox.readthedocs.io/en/stable/api/authentication
392
3093e62d 393NetBox properties are:
a6af82c7 394
3093e62d
TL
395url:: The REST API endpoint: `http://yournetbox.domain.com/api`
396token:: An API access token
a6af82c7
AD
397
398[[pvesdn_config_dns]]
3093e62d 399DNS
a6af82c7 400---
3093e62d
TL
401
402The DNS plugin in {pve} SDN is used to define a DNS API server for registration
403of your hostname and IP-address. A DNS configuration is associated with one or
404more zones, to provide DNS registration for all the sub-net IPs configured for
405a zone.
a6af82c7
AD
406
407[[pvesdn_dns_plugin_powerdns]]
3093e62d 408PowerDNS plugin
a6af82c7
AD
409~~~~~~~~~~~~~~~
410https://doc.powerdns.com/authoritative/http-api/index.html
411
3093e62d 412You need to enable the webserver and the API in your PowerDNS config:
1556b768 413
40f4dfc2 414----
a6af82c7
AD
415api=yes
416api-key=arandomgeneratedstring
417webserver=yes
418webserver-port=8081
40f4dfc2 419----
40f4dfc2 420
a6af82c7
AD
421Powerdns properties are:
422
3093e62d
TL
423url:: The REST API endpoint: http://yourpowerdnserver.domain.com:8081/api/v1/servers/localhost
424key:: An API access key
425ttl:: The default TTL for records
1556b768 426
1556b768 427
a6af82c7
AD
428Examples
429--------
430
4e652aba 431[[pvesdn_setup_example_vlan]]
ee6e18c4 432VLAN Setup Example
a6af82c7 433~~~~~~~~~~~~~~~~~~
1556b768 434
ee6e18c4
TL
435TIP: While we show plain configuration content here, almost everything should
436be configurable using the web-interface only.
437
438Node1: /etc/network/interfaces
1556b768 439
1556b768
AD
440----
441auto vmbr0
442iface vmbr0 inet manual
ee6e18c4
TL
443 bridge-ports eno1
444 bridge-stp off
445 bridge-fd 0
1556b768
AD
446 bridge-vlan-aware yes
447 bridge-vids 2-4094
448
449#management ip on vlan100
450auto vmbr0.100
451iface vmbr0.100 inet static
452 address 192.168.0.1/24
453
454source /etc/network/interfaces.d/*
1556b768
AD
455----
456
ee6e18c4 457Node2: /etc/network/interfaces
1556b768
AD
458
459----
460auto vmbr0
461iface vmbr0 inet manual
ee6e18c4
TL
462 bridge-ports eno1
463 bridge-stp off
464 bridge-fd 0
1556b768
AD
465 bridge-vlan-aware yes
466 bridge-vids 2-4094
467
468#management ip on vlan100
469auto vmbr0.100
470iface vmbr0.100 inet static
471 address 192.168.0.2/24
472
473source /etc/network/interfaces.d/*
474----
475
ee6e18c4 476Create a VLAN zone named `myvlanzone':
1556b768
AD
477
478----
ee6e18c4 479id: myvlanzone
1556b768
AD
480bridge: vmbr0
481----
482
ee6e18c4
TL
483Create a VNet named `myvnet1' with `vlan-id` `10' and the previously created
484`myvlanzone' as it's zone.
1556b768
AD
485
486----
487id: myvnet1
488zone: myvlanzone
489tag: 10
490----
491
ee6e18c4
TL
492Apply the configuration through the main SDN panel, to create VNets locally on
493each nodes.
1556b768 494
ee6e18c4 495Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
1556b768 496
ee6e18c4 497Use the following network configuration for this VM:
1556b768
AD
498
499----
500auto eth0
501iface eth0 inet static
ee6e18c4 502 address 10.0.3.100/24
1556b768
AD
503----
504
ee6e18c4
TL
505Create a second Virtual Machine (vm2) on node2, with a vNIC on the same VNet
506`myvnet1' as vm1.
507
508Use the following network configuration for this VM:
509
1556b768
AD
510----
511auto eth0
512iface eth0 inet static
ee6e18c4 513 address 10.0.3.101/24
1556b768
AD
514----
515
ee6e18c4 516Then, you should be able to ping between both VMs over that network.
1556b768
AD
517
518
4e652aba
TL
519[[pvesdn_setup_example_qinq]]
520QinQ Setup Example
a6af82c7 521~~~~~~~~~~~~~~~~~~
ee6e18c4
TL
522
523TIP: While we show plain configuration content here, almost everything should
524be configurable using the web-interface only.
525
526Node1: /etc/network/interfaces
527
1556b768
AD
528----
529auto vmbr0
530iface vmbr0 inet manual
ee6e18c4
TL
531 bridge-ports eno1
532 bridge-stp off
533 bridge-fd 0
1556b768
AD
534 bridge-vlan-aware yes
535 bridge-vids 2-4094
536
537#management ip on vlan100
538auto vmbr0.100
539iface vmbr0.100 inet static
540 address 192.168.0.1/24
541
542source /etc/network/interfaces.d/*
543----
544
ee6e18c4 545Node2: /etc/network/interfaces
1556b768
AD
546
547----
548auto vmbr0
549iface vmbr0 inet manual
ee6e18c4
TL
550 bridge-ports eno1
551 bridge-stp off
552 bridge-fd 0
1556b768
AD
553 bridge-vlan-aware yes
554 bridge-vids 2-4094
555
556#management ip on vlan100
557auto vmbr0.100
558iface vmbr0.100 inet static
559 address 192.168.0.2/24
560
561source /etc/network/interfaces.d/*
562----
563
ee6e18c4 564Create an QinQ zone named `qinqzone1' with service VLAN 20
1556b768
AD
565
566----
567id: qinqzone1
568bridge: vmbr0
569service vlan: 20
570----
571
ee6e18c4 572Create another QinQ zone named `qinqzone2' with service VLAN 30
1556b768
AD
573
574----
575id: qinqzone2
576bridge: vmbr0
577service vlan: 30
578----
579
ee6e18c4
TL
580Create a VNet named `myvnet1' with customer vlan-id 100 on the previously
581created `qinqzone1' zone.
1556b768
AD
582
583----
584id: myvnet1
585zone: qinqzone1
586tag: 100
587----
588
ee6e18c4
TL
589Create a `myvnet2' with customer VLAN-id 100 on the previously created
590`qinqzone2' zone.
1556b768
AD
591
592----
593id: myvnet2
99a0bbe4 594zone: qinqzone2
1556b768
AD
595tag: 100
596----
597
ee6e18c4
TL
598Apply the configuration on the main SDN web-interface panel to create VNets
599locally on each nodes.
1556b768 600
ee6e18c4 601Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
1556b768 602
ee6e18c4 603Use the following network configuration for this VM:
1556b768
AD
604
605----
606auto eth0
607iface eth0 inet static
608 address 10.0.3.100/24
609----
610
ee6e18c4
TL
611Create a second Virtual Machine (vm2) on node2, with a vNIC on the same VNet
612`myvnet1' as vm1.
613
614Use the following network configuration for this VM:
615
1556b768
AD
616----
617auto eth0
618iface eth0 inet static
619 address 10.0.3.101/24
620----
621
ee6e18c4
TL
622Create a third Virtual Machine (vm3) on node1, with a vNIC on the other VNet
623`myvnet2'.
624
625Use the following network configuration for this VM:
1556b768
AD
626
627----
628auto eth0
629iface eth0 inet static
630 address 10.0.3.102/24
631----
632
ee6e18c4
TL
633Create another Virtual Machine (vm4) on node2, with a vNIC on the same VNet
634`myvnet2' as vm3.
635
636Use the following network configuration for this VM:
637
1556b768
AD
638----
639auto eth0
640iface eth0 inet static
641 address 10.0.3.103/24
642----
643
ee6e18c4
TL
644Then, you should be able to ping between the VMs 'vm1' and 'vm2', also
645between 'vm3' and 'vm4'. But, none of VMs 'vm1' or 'vm2' can ping the VMs 'vm3'
646or 'vm4', as they are on a different zone with different service-vlan.
1556b768 647
1556b768 648
4e652aba 649[[pvesdn_setup_example_vxlan]]
ee6e18c4 650VXLAN Setup Example
a6af82c7 651~~~~~~~~~~~~~~~~~~~
ee6e18c4 652
4e652aba
TL
653TIP: While we show plain configuration content here, almost everything should
654be configurable using the web-interface only.
655
1556b768 656node1: /etc/network/interfaces
ee6e18c4 657
1556b768
AD
658----
659auto vmbr0
660iface vmbr0 inet static
661 address 192.168.0.1/24
662 gateway 192.168.0.254
ee6e18c4
TL
663 bridge-ports eno1
664 bridge-stp off
665 bridge-fd 0
1556b768
AD
666 mtu 1500
667
668source /etc/network/interfaces.d/*
669----
670
671node2: /etc/network/interfaces
672
673----
674auto vmbr0
675iface vmbr0 inet static
676 address 192.168.0.2/24
677 gateway 192.168.0.254
ee6e18c4
TL
678 bridge-ports eno1
679 bridge-stp off
680 bridge-fd 0
1556b768
AD
681 mtu 1500
682
683source /etc/network/interfaces.d/*
684----
685
686node3: /etc/network/interfaces
687
688----
689auto vmbr0
690iface vmbr0 inet static
691 address 192.168.0.3/24
692 gateway 192.168.0.254
ee6e18c4
TL
693 bridge-ports eno1
694 bridge-stp off
695 bridge-fd 0
1556b768
AD
696 mtu 1500
697
698source /etc/network/interfaces.d/*
699----
700
ee6e18c4
TL
701Create an VXLAN zone named `myvxlanzone', use the lower MTU to ensure the extra
70250 bytes of the VXLAN header can fit. Add all previously configured IPs from
703the nodes as peer address list.
1556b768
AD
704
705----
706id: myvxlanzone
707peers address list: 192.168.0.1,192.168.0.2,192.168.0.3
708mtu: 1450
709----
710
ee6e18c4
TL
711Create a VNet named `myvnet1' using the VXLAN zone `myvxlanzone' created
712previously.
1556b768
AD
713
714----
715id: myvnet1
716zone: myvxlanzone
717tag: 100000
718----
719
ee6e18c4
TL
720Apply the configuration on the main SDN web-interface panel to create VNets
721locally on each nodes.
1556b768 722
ee6e18c4 723Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
1556b768 724
ee6e18c4 725Use the following network configuration for this VM, note the lower MTU here.
1556b768
AD
726
727----
728auto eth0
729iface eth0 inet static
730 address 10.0.3.100/24
731 mtu 1450
732----
733
ee6e18c4
TL
734Create a second Virtual Machine (vm2) on node3, with a vNIC on the same VNet
735`myvnet1' as vm1.
736
737Use the following network configuration for this VM:
738
1556b768
AD
739----
740auto eth0
741iface eth0 inet static
742 address 10.0.3.101/24
743 mtu 1450
744----
745
ee6e18c4 746Then, you should be able to ping between between 'vm1' and 'vm2'.
1556b768
AD
747
748
4e652aba
TL
749[[pvesdn_setup_example_evpn]]
750EVPN Setup Example
a6af82c7 751~~~~~~~~~~~~~~~~~~
ee6e18c4 752
1556b768
AD
753node1: /etc/network/interfaces
754
755----
756auto vmbr0
757iface vmbr0 inet static
758 address 192.168.0.1/24
759 gateway 192.168.0.254
760 bridge-ports eno1
761 bridge-stp off
762 bridge-fd 0
763 mtu 1500
764
765source /etc/network/interfaces.d/*
766----
767
768node2: /etc/network/interfaces
769
770----
771auto vmbr0
772iface vmbr0 inet static
773 address 192.168.0.2/24
774 gateway 192.168.0.254
775 bridge-ports eno1
776 bridge-stp off
777 bridge-fd 0
778 mtu 1500
779
780source /etc/network/interfaces.d/*
781----
782
783node3: /etc/network/interfaces
784
785----
786auto vmbr0
787iface vmbr0 inet static
788 address 192.168.0.3/24
789 gateway 192.168.0.254
790 bridge-ports eno1
791 bridge-stp off
792 bridge-fd 0
793 mtu 1500
794
795source /etc/network/interfaces.d/*
796----
797
ee6e18c4 798Create a EVPN controller, using a private ASN number and above node addreesses
a6af82c7 799as peers.
1556b768
AD
800
801----
802id: myevpnctl
803asn: 65000
804peers: 192.168.0.1,192.168.0.2,192.168.0.3
1556b768
AD
805----
806
ee6e18c4 807Create an EVPN zone named `myevpnzone' using the previously created
a6af82c7
AD
808EVPN-controller Define 'node1' and 'node2' as exit nodes.
809
1556b768
AD
810----
811id: myevpnzone
812vrf vxlan tag: 10000
813controller: myevpnctl
814mtu: 1450
9a4f3c95 815vnet mac address: 32:F4:05:FE:6C:0A
a6af82c7 816exitnodes: node1,node2
1556b768
AD
817----
818
a6af82c7 819Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone'.
1556b768
AD
820----
821id: myvnet1
822zone: myevpnzone
823tag: 11000
1556b768
AD
824----
825
9a4f3c95 826Create a subnet 10.0.1.0/24 with 10.0.1.1 as gateway on vnet1
9f819242 827
a6af82c7 828----
9a4f3c95 829subnet: 10.0.1.0/24
a6af82c7
AD
830gateway: 10.0.1.1
831----
832
ee6e18c4 833Create the second VNet named `myvnet2' using the same EVPN zone `myevpnzone', a
9a4f3c95 834different IPv4 CIDR network.
1556b768
AD
835
836----
837id: myvnet2
838zone: myevpnzone
839tag: 12000
1556b768
AD
840----
841
9a4f3c95 842Create a different subnet 10.0.2.0/24 with 10.0.2.1 as gateway on vnet2
9f819242 843
a6af82c7 844----
9a4f3c95 845subnet: 10.0.2.0/24
a6af82c7
AD
846gateway: 10.0.2.1
847----
848
849
ee6e18c4
TL
850Apply the configuration on the main SDN web-interface panel to create VNets
851locally on each nodes and generate the FRR config.
1556b768 852
ee6e18c4 853Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
1556b768 854
ee6e18c4 855Use the following network configuration for this VM:
1556b768
AD
856
857----
858auto eth0
859iface eth0 inet static
860 address 10.0.1.100/24
861 gateway 10.0.1.1 #this is the ip of the vnet1
862 mtu 1450
863----
864
ee6e18c4
TL
865Create a second Virtual Machine (vm2) on node2, with a vNIC on the other VNet
866`myvnet2'.
867
868Use the following network configuration for this VM:
869
1556b768
AD
870----
871auto eth0
872iface eth0 inet static
873 address 10.0.2.100/24
874 gateway 10.0.2.1 #this is the ip of the vnet2
875 mtu 1450
876----
877
878
879Then, you should be able to ping vm2 from vm1, and vm1 from vm2.
880
ee6e18c4 881If you ping an external IP from 'vm2' on the non-gateway 'node3', the packet
a6af82c7 882will go to the configured 'myvnet2' gateway, then will be routed to the exit
ee6e18c4
TL
883nodes ('node1' or 'node2') and from there it will leave those nodes over the
884default gateway configured on node1 or node2.
1556b768 885
ee6e18c4
TL
886NOTE: Of course you need to add reverse routes for the '10.0.1.0/24' and
887'10.0.2.0/24' network to node1, node2 on your external gateway, so that the
888public network can reply back.
1556b768 889
ee6e18c4
TL
890If you have configured an external BGP router, the BGP-EVPN routes (10.0.1.0/24
891and 10.0.2.0/24 in this example), will be announced dynamically.