]> git.proxmox.com Git - pve-docs.git/blobdiff - pvesdn.adoc
backup: clarify that CLI means FS-level and highlight retention-note
[pve-docs.git] / pvesdn.adoc
index c1597b82cd30e6492d4190d16fb67400f0364bbb..223ba6de526ad0f535475e83824e302d4e92ab13 100644 (file)
@@ -17,19 +17,22 @@ xref:getting_help[mailing lists or in the forum] for questions and feedback.
 Installation
 ------------
 
-To enable the experimental SDN integration, you need to install
-"libpve-network-perl" package
+To enable the experimental SDN integration, you need to install the
+`libpve-network-perl` and `ifupdown2` package on every node:
 
 ----
-apt install libpve-network-perl
+apt update
+apt install libpve-network-perl ifupdown2
 ----
 
-You need to have `ifupdown2` package installed on each node to manage local
-configuration reloading without reboot:
+After that you need to add the following line:
 
 ----
-apt install ifupdown2
+source /etc/network/interfaces.d/*
 ----
+at the end of the `/etc/network/interfaces` configuration file, so that the SDN
+config gets included and activated.
+
 
 Basic Overview
 --------------
@@ -44,28 +47,37 @@ features, advantages or disadvantages.
 Normally a 'VNet' shows up as a common Linux bridge with either a VLAN or
 'VXLAN' tag, but some can also use layer 3 routing for control.
 The 'VNets' are deployed locally on each node, after configuration was committed
-from the cluster wide datacenter SDN administration interface.
+from the cluster-wide datacenter SDN administration interface.
 
 
 Main configuration
-------------------
+~~~~~~~~~~~~~~~~~~
 
 The configuration is done at datacenter (cluster-wide) level, it will be saved
 in configuration files located in the shared configuration file system:
 `/etc/pve/sdn`
 
-On the web-interface  SDN feature have 4 main sections for the configuration
+On the web-interface  SDN feature have 3 main sections for the configuration
 
 * SDN: a overview of the SDN state
 
 * Zones: Create and manage the virtual separated network Zones
 
-* VNets: The per-node building block to provide a Zone for VMs
+* VNets: Create virtual network bridges + subnets management.
+
+And some options:
 
 * Controller: For complex setups to control Layer 3 routing
 
+* Sub-nets: Used to defined ip networks on VNets.
+
+* IPAM: Allow to use external tools for IP address management (guest IPs)
+
+* DNS: Allow to define a DNS server api for registering a virtual guests
+  hostname and IP-addresses
 
 [[pvesdn_config_main_sdn]]
+
 SDN
 ~~~
 
@@ -73,12 +85,23 @@ This is the main status panel. Here you can see deployment status of zones on
 different nodes.
 
 There is an 'Apply' button, to push and reload local configuration on all
-cluster nodes nodes.
+cluster nodes.
+
+
+[[pvesdn_local_deployment_monitoring]]
+Local Deployment Monitoring
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+After applying the configuration through the main SDN web-interface panel,
+the local network configuration is generated locally on each node in
+`/etc/network/interfaces.d/sdn`, and with ifupdown2 reloaded.
+
+You can monitor the status of local zones and vnets through the main tree.
 
 
 [[pvesdn_config_zone]]
 Zones
-~~~~~
+-----
 
 A zone will define a virtually separated network.
 
@@ -90,6 +113,8 @@ It can use different technologies for separation:
 
 * VXLAN: (layer2 vxlan)
 
+* Simple: Isolated Bridge, simple l3 routing bridge (NAT)
+
 * bgp-evpn: vxlan using layer3 border gateway protocol routing
 
 You can restrict a zone to specific nodes.
@@ -97,57 +122,39 @@ You can restrict a zone to specific nodes.
 It's also possible to add permissions on a zone, to restrict user to use only a
 specific zone and only the VNets in that zone
 
-[[pvesdn_config_vnet]]
-VNets
-~~~~~
-
-A `VNet` is in its basic form just a Linux bridge that will be deployed locally
-on the node and used for Virtual Machine communication.
-
-VNet properties are:
-
-* ID: a 8 characters ID to name and identify a VNet
-
-* Alias: Optional longer name, if the ID isn't enough
-
-* Zone: The associated zone for this VNet
+Common options
+~~~~~~~~~~~~~~
 
-* Tag: The unique VLAN or VXLAN id
+The following options are available for all zone types.
 
-* VLAN Aware: Allow to add an extra VLAN tag in the virtual machine or
-  container vNIC configurations or allow the guest OS to manage the VLAN's tag.
+nodes:: Deploy and allow to use a VNets configured for this Zone only on these
+nodes.
 
-* IPv4: an anycast IPv4 address, it will be configured on the underlying bridge
-  on each node part of the Zone. It's only useful for `bgp-evpn` routing.
+ipam:: Optional, if you want to use an ipam tool to manage ips in  this zone
 
-* IPv6: an anycast IPv6 address, it will be configured on the underlying bridge
-  on each node part of the Zone. It's only useful for `bgp-evpn` routing.
+dns:: Optional, dns api server.
 
+reversedns:: Optional, reverse dns api server.
 
-[[pvesdn_config_controllers]]
-Controllers
-~~~~~~~~~~~
+dnszone:: Optional, dns domain name. Use to register hostname like
+`<hostname>.<domain>`. The dns zone need to be already existing in dns server.
 
-Some zone types need an external controller to manage the VNet control-plane.
-Currently this is only required for the `bgp-evpn` zone plugin.
 
+[[pvesdn_zone_plugin_simple]]
+Simple Zones
+~~~~~~~~~~~~
 
-[[pvesdn_zone_plugins]]
-Zones Plugins
--------------
-
-Common options
-~~~~~~~~~~~~~~
-
-nodes:: Deploy and allow to use a VNets configured for this Zone only on these
-nodes.
+This is the simplest plugin, it will create an isolated vnet bridge.
+This bridge is not linked to physical interfaces, VM traffic is only
+local to the node(s).
+It can be also used for NAT or routed setup.
 
 [[pvesdn_zone_plugin_vlan]]
 VLAN Zones
 ~~~~~~~~~~
 
-This is the simplest plugin, it will reuse an existing local Linux or OVS
-bridge, and manage VLANs on it.
+This plugin will reuse an existing local Linux or OVS bridge, 
+and manage VLANs on it.
 The benefit of using SDN module, is that you can create different zones with
 specific VNets VLAN tag, and restrict Virtual Machines to separated zones.
 
@@ -171,6 +178,8 @@ bridge:: A local VLAN-aware bridge already configured on each local node
 
 service vlan:: The main VLAN tag of this zone
 
+service vlan protocol:: allow to define a 802.1q (default) or 802.1ad service vlan type.
+
 mtu:: Due to the double stacking of tags you need 4 more bytes for QinQ VLANs.
 For example, you reduce the MTU to `1496` if you physical interface MTU is
 `1500`.
@@ -211,21 +220,92 @@ Routing and Forwarding) interface.
 
 Specific EVPN configuration options:
 
-VRF VXLAN Tag:: This is a vxlan-id used for routing interconnect between vnets,
+VRF VXLAN tag:: This is a vxlan-id used for routing interconnect between vnets,
 it must be different than VXLAN-id of VNets
 
 controller:: an EVPN-controller need to be defined first (see controller
 plugins section)
 
-mtu:: because VXLAN encapsulation use 50bytes, the MTU need to be 50 bytes
-lower than the outgoing physical interface.
+VNet MAC address:: A unique anycast MAC address for all VNets in this zone.
+  Will be auto-generated if not defined.
+
+Exit Nodes:: This is used if you want to define some proxmox nodes, as exit
+  gateway from evpn network through real network. The configured nodes will
+  announce a default route in the EVPN network.
+
+Advertise Subnets:: Optional. If you have silent vms/CT (for example, multiples
+  ips by interfaces, and the anycast gateway don't see traffic from theses ips,
+  the ips 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.
+
+Exit Nodes local routing:: Optional. This is a special option if you need to
+  reach a vm/ct service from an exit node. (By default, the exit nodes only
+  allow forwarding traffic between real network and evpn network).
+
+MTU:: because VXLAN encapsulation use 50 bytes, the MTU needs to be 50 bytes
+  lower than the maximal MTU of the outgoing physical interface.
+
+
+[[pvesdn_config_vnet]]
+VNets
+-----
+
+A `VNet` is in its basic form just a Linux bridge that will be deployed locally
+on the node and used for Virtual Machine communication.
+
+VNet properties are:
+
+ID:: a 8 characters ID to name and identify a VNet
+
+Alias:: Optional longer name, if the ID isn't enough
+
+Zone:: The associated zone for this VNet
+
+Tag:: The unique VLAN or VXLAN id
+
+VLAN Aware:: Allow to add an extra VLAN tag in the virtual machine or
+  container vNIC configurations or allow the guest OS to manage the VLAN's tag.
+
+[[pvesdn_config_subnet]]
+
+Sub-Nets
+~~~~~~~~
+
+A sub-network (subnet or sub-net) allows you to define a specific IP network
+(IPv4 or IPv6). For each VNET, you can define one or more subnets.
+
+A subnet can be used to:
+
+* restrict IP-addresses you can define on a specific VNET
+* assign routes/gateway 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 plugin
+* DNS registration through DNS plugins
+
+If an IPAM server is associated to the subnet zone, the subnet prefix will be
+automatically registered in the IPAM.
+
+
+Subnet properties are:
+
+ID:: a cidr network address. Ex: 10.0.0.0/8
+
+Gateway:: ip address for the default gateway of the network. 
+          On layer3 zones (simple/evpn plugins), it'll be deployed on the vnet.
+
+Snat:: Optional, Enable Snat for layer3 zones (simple/evpn plugins) for this subnet.
+       The subnet source ip will be natted to server outgoing interface/ip.
+       On evpn zone, it's done only on evpn gateway-nodes.
 
+Dnszoneprefix:: Optional, add a prefix to domain registration, like <hostname>.prefix.<domain>
 
-[[pvesdn_controller_plugins]]
-Controllers Plugins
--------------------
 
-For complex zones requiring a control plane.
+[[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.
 
 [[pvesdn_controller_plugin_evpn]]
 EVPN Controller
@@ -236,7 +316,7 @@ 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.
 
 ----
-apt install frr
+apt install frr frr-pythontools
 ----
 
 Configuration options:
@@ -245,41 +325,121 @@ asn:: A unique BGP ASN number. It's highly recommended to use private ASN
 number (64512 – 65534, 4200000000 – 4294967294), as else you could end up
 breaking, or get broken, by global routing by mistake.
 
-peers:: An ip list of all nodes where you want to communicate (could be also
+peers:: An ip list of all nodes where you want to communicate for the EVPN (could be also
 external nodes or route reflectors servers)
 
-Additionally, if you want to route traffic from a SDN BGP-EVPN network to
-external world:
 
-gateway-nodes:: The proxmox nodes from where the bgp-evpn traffic will exit to
-external through the nodes default gateway
+[[pvesdn_controller_plugin_BGP]]
+BGP Controller
+~~~~~~~~~~~~~~~
 
-gateway-external-peers::  If you want that gateway nodes don't use the default
-gateway, but, for example, sent traffic to external BGP routers, which handle
-(reverse) routing then dynamically you can use. For example
-`192.168.0.253,192.168.0.254'
+The bgp controller is not used directly by a zone. 
+You can used it to configure frr to manage bgp peers.
 
+For BGP-evpn, it can be use to define a different ASN by node, so doing EBGP.
 
-[[pvesdn_local_deployment_monitoring]]
-Local Deployment Monitoring
----------------------------
+Configuration options:
 
-After applying the configuration through the main SDN web-interface panel,
-the local network configuration is generated locally on each node in
-`/etc/network/interfaces.d/sdn`, and with ifupdown2 reloaded.
+node:: The node of this BGP controller
+
+asn:: A unique BGP ASN number. It's highly recommended to use private ASN
+  number from the range (64512 - 65534) or (4200000000 - 4294967294), as else
+  you could end up breaking, or get broken, by global routing by mistake.
+
+peers:: An IP list of peers you want to communicate with for the underlying
+  BGP network.
+
+ebgp:: If your peer's remote-AS is different, it's enabling EBGP.
+
+loopback:: If you want to use a loopback or dummy interface as source for the
+  evpn network. (for multipath)
+
+ebgp-mutltihop:: if the peers are not directly connected or use loopback, you can increase the
+  number of hops to reach them.
+
+[[pvesdn_config_ipam]]
+IPAMs
+-----
+IPAM (IP address management) tools, are used to manage/assign ips on your devices on the network.
+It can be used to find free ip address when you create a vm/ct for example (not yet implemented).
+
+An IPAM is associated to 1 or multiple zones, to provide ip addresses for all subnets defined in this zone.
+
+
+[[pvesdn_ipam_plugin_pveipam]]
+{pve} IPAM plugin
+~~~~~~~~~~~~~~~~~
+
+This is the default internal IPAM for your proxmox cluster if you don't have
+external ipam software
+
+[[pvesdn_ipam_plugin_phpipam]]
+phpIPAM plugin
+~~~~~~~~~~~~~~
+https://phpipam.net/
+
+You need to create an application in phpipam, and add an api token with admin
+permission
+
+phpIPAM properties are:
+
+url:: The REST-API endpoint: `http://phpipam.domain.com/api/<appname>/`
+token:: An API access token
+section:: An integer ID. Sections are group of subnets in phpIPAM. Default
+ installations use `sectionid=1` for customers.
+
+[[pvesdn_ipam_plugin_netbox]]
+Netbox IPAM plugin
+~~~~~~~~~~~~~~~~~~
+
+NetBox is an IP address management (IPAM) and data center infrastructure
+management (DCIM) tool, see the source code repository for details:
+https://github.com/netbox-community/netbox
+
+You need to create an api token in netbox
+https://netbox.readthedocs.io/en/stable/api/authentication
+
+NetBox properties are:
+
+url:: The REST API endpoint: `http://yournetbox.domain.com/api`
+token:: An API access token
+
+[[pvesdn_config_dns]]
+DNS
+---
+
+The DNS plugin in {pve} SDN is used to define a DNS API server for registration
+of your hostname and IP-address. A DNS configuration is associated with one or
+more zones, to provide DNS registration for all the sub-net IPs configured for
+a zone.
+
+[[pvesdn_dns_plugin_powerdns]]
+PowerDNS plugin
+~~~~~~~~~~~~~~~
+https://doc.powerdns.com/authoritative/http-api/index.html
+
+You need to enable the webserver and the API in your PowerDNS config:
 
-You need to add
 ----
-source /etc/network/interfaces.d/*
+api=yes
+api-key=arandomgeneratedstring
+webserver=yes
+webserver-port=8081
 ----
-at the end of /etc/network/interfaces to have the sdn config included
 
-You can monitor the status of local zones and vnets through the main tree.
+Powerdns properties are:
+
+url:: The REST API endpoint: http://yourpowerdnserver.domain.com:8081/api/v1/servers/localhost
+key:: An API access key
+ttl:: The default TTL for records
 
 
+Examples
+--------
+
 [[pvesdn_setup_example_vlan]]
 VLAN Setup Example
-------------------
+~~~~~~~~~~~~~~~~~~
 
 TIP: While we show plain configuration content here, almost everything should
 be configurable using the web-interface only.
@@ -367,7 +527,7 @@ Then, you should be able to ping between both VMs over that network.
 
 [[pvesdn_setup_example_qinq]]
 QinQ Setup Example
-------------------
+~~~~~~~~~~~~~~~~~~
 
 TIP: While we show plain configuration content here, almost everything should
 be configurable using the web-interface only.
@@ -497,7 +657,7 @@ or 'vm4', as they are on a different zone with different service-vlan.
 
 [[pvesdn_setup_example_vxlan]]
 VXLAN Setup Example
--------------------
+~~~~~~~~~~~~~~~~~~~
 
 TIP: While we show plain configuration content here, almost everything should
 be configurable using the web-interface only.
@@ -597,7 +757,7 @@ Then, you should be able to ping between between 'vm1' and 'vm2'.
 
 [[pvesdn_setup_example_evpn]]
 EVPN Setup Example
-------------------
+~~~~~~~~~~~~~~~~~~
 
 node1: /etc/network/interfaces
 
@@ -645,51 +805,60 @@ source /etc/network/interfaces.d/*
 ----
 
 Create a EVPN controller, using a private ASN number and above node addreesses
-as peers. Define 'node1' and 'node2' as gateway nodes.
+as peers.
 
 ----
 id: myevpnctl
 asn: 65000
 peers: 192.168.0.1,192.168.0.2,192.168.0.3
-gateway nodes: node1,node2
 ----
 
 Create an EVPN zone named `myevpnzone' using the previously created
-EVPN-controller.
+EVPN-controller Define 'node1' and 'node2' as exit nodes.
 
 ----
 id: myevpnzone
 vrf vxlan tag: 10000
 controller: myevpnctl
 mtu: 1450
+vnet mac address: 32:F4:05:FE:6C:0A
+exitnodes: node1,node2
 ----
 
-Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone', a IPv4
-CIDR network and a random MAC address.
-
+Create the first VNet named `myvnet1' using the EVPN zone `myevpnzone'.
 ----
 id: myvnet1
 zone: myevpnzone
 tag: 11000
-ipv4: 10.0.1.1/24
-mac address: 8C:73:B2:7B:F9:60 #random generate mac address
+----
+
+Create a subnet 10.0.1.0/24 with 10.0.1.1 as gateway on vnet1
+
+----
+subnet: 10.0.1.0/24
+gateway: 10.0.1.1
 ----
 
 Create the second VNet named `myvnet2' using the same EVPN zone `myevpnzone', a
-different IPv4 CIDR network and a different random MAC address than  `myvnet1'.
+different IPv4 CIDR network.
 
 ----
 id: myvnet2
 zone: myevpnzone
 tag: 12000
-ipv4: 10.0.2.1/24
-mac address: 8C:73:B2:7B:F9:61  #random mac, need to be different on each vnet
 ----
 
+Create a different subnet 10.0.2.0/24 with 10.0.2.1 as gateway on vnet2
+
+----
+subnet: 10.0.2.0/24
+gateway: 10.0.2.1
+----
+
+
 Apply the configuration on the main SDN web-interface panel to create VNets
 locally on each nodes and generate the FRR config.
 
-
 Create a Debian-based Virtual Machine (vm1) on node1, with a vNIC on `myvnet1'.
 
 Use the following network configuration for this VM:
@@ -719,7 +888,7 @@ iface eth0 inet static
 Then, you should be able to ping vm2 from vm1, and vm1 from vm2.
 
 If you ping an external IP from 'vm2' on the non-gateway 'node3', the packet
-will go to the configured 'myvnet2' gateway, then will be routed to gateway
+will go to the configured 'myvnet2' gateway, then will be routed to the exit
 nodes ('node1' or 'node2') and from there it will leave those nodes over the
 default gateway configured on node1 or node2.
 
@@ -729,3 +898,58 @@ public network can reply back.
 
 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.
+
+
+Notes
+-----
+
+VXLAN IPSEC Encryption
+~~~~~~~~~~~~~~~~~~~~~~
+If you need to add encryption on top of VXLAN, it's possible to do so with
+IPSEC through `strongswan`. You'll need to reduce the 'MTU' by 60 bytes (IPv4)
+or 80 bytes (IPv6) to handle encryption.
+
+So with default real 1500 MTU, you need to use a MTU of 1370 (1370 + 80 (IPSEC)
++ 50 (VXLAN) == 1500).
+
+.Install strongswan
+----
+apt install strongswan
+----
+
+Add configuration in `/etc/ipsec.conf'. We only need to encrypt traffic from
+the VXLAN UDP port '4789'.
+
+----
+conn %default
+    ike=aes256-sha1-modp1024!  # the fastest, but reasonably secure cipher on modern HW
+    esp=aes256-sha1!
+    leftfirewall=yes           # this is necessary when using Proxmox VE firewall rules
+
+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
+----
+
+Then generate a preshared key with
+
+----
+openssl rand -base64 128
+----
+
+and copy the key in `/etc/ipsec.secrets' so that the file content looks like:
+
+----
+: PSK <generatedbase64key>
+----
+
+You need to copy the PSK and the config on other nodes.