2020-03-12 11:36:07 +03:00
[[chapter_pvesdn]]
Software Defined Network
========================
ifndef::manvolnum[]
:pve-toplevel:
endif::manvolnum[]
2022-04-08 17:13:42 +03:00
The **S**oftware **D**efined **N**etwork (SDN) feature allows you to create
virtual networks (VNets) at the datacenter level.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
WARNING: SDN is currently an **experimental feature** in {pve}. This
2022-04-08 17:13:42 +03:00
documentation for it is also still under development. Ask on our
2020-05-10 20:43:36 +03:00
xref:getting_help[mailing lists or in the forum] for questions and feedback.
2020-05-10 21:09:52 +03:00
[[pvesdn_installation]]
2020-05-10 20:43:36 +03:00
Installation
------------
2022-04-08 17:13:42 +03:00
To enable the experimental Software Defined Network (SDN) integration, you need
to install the `libpve-network-perl` and `ifupdown2` packages on every node:
2020-03-12 11:36:07 +03:00
----
2021-05-05 10:06:55 +03:00
apt update
apt install libpve-network-perl ifupdown2
2020-03-12 11:36:07 +03:00
----
2022-04-08 17:13:42 +03:00
NOTE: {pve} version 7 and above come installed with ifupdown2.
After this, you need to add the following line to the end of the
`/etc/network/interfaces` configuration file, so that the SDN configuration gets
included and activated.
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
----
source /etc/network/interfaces.d/*
----
2020-05-10 20:43:36 +03:00
Basic Overview
--------------
2022-04-08 17:13:42 +03:00
The {pve} SDN allows for separation and fine-grained control of virtual guest
networks, using flexible, software-controlled configurations.
2020-05-10 20:43:36 +03:00
2022-04-08 17:13:42 +03:00
Separation is managed through zones, where a zone is its own virtual separated
network area. A 'VNet' is a type of a virtual network connected to a zone.
Depending on which type or plugin the zone uses, it can behave differently and
offer different features, advantages, and disadvantages. Normally, a 'VNet'
appears as a common Linux bridge with either a VLAN or 'VXLAN' tag, however,
some can also use layer 3 routing for control. 'VNets' are deployed locally on
each node, after being configured from the cluster-wide datacenter SDN
administration interface.
2020-05-10 20:43:36 +03:00
2022-04-08 17:13:42 +03:00
Main Configuration
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Configuration is done at the datacenter (cluster-wide) level and is saved in
files located in the shared configuration file system:
2020-05-10 20:43:36 +03:00
`/etc/pve/sdn`
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
On the web-interface, SDN features 3 main sections:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* SDN: An overview of the SDN state
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* Zones: Create and manage the virtually separated network zones
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* VNets: Create virtual network bridges and manage subnets
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
In addition to this, the following options are offered:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* Controller: For controlling layer 3 routing in complex setups
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* Subnets: Used to defined IP networks on VNets
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
* IPAM: Enables the use of external tools for IP address management (guest
IPs)
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
* DNS: Define a DNS server API for registering virtual guests' hostname and IP
addresses
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_config_main_sdn]]
2020-11-27 16:21:00 +03:00
2020-03-12 11:36:07 +03:00
SDN
~~~
2022-04-08 17:13:42 +03:00
This is the main status panel. Here you can see the deployment status of zones
on different nodes.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
The 'Apply' button is used to push and reload local configuration on all cluster
nodes.
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
[[pvesdn_local_deployment_monitoring]]
Local Deployment Monitoring
~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-04-08 17:13:42 +03:00
After applying the configuration through the main SDN panel,
2020-11-27 16:21:00 +03:00
the local network configuration is generated locally on each node in
2022-04-08 17:13:42 +03:00
the file `/etc/network/interfaces.d/sdn`, and reloaded with ifupdown2.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
You can monitor the status of local zones and VNets through the main tree.
2020-11-27 16:21:00 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_config_zone]]
2020-03-12 11:36:07 +03:00
Zones
2020-11-27 16:21:00 +03:00
-----
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
A zone defines a virtually separated network. Zones can be restricted to
specific nodes and assigned permissions, in order to restrict users to a certain
zone and its contained VNets.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Different technologies can be used for separation:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* VLAN: Virtual LANs are the classic method of subdividing a LAN
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* QinQ: Stacked VLAN (formally known as `IEEE 802.1ad`)
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* VXLAN: Layer2 VXLAN
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
* Simple: Isolated Bridge. A simple layer 3 routing bridge (NAT)
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
* EVPN (BGP EVPN): VXLAN using layer 3 border gateway protocol (BGP) routing
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
Common options
~~~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
The following options are available for all zone types:
2021-04-26 18:37:28 +03:00
2022-04-08 17:13:42 +03:00
nodes:: The nodes which the zone and associated VNets should be deployed on
2020-06-03 15:46:44 +03:00
2022-04-08 17:13:42 +03:00
ipam:: Optional. Use an IP Address Management (IPAM) tool to manage IPs in the
zone.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
dns:: Optional. DNS API server.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
reversedns:: Optional. Reverse DNS API server.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
dnszone:: Optional. DNS domain name. Used to register hostnames, such as
`<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
[[pvesdn_zone_plugin_simple]]
Simple Zones
~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
This is the simplest plugin. It will create an isolated VNet bridge.
This bridge is not linked to a physical interface, and VM traffic is only
local between the node(s).
It can also be used in NAT or routed setups.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_zone_plugin_vlan]]
2020-05-10 20:43:36 +03:00
VLAN Zones
~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
This plugin reuses an existing local Linux or OVS bridge, and manages the VLANs
on it. The benefit of using the SDN module is that you can create different
zones with specific VNet VLAN tags, and restrict virtual machines to separated
zones.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Specific `VLAN` configuration options:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
bridge:: Reuse this local bridge or OVS switch, already configured on *each*
local node.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_zone_plugin_qinq]]
2020-05-10 20:43:36 +03:00
QinQ Zones
~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
QinQ also known as VLAN stacking, wherein the first VLAN tag is defined for the
zone (the 'service-vlan'), and the second VLAN tag is defined for the
VNets.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
NOTE: Your physical network switches must support stacked VLANs for this
configuration!
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Below are the configuration options specific to QinQ:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
bridge:: A local, VLAN-aware bridge that is already configured on each local
node
2020-05-10 21:09:52 +03:00
service vlan:: The main VLAN tag of this zone
2022-04-08 17:13:42 +03:00
service vlan protocol:: Allows you to choose between an 802.1q (default) or
802.1ad service VLAN type.
2021-04-30 00:58:40 +03:00
2022-04-08 17:13:42 +03:00
mtu:: Due to the double stacking of tags, you need 4 more bytes for QinQ VLANs.
For example, you must reduce the MTU to `1496` if you physical interface MTU is
`1500`.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_zone_plugin_vxlan]]
2020-05-10 20:43:36 +03:00
VXLAN Zones
~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
The VXLAN plugin establishes a tunnel (overlay) on top of an existing
network (underlay). This encapsulates layer 2 Ethernet frames within layer
2020-05-10 20:43:36 +03:00
4 UDP datagrams, using `4789` as the default destination port. You can, for
example, create a private IPv4 VXLAN network on top of public internet network
nodes.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
This is a layer 2 tunnel only, so no routing between different VNets is
possible.
Each VNet will have a specific VXLAN ID in the range 1 - 16777215.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Specific EVPN configuration options:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
peers address list:: A list of IP addresses from each node through which you
want to communicate. Can also be external nodes.
2020-05-10 21:09:52 +03:00
2022-04-08 17:13:42 +03:00
mtu:: Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes
lower than the outgoing physical interface.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_zone_plugin_evpn]]
2020-05-10 20:43:36 +03:00
EVPN Zones
~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
This is the most complex of all the supported plugins.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
BGP-EVPN allows you to create a routable layer 3 network. The VNet of EVPN can
have an anycast IP address and/or MAC address. The bridge IP is the same on each
node, meaning a virtual guest can use this address as gateway.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Routing can work across VNets from different zones through a VRF (Virtual
Routing and Forwarding) interface.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
The configuration options specific to EVPN are as follows:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
VRF VXLAN tag:: This is a VXLAN-ID used for routing interconnect between VNets.
It must be different than the VXLAN-ID of the VNets.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
controller:: An EVPN-controller must to be defined first (see controller plugins
section).
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
VNet MAC address:: A unique, anycast MAC address for all VNets in this zone.
2021-05-05 10:06:37 +03:00
Will be auto-generated if not defined.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
Exit Nodes:: Optional. This is used if you want to define some {pve} nodes as
exit gateways from the EVPN network, through the real network. The configured
nodes will announce a default route in the EVPN network.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
Primary Exit Node:: Optional. If you use multiple exit nodes, this forces
traffic to a primary exit node, instead of load-balancing on all nodes. This
is required if you want to use SNAT or if your upstream router doesn't support
ECMP.
2022-02-11 12:34:17 +03:00
Exit Nodes local routing:: Optional. This is a special option if you need to
2022-04-08 17:13:42 +03:00
reach a VM/CT service from an exit node. (By default, the exit nodes only
allow forwarding traffic between real network and EVPN network).
2022-02-11 12:34:17 +03:00
2022-04-08 17:13:42 +03:00
Advertise Subnets:: Optional. If you have silent VMs/CTs (for example, if you
have multiple IPs and the anycast gateway doesn't see traffic from theses IPs,
the IP addresses won't be able to be reach inside the EVPN network). This
option will announce the full subnet in the EVPN network in this case.
2021-09-06 06:57:19 +03:00
2022-04-08 17:13:42 +03:00
Disable Arp-Nd Suppression:: Optional. Don't suppress ARP or ND packets.
This is required if you use floating IPs in your guest VMs
(IP are MAC addresses are being moved between systems).
2022-02-11 12:34:17 +03:00
2022-04-08 17:13:42 +03:00
Route-target import:: Optional. Allows you to import a list of external EVPN
route targets. Used for cross-DC or different EVPN network interconnects.
2021-09-06 06:57:19 +03:00
2022-04-08 17:13:42 +03:00
MTU:: Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes
less than the maximal MTU of the outgoing physical interface.
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
[[pvesdn_config_vnet]]
VNets
-----
2022-04-08 17:13:42 +03:00
A `VNet` is, in its basic form, a Linux bridge that will be deployed locally on
the node and used for virtual machine communication.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
The VNet configuration properties are:
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
ID:: An 8 character ID to name and identify a VNet
2020-11-27 16:21:00 +03:00
Alias:: Optional longer name, if the ID isn't enough
Zone:: The associated zone for this VNet
2022-04-08 17:13:42 +03:00
Tag:: The unique VLAN or VXLAN ID
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
VLAN Aware:: Enable adding an extra VLAN tag in the virtual machine or
container's vNIC configuration, to allow the guest OS to manage the VLAN's tag.
2020-11-27 16:21:00 +03:00
[[pvesdn_config_subnet]]
2022-04-08 17:13:42 +03:00
Subnets
2021-04-26 18:37:28 +03:00
~~~~~~~~
2022-04-08 17:13:42 +03:00
A subnetwork (subnet) allows you to define a specific IP network
(IPv4 or IPv6). For each VNet, you can define one or more subnets.
2020-03-12 11:36:07 +03:00
2021-04-26 18:37:28 +03:00
A subnet can be used to:
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
* Restrict the IP addresses you can define on a specific VNet
* Assign routes/gateways on a VNet in layer 3 zones
* Enable SNAT on a VNet in layer 3 zones
* Auto assign IPs on virtual guests (VM or CT) through IPAM plugins
2021-04-26 18:37:28 +03:00
* DNS registration through DNS plugins
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
If an IPAM server is associated with the subnet zone, the subnet prefix will be
2021-04-26 18:37:28 +03:00
automatically registered in the IPAM.
2020-11-27 16:21:00 +03:00
Subnet properties are:
2022-04-08 17:13:42 +03:00
ID:: A CIDR network address, for example 10.0.0.0/8
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
Gateway:: The IP address of the network's default gateway. On layer 3 zones
(Simple/EVPN plugins), it will be deployed on the VNet.
2021-04-26 18:37:28 +03:00
2022-04-08 17:13:42 +03:00
SNAT:: Optional. Enable SNAT for layer 3 zones (Simple/EVPN plugins), for this
subnet. The subnet's source IP will be NATted to server's outgoing interface/IP.
On EVPN zones, this is only done on EVPN gateway-nodes.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
Dnszoneprefix:: Optional. Add a prefix to the domain registration, like
<hostname>.prefix.<domain>
2020-11-27 16:21:00 +03:00
[[pvesdn_config_controllers]]
Controllers
-----------
Some zone types need an external controller to manage the VNet control-plane.
Currently this is only required for the `bgp-evpn` zone plugin.
2020-05-10 21:20:41 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_controller_plugin_evpn]]
2020-05-10 20:43:36 +03:00
EVPN Controller
~~~~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
For `BGP-EVPN`, we need a controller to manage the control plane.
The currently supported software controller is the "frr" router.
You may need to install it on each node where you want to deploy EVPN zones.
2020-03-12 11:36:07 +03:00
----
2020-11-27 16:21:00 +03:00
apt install frr frr-pythontools
2020-03-12 11:36:07 +03:00
----
2020-05-10 20:43:36 +03:00
Configuration options:
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
asn:: A unique BGP ASN number. It's highly recommended to use a private ASN
number (64512 – 65534, 4200000000 – 4294967294), as otherwise you could end up
breaking global routing by mistake.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
peers:: An IP list of all nodes where you want to communicate for the EVPN
(could also be external nodes or route reflectors servers)
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
[[pvesdn_controller_plugin_BGP]]
BGP Controller
~~~~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
The BGP controller is not used directly by a zone.
You can use it to configure FRR to manage BGP peers.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
For BGP-EVPN, it can be used to define a different ASN by node, so doing EBGP.
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
Configuration options:
2020-03-12 11:36:07 +03:00
2021-04-30 00:58:40 +03:00
node:: The node of this BGP controller
2022-04-08 17:13:42 +03:00
asn:: A unique BGP ASN number. It's highly recommended to use a private ASN
number in the range (64512 - 65534) or (4200000000 - 4294967294), as otherwise
you could break global routing by mistake.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
peers:: A list of peer IP addresses you want to communicate with using the
underlying BGP network.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
ebgp:: If your peer's remote-AS is different, this enables EBGP.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
loopback:: Use a loopback or dummy interface as the source of the EVPN network
(for multipath).
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
ebgp-mutltihop:: Increase the number of hops to reach peers, in case they are
not directly connected or they use loopback.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
bgp-multipath-as-path-relax:: Allow ECMP if your peers have different ASN.
2022-02-11 12:34:17 +03:00
2020-11-27 16:21:00 +03:00
[[pvesdn_config_ipam]]
2021-04-26 18:37:28 +03:00
IPAMs
2020-11-27 16:21:00 +03:00
-----
2022-04-08 17:13:42 +03:00
IPAM (IP Address Management) tools are used to manage/assign the IP addresses of
guests on the network. It can be used to find free IP addresses when you create
a VM/CT for example (not yet implemented).
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
An IPAM can be associated with one or more zones, to provide IP addresses
for all subnets defined in those zones.
2020-11-27 16:21:00 +03:00
[[pvesdn_ipam_plugin_pveipam]]
2022-04-08 17:13:42 +03:00
{pve} IPAM Plugin
2021-04-26 18:37:28 +03:00
~~~~~~~~~~~~~~~~~
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
This is the default internal IPAM for your {pve} cluster, if you don't have
external IPAM software.
2020-11-27 16:21:00 +03:00
[[pvesdn_ipam_plugin_phpipam]]
2022-04-08 17:13:42 +03:00
phpIPAM Plugin
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~
https://phpipam.net/
2022-04-08 17:13:42 +03:00
You need to create an application in phpIPAM and add an API token with admin
privileges.
2020-11-27 16:21:00 +03:00
2022-04-08 17:13:42 +03:00
The phpIPAM configuration properties are:
2020-11-27 16:21:00 +03:00
2021-04-26 18:37:28 +03:00
url:: The REST-API endpoint: `http://phpipam.domain.com/api/<appname>/`
2022-04-08 17:13:42 +03:00
2021-04-26 18:37:28 +03:00
token:: An API access token
2022-04-08 17:13:42 +03:00
section:: An integer ID. Sections are a group of subnets in phpIPAM. Default
installations use `sectionid=1` for customers.
2020-11-27 16:21:00 +03:00
[[pvesdn_ipam_plugin_netbox]]
2022-04-08 17:13:42 +03:00
NetBox IPAM Plugin
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~
2021-04-26 18:37:28 +03:00
2022-04-08 17:13:42 +03:00
NetBox is an IP address management (IPAM) and datacenter infrastructure
management (DCIM) tool. See the source code repository for details:
2020-11-27 16:21:00 +03:00
https://github.com/netbox-community/netbox
2022-04-08 17:13:42 +03:00
You need to create an API token in NetBox to use it:
2020-11-27 16:21:00 +03:00
https://netbox.readthedocs.io/en/stable/api/authentication
2022-04-08 17:13:42 +03:00
The NetBox configuration properties are:
2020-11-27 16:21:00 +03:00
2021-04-26 18:37:28 +03:00
url:: The REST API endpoint: `http://yournetbox.domain.com/api`
2022-04-08 17:13:42 +03:00
2021-04-26 18:37:28 +03:00
token:: An API access token
2020-11-27 16:21:00 +03:00
[[pvesdn_config_dns]]
2021-04-26 18:37:28 +03:00
DNS
2020-11-27 16:21:00 +03:00
---
2021-04-26 18:37:28 +03:00
The DNS plugin in {pve} SDN is used to define a DNS API server for registration
2022-04-08 17:13:42 +03:00
of your hostname and IP address. A DNS configuration is associated with one or
more zones, to provide DNS registration for all the subnet IPs configured for
2021-04-26 18:37:28 +03:00
a zone.
2020-11-27 16:21:00 +03:00
[[pvesdn_dns_plugin_powerdns]]
2022-04-08 17:13:42 +03:00
PowerDNS Plugin
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~
https://doc.powerdns.com/authoritative/http-api/index.html
2022-04-08 17:13:42 +03:00
You need to enable the web server and the API in your PowerDNS config:
2020-03-12 11:36:07 +03:00
2020-05-26 18:46:06 +03:00
----
2020-11-27 16:21:00 +03:00
api=yes
api-key=arandomgeneratedstring
webserver=yes
webserver-port=8081
2020-05-26 18:46:06 +03:00
----
2022-04-08 17:13:42 +03:00
The PowerDNS configuration options are:
2020-11-27 16:21:00 +03:00
2021-04-26 18:37:28 +03:00
url:: The REST API endpoint: http://yourpowerdnserver.domain.com:8081/api/v1/servers/localhost
2022-04-08 17:13:42 +03:00
2021-04-26 18:37:28 +03:00
key:: An API access key
2022-04-08 17:13:42 +03:00
2021-04-26 18:37:28 +03:00
ttl:: The default TTL for records
2020-03-12 11:36:07 +03:00
2020-11-27 16:21:00 +03:00
Examples
--------
2020-05-10 21:09:52 +03:00
[[pvesdn_setup_example_vlan]]
2020-05-10 20:43:36 +03:00
VLAN Setup Example
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
TIP: While we show plaintext configuration content here, almost everything
should be configurable using the web-interface only.
2020-05-10 20:43:36 +03:00
Node1: /etc/network/interfaces
2020-03-12 11:36:07 +03:00
----
auto vmbr0
iface vmbr0 inet manual
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
bridge-vlan-aware yes
bridge-vids 2-4094
#management ip on vlan100
auto vmbr0.100
iface vmbr0.100 inet static
address 192.168.0.1/24
source /etc/network/interfaces.d/*
----
2020-05-10 20:43:36 +03:00
Node2: /etc/network/interfaces
2020-03-12 11:36:07 +03:00
----
auto vmbr0
iface vmbr0 inet manual
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
bridge-vlan-aware yes
bridge-vids 2-4094
#management ip on vlan100
auto vmbr0.100
iface vmbr0.100 inet static
address 192.168.0.2/24
source /etc/network/interfaces.d/*
----
2020-05-10 20:43:36 +03:00
Create a VLAN zone named `myvlanzone':
2020-03-12 11:36:07 +03:00
----
2020-05-10 20:43:36 +03:00
id: myvlanzone
2020-03-12 11:36:07 +03:00
bridge: vmbr0
----
2020-05-10 20:43:36 +03:00
Create a VNet named `myvnet1' with `vlan-id` `10' and the previously created
2022-04-08 17:13:42 +03:00
`myvlanzone' as its zone.
2020-03-12 11:36:07 +03:00
----
id: myvnet1
zone: myvlanzone
tag: 10
----
2020-05-10 20:43:36 +03:00
Apply the configuration through the main SDN panel, to create VNets locally on
2022-04-08 17:13:42 +03:00
each node.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
2020-05-10 20:43:36 +03:00
address 10.0.3.100/24
2020-03-12 11:36:07 +03:00
----
2022-04-08 17:13:42 +03:00
Create a second virtual machine (vm2) on node2, with a vNIC on the same VNet
2020-05-10 20:43:36 +03:00
`myvnet1' as vm1.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
2020-05-10 20:43:36 +03:00
address 10.0.3.101/24
2020-03-12 11:36:07 +03:00
----
2022-04-08 17:13:42 +03:00
Following this, you should be able to ping between both VMs over that network.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_setup_example_qinq]]
QinQ Setup Example
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~
2020-05-10 20:43:36 +03:00
2022-04-08 17:13:42 +03:00
TIP: While we show plaintext configuration content here, almost everything
should be configurable using the web-interface only.
2020-05-10 20:43:36 +03:00
Node1: /etc/network/interfaces
2020-03-12 11:36:07 +03:00
----
auto vmbr0
iface vmbr0 inet manual
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
bridge-vlan-aware yes
bridge-vids 2-4094
#management ip on vlan100
auto vmbr0.100
iface vmbr0.100 inet static
address 192.168.0.1/24
source /etc/network/interfaces.d/*
----
2020-05-10 20:43:36 +03:00
Node2: /etc/network/interfaces
2020-03-12 11:36:07 +03:00
----
auto vmbr0
iface vmbr0 inet manual
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
bridge-vlan-aware yes
bridge-vids 2-4094
#management ip on vlan100
auto vmbr0.100
iface vmbr0.100 inet static
address 192.168.0.2/24
source /etc/network/interfaces.d/*
----
2022-04-08 17:13:42 +03:00
Create a QinQ zone named `qinqzone1' with service VLAN 20
2020-03-12 11:36:07 +03:00
----
id: qinqzone1
bridge: vmbr0
service vlan: 20
----
2020-05-10 20:43:36 +03:00
Create another QinQ zone named `qinqzone2' with service VLAN 30
2020-03-12 11:36:07 +03:00
----
id: qinqzone2
bridge: vmbr0
service vlan: 30
----
2022-04-08 17:13:42 +03:00
Create a VNet named `myvnet1' with customer VLAN-ID 100 on the previously
2020-05-10 20:43:36 +03:00
created `qinqzone1' zone.
2020-03-12 11:36:07 +03:00
----
id: myvnet1
zone: qinqzone1
tag: 100
----
2022-04-08 17:13:42 +03:00
Create a `myvnet2' with customer VLAN-ID 100 on the previously created
2020-05-10 20:43:36 +03:00
`qinqzone2' zone.
2020-03-12 11:36:07 +03:00
----
id: myvnet2
2020-05-26 18:46:08 +03:00
zone: qinqzone2
2020-03-12 11:36:07 +03:00
tag: 100
----
2020-05-10 20:43:36 +03:00
Apply the configuration on the main SDN web-interface panel to create VNets
locally on each nodes.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.100/24
----
2022-04-08 17:13:42 +03:00
Create a second virtual machine (vm2) on node2, with a vNIC on the same VNet
2020-05-10 20:43:36 +03:00
`myvnet1' as vm1.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.101/24
----
2022-04-08 17:13:42 +03:00
Create a third virtual machine (vm3) on node1, with a vNIC on the other VNet
2020-05-10 20:43:36 +03:00
`myvnet2'.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.102/24
----
2022-04-08 17:13:42 +03:00
Create another virtual machine (vm4) on node2, with a vNIC on the same VNet
2020-05-10 20:43:36 +03:00
`myvnet2' as vm3.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.103/24
----
2022-04-08 17:13:42 +03:00
Then, you should be able to ping between the VMs 'vm1' and 'vm2', as well as
between 'vm3' and 'vm4'. However, neither of VMs 'vm1' or 'vm2' can ping VMs
'vm3' or 'vm4', as they are on a different zone with a different service-vlan.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_setup_example_vxlan]]
2020-05-10 20:43:36 +03:00
VXLAN Setup Example
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~~
2020-05-10 20:43:36 +03:00
2022-04-08 17:13:42 +03:00
TIP: While we show plaintext configuration content here, almost everything
is configurable through the web-interface.
2020-05-10 21:09:52 +03:00
2020-03-12 11:36:07 +03:00
node1: /etc/network/interfaces
2020-05-10 20:43:36 +03:00
2020-03-12 11:36:07 +03:00
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.1/24
gateway 192.168.0.254
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
mtu 1500
source /etc/network/interfaces.d/*
----
node2: /etc/network/interfaces
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.2/24
gateway 192.168.0.254
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
mtu 1500
source /etc/network/interfaces.d/*
----
node3: /etc/network/interfaces
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.3/24
gateway 192.168.0.254
2020-05-10 20:43:36 +03:00
bridge-ports eno1
bridge-stp off
bridge-fd 0
2020-03-12 11:36:07 +03:00
mtu 1500
source /etc/network/interfaces.d/*
----
2022-04-08 17:13:42 +03:00
Create a VXLAN zone named `myvxlanzone', using a lower MTU to ensure the extra
2020-05-10 20:43:36 +03:00
50 bytes of the VXLAN header can fit. Add all previously configured IPs from
2022-04-08 17:13:42 +03:00
the nodes to the peer address list.
2020-03-12 11:36:07 +03:00
----
id: myvxlanzone
peers address list: 192.168.0.1,192.168.0.2,192.168.0.3
mtu: 1450
----
2020-05-10 20:43:36 +03:00
Create a VNet named `myvnet1' using the VXLAN zone `myvxlanzone' created
previously.
2020-03-12 11:36:07 +03:00
----
id: myvnet1
zone: myvxlanzone
tag: 100000
----
2020-05-10 20:43:36 +03:00
Apply the configuration on the main SDN web-interface panel to create VNets
locally on each nodes.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Use the following network configuration for this VM (note the lower MTU).
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.100/24
mtu 1450
----
2022-04-08 17:13:42 +03:00
Create a second virtual machine (vm2) on node3, with a vNIC on the same VNet
2020-05-10 20:43:36 +03:00
`myvnet1' as vm1.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.3.101/24
mtu 1450
----
2020-05-10 20:43:36 +03:00
Then, you should be able to ping between between 'vm1' and 'vm2'.
2020-03-12 11:36:07 +03:00
2020-05-10 21:09:52 +03:00
[[pvesdn_setup_example_evpn]]
EVPN Setup Example
2020-11-27 16:21:00 +03:00
~~~~~~~~~~~~~~~~~~
2020-05-10 20:43:36 +03:00
2020-03-12 11:36:07 +03:00
node1: /etc/network/interfaces
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.1/24
gateway 192.168.0.254
bridge-ports eno1
bridge-stp off
bridge-fd 0
mtu 1500
source /etc/network/interfaces.d/*
----
node2: /etc/network/interfaces
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.2/24
gateway 192.168.0.254
bridge-ports eno1
bridge-stp off
bridge-fd 0
mtu 1500
source /etc/network/interfaces.d/*
----
node3: /etc/network/interfaces
----
auto vmbr0
iface vmbr0 inet static
address 192.168.0.3/24
gateway 192.168.0.254
bridge-ports eno1
bridge-stp off
bridge-fd 0
mtu 1500
source /etc/network/interfaces.d/*
----
2022-04-08 17:13:42 +03:00
Create an EVPN controller, using a private ASN number and the above node
addresses as peers.
2020-03-12 11:36:07 +03:00
----
id: myevpnctl
asn: 65000
peers: 192.168.0.1,192.168.0.2,192.168.0.3
----
2022-04-08 17:13:42 +03:00
Create an EVPN zone named `myevpnzone', using the previously created
EVPN-controller. Define 'node1' and 'node2' as exit nodes.
2020-11-27 16:21:00 +03:00
2020-03-12 11:36:07 +03:00
----
id: myevpnzone
vrf vxlan tag: 10000
controller: myevpnctl
mtu: 1450
2021-04-30 00:58:40 +03:00
vnet mac address: 32:F4:05:FE:6C:0A
2020-11-27 16:21:00 +03:00
exitnodes: node1,node2
2020-03-12 11:36:07 +03:00
----
2020-11-27 16:21:00 +03:00
Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone'.
2020-03-12 11:36:07 +03:00
----
id: myvnet1
zone: myevpnzone
tag: 11000
----
2022-04-08 17:13:42 +03:00
Create a subnet 10.0.1.0/24 with 10.0.1.1 as gateway on `myvnet1`.
2021-05-05 10:06:37 +03:00
2020-11-27 16:21:00 +03:00
----
2021-04-30 00:58:40 +03:00
subnet: 10.0.1.0/24
2020-11-27 16:21:00 +03:00
gateway: 10.0.1.1
----
2020-05-10 20:43:36 +03:00
Create the second VNet named `myvnet2' using the same EVPN zone `myevpnzone', a
2021-04-30 00:58:40 +03:00
different IPv4 CIDR network.
2020-03-12 11:36:07 +03:00
----
id: myvnet2
zone: myevpnzone
tag: 12000
----
2021-04-30 00:58:40 +03:00
Create a different subnet 10.0.2.0/24 with 10.0.2.1 as gateway on vnet2
2021-05-05 10:06:37 +03:00
2020-11-27 16:21:00 +03:00
----
2021-04-30 00:58:40 +03:00
subnet: 10.0.2.0/24
2020-11-27 16:21:00 +03:00
gateway: 10.0.2.1
----
2022-04-08 17:13:42 +03:00
Apply the configuration from the main SDN web-interface panel to create VNets
locally on each node and generate the FRR config.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
Create a Debian-based virtual machine (vm1) on node1, with a vNIC on `myvnet1'.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.1.100/24
gateway 10.0.1.1 #this is the ip of the vnet1
mtu 1450
----
2022-04-08 17:13:42 +03:00
Create a second virtual machine (vm2) on node2, with a vNIC on the other VNet
2020-05-10 20:43:36 +03:00
`myvnet2'.
Use the following network configuration for this VM:
2020-03-12 11:36:07 +03:00
----
auto eth0
iface eth0 inet static
address 10.0.2.100/24
2022-04-08 17:13:42 +03:00
gateway 10.0.2.1 #this is the ip of the myvnet2
2020-03-12 11:36:07 +03:00
mtu 1450
----
Then, you should be able to ping vm2 from vm1, and vm1 from vm2.
2020-05-10 20:43:36 +03:00
If you ping an external IP from 'vm2' on the non-gateway 'node3', the packet
2020-11-27 16:21:00 +03:00
will go to the configured 'myvnet2' gateway, then will be routed to the exit
2020-05-10 20:43:36 +03:00
nodes ('node1' or 'node2') and from there it will leave those nodes over the
default gateway configured on node1 or node2.
2020-03-12 11:36:07 +03:00
2022-04-08 17:13:42 +03:00
NOTE: You need to add reverse routes for the '10.0.1.0/24' and '10.0.2.0/24'
networks to node1 and node2 on your external gateway, so that the public network
can reply back.
2020-03-12 11:36:07 +03:00
2020-05-10 20:43:36 +03:00
If you have configured an external BGP router, the BGP-EVPN routes (10.0.1.0/24
and 10.0.2.0/24 in this example), will be announced dynamically.
2021-09-06 06:57:20 +03:00
Notes
-----
2021-09-10 15:52:51 +03:00
VXLAN IPSEC Encryption
~~~~~~~~~~~~~~~~~~~~~~
2022-04-08 17:13:42 +03:00
If you need to add encryption on top of a VXLAN, it's possible to do so with
IPSEC, through `strongswan`. You'll need to reduce the 'MTU' by 60 bytes (IPv4)
2021-09-10 15:52:51 +03:00
or 80 bytes (IPv6) to handle encryption.
2021-09-06 06:57:20 +03:00
2021-09-10 15:52:51 +03:00
So with default real 1500 MTU, you need to use a MTU of 1370 (1370 + 80 (IPSEC)
+ 50 (VXLAN) == 1500).
2021-09-06 06:57:20 +03:00
2021-09-10 15:52:26 +03:00
.Install strongswan
2021-09-06 06:57:20 +03:00
----
2021-09-10 15:52:26 +03:00
apt install strongswan
2021-09-06 06:57:20 +03:00
----
2022-04-08 17:13:42 +03:00
Add configuration to `/etc/ipsec.conf'. We only need to encrypt traffic from
2021-09-10 15:52:51 +03:00
the VXLAN UDP port '4789'.
2021-09-06 06:57:20 +03:00
----
conn %default
2021-09-10 15:52:51 +03:00
ike=aes256-sha1-modp1024! # the fastest, but reasonably secure cipher on modern HW
2021-09-06 06:57:20 +03:00
esp=aes256-sha1!
2021-09-10 15:52:51 +03:00
leftfirewall=yes # this is necessary when using Proxmox VE firewall rules
2021-09-06 06:57:20 +03:00
conn output
rightsubnet=%dynamic[udp/4789]
right=%any
type=transport
authby=psk
auto=route
conn input
leftsubnet=%dynamic[udp/4789]
type=transport
authby=psk
auto=route
----
2022-04-08 17:13:42 +03:00
Then generate a pre-shared key with:
2021-09-06 06:57:20 +03:00
----
openssl rand -base64 128
----
2022-04-08 17:13:42 +03:00
and add the key to `/etc/ipsec.secrets', so that the file contents looks like:
2021-09-06 06:57:20 +03:00
----
: PSK <generatedbase64key>
----
2021-09-10 15:52:51 +03:00
2022-04-08 17:13:42 +03:00
You need to copy the PSK and the configuration onto the other nodes.