all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH cluster/docs/manager/network/proxmox{-ve-rs,-perl-rs} v5 00/29] Add WireGuard as protocol to SDN fabrics
@ 2026-05-12 17:31 Stefan Hanreich
  2026-05-12 17:31 ` [PATCH pve-cluster v5 01/29] cfs: add 'priv/wg-keys.cfg' to observed files Stefan Hanreich
                   ` (31 more replies)
  0 siblings, 32 replies; 35+ messages in thread
From: Stefan Hanreich @ 2026-05-12 17:31 UTC (permalink / raw)
  To: pve-devel

## Introduction

This patch series introduces WireGuard as fabric protocol. Potential use-cases
include:

* Connecting to remote PBS / PDM instances
* Simple encryption layer for intra-DC VXLAN tunnels
* Secure migration network
* Connecting with remote PVE clusters

It utilizes the wg(8) tool for generating the interface configuration [1] and
the section config format leans heavily into the keys defined there.


## Configuration format

The configuration format is quite similar to OSPF and Openfabric with the main
difference being that WireGuard nodes have been split into two subtypes
(external and internal), in order to support nodes that are not part of the
cluster.

### Nodes

WireGuard nodes have been split into two different types. Those are not distinct
section config types, due to how the internal representation of the FabricConfig
has been structured (which maps exactly one Fabric type to one Node type). So
instead there is one Node type that is an enum. The 'role' field is used for
distinguishing between different WireGuard node types.

#### Internal

This represents a node that is part of the Proxmox VE cluster.

An example configuration looks like this:

    wireguard_node: vpn_elementalist
            endpoint 192.0.2.1
            allowed_ips 203.0.113.128/25
            interfaces name=wg0,listen_port=50000,public_key=O+Kzrochm6klMILjSKVw83xb3YyXXLpmZj9n/ICM5xE=,ip=198.51.100.1/24
            role internal

The endpoint value will be used by other nodes inside the Proxmox VE cluster for
connecting to the defined node. IPs are defined on a per-interface basis, not a
per-node basis. The interface key represents the [Interface] section in the
WireGuard configuration. All values (except for public key) are overridable in
the peer definition.

#### External

External nodes represent any peer that is not a Proxmox VE node. They provide a
mechanism for defining a reusable peer definition (see below for more details).

This allows for easily re-using and updating the information of an external
peer, without having to re-type all information for every Proxmox VE node that
wants to utilize the definition.

An example configuration looks like this:

    wireguard_node: vpn_berserker
            endpoint berserker:51337
            allowed_ips 203.0.113.0/25
            public_key GDPUAnPOY5xGIjYXmcGyXZXbocjBr21dGQ5vwnjmdzA=
            role external

Those keys map 1:1 to the peer entries in the respective WireGuard configuration
format and are used for generating the peer definition wherever they are
referenced.

### Peers

Interfaces on Proxmox nodes can have one or more peers. A peer is a reference to
either the interface of an internal node, or an external node. Due to
limitations in dealing with nested data in the section config, peers are an
array field in the node, instead of being configured on the interface directly.

An example configuration for a Proxmox VE node with an interface that has an
internal and external node as peer looks as follows:

    wireguard_node: vpn_occultist
            endpoint 192.0.2.2
            interfaces name=wg0,listen_port=50000,public_key=y0kOpXfo9ff4KoUwO3H1cRuwObbKwsK8mAkwXxNvKUc=,ip=198.51.100.2/24
            peers type=internal,node=elementalist,node_iface=wg0,iface=wg0
            peers type=external,node=berserker,iface=wg0
            role internal

This would generate the following wg0.conf file:

    [Interface]
    PrivateKey = <some_private_key>
    ListenPort = 50000

    [Peer]
    PublicKey = O+Kzrochm6klMILjSKVw83xb3YyXXLpmZj9n/ICM5xE=
    AllowedIPs = 198.51.100.1/32
    Endpoint = 192.0.2.1:50000
    AllowedIPs = 203.0.113.128/25

    [Peer]
    PublicKey = GDPUAnPOY5xGIjYXmcGyXZXbocjBr21dGQ5vwnjmdzA=
    Endpoint = berserker:51337
    AllowedIPs = 203.0.113.0/25


Peer definitions allow overriding properties from the node definition (e.g.
endpoint). This is currently not implemented in the frontend. This is also the
main reason for choosing to store peers as an array in a different key.
Referencing peer defintions by id would have been possible in the interface
property string, but if the possibility of overriding certain attributes should
be available, then a separate key with property strings is required.


## Key handling

Keys are automatically generated in the backend on demand, whenever an interface
is created. Keys are deleted upon applying the SDN configuration. After a
key has been generated, the respective public key gets stored in the section
config.

The WireGuard configuration files are stored locally on the node in the newly
established '/etc/wireguard/proxmox' folder, and managed by the node itself.


## Open questions / issues

### Peers

The main issue I see with the configuration format is that peers reference
arbitrary node sections / interface definitions in the fabric config. This poses
some problems, particularly when updating the referenced entities. For instance,
users could delete a referenced interface, invalidating the configuration. This
is quite similar to the problems we currently encounter with firewall ipsets and
aliases.

In order to avoid re-creating the same issues there are a few restrictions in
the UI that should prevent the most common mistakes:

* Renaming nodes and interfaces is not allowed.
* The configuration is validated after every modification and invalid
  configurations are outright rejected. This is particularly important for
  delete operations.

In the future we could lift some restrictions by implementing smarter CRUD
operations. For instance, when deleting an interface all peer entries, that
reference that interface, could be deleted as well. Even for accidental
deletions this isn't too bad imo, since we have a mechanism of restoring the
current running configuration, which users can always use.

For updates to the interfaces of a node this is harder, since it is impossible
to say whether an interface has been renamed or an interface has been deleted
and another one created. I don't really see a good heuristic (even when tracking
this in the UI) that works particularly well for all potential cases.

### Section Types

The split of one section type ('wireguard_node') into two different subtypes is
breaking a bit with section config principles. Another solution would be to
introduce two section config types (e.g. wireguard_node_{external,internal}),
although that would require quite some refactoring effort.


## Future work

* implement status reporting
* provide QoL features for easier config (e.g. auto-"fullmeshify" PVE cluster)
* Implement some backend-only features in the UI (e.g. per-peer overrides,
  pre-shared keys)
* Integration into PDM / PBS


## Dependencies

* proxmox-ve-config depends on proxmox-sdn-types
* proxmox-ve-config depends on proxmox-network-types
* proxmox-ve-config depends on proxmox-wireguard
* proxmox-perl-rs depends on proxmox-ve-config
* pve-network depends on proxmox-perl-rs
* pve-network depends on pve-cluster
* pve-manager depends on pve-network


Changes from v4 (Thanks @Arthur):
* removed already applied commits
* rebased on top of master
* auto-create /etc/wireguard/proxmox if it doesn't exist already
* improved descriptions of some properties in the JSONSchema
* add documentation for WireGuard fabric
* reject configurations where two interfaces have the same IP
* fix validating existence of referenced external nodes
* improve the task log warning when wireguard-tools is not installed.
* do not leave wg-keys.cfg in an invalid state when interface validation fails
  on updating a node
* rename auto_generate_routes to skip_route_generation and invert logic
* expose skip_route_generation in UI
* remove wireguard configuration files that were removed
* only print warning for non-existing wireguard-tools if there are wireguard
  fabrics configured
* fix fabric view fail to render if the running configuration for a node
  contains the interfaces property, but the pending configuration does not
* always show status ok for fabrics, until status reporting is actually
  implemented

Changes from v3 (Thanks @Thomas):
* rebased on top of current master
* use x25519 instead of ed25519 for public key derivation (which is the correct
  algorithm)
* moved keys to pmxcfs into a section config file under /etc/pve/priv
* delete keys on applying the SDN config, not when calling DELETE API call
* fix error message when referenced interface does not exist
* fix validating the existence of interfaces
* fix editing an external node
* fix some doc-comments in the Rust code

Changes from v2 (Thanks @Gabriel):
* rebased branches on top of current master + route-maps series
* added backend-only option to skip auto-generating routes
* added possibility to include wireguard interfaces when selecting interfaces
  for nodes in other fabric types
* show auto-generated public key in Web UI
* improved validation error messages
* added better descriptions in the UI for the endpoint / allowed ips options
* added newline to generated ifupdown2 config stanza
* added early failure in case wireguard-tools isn't installed

Changes from RFC:
* rebased on top of current master branches

[1] https://man7.org/linux/man-pages/man8/wg.8.html


pve-cluster:

Stefan Hanreich (1):
  cfs: add 'priv/wg-keys.cfg' to observed files

 src/PVE/Cluster.pm  | 1 +
 src/pmxcfs/status.c | 1 +
 2 files changed, 2 insertions(+)


proxmox-ve-rs:

Christoph Heiss (2):
  sdn-types: add wireguard-specific PersistentKeepalive api type
  ve-config: fabric: refactor fabric config entry impl using macro

Stefan Hanreich (6):
  ve-config: fabrics: split interface name regex into two parts
  ve-config: fabrics: add protocol-specific properties for wireguard
  ve-config: wireguard: add private keys section config
  ve-config: sdn: fabrics: add wireguard to the fabric config
  ve-config: fabrics: wireguard add validation for wireguard config
  ve-config: fabrics: implement wireguard config generation

 proxmox-sdn-types/src/lib.rs                  |   1 +
 proxmox-sdn-types/src/wireguard.rs            |  43 +
 proxmox-ve-config/Cargo.toml                  |   3 +
 proxmox-ve-config/debian/control              |   6 +
 proxmox-ve-config/src/sdn/fabric/frr.rs       |   1 +
 proxmox-ve-config/src/sdn/fabric/mod.rs       | 447 ++++++++--
 .../src/sdn/fabric/section_config/fabric.rs   |  25 +
 .../sdn/fabric/section_config/interface.rs    |   5 +-
 .../src/sdn/fabric/section_config/mod.rs      |  58 ++
 .../src/sdn/fabric/section_config/node.rs     |  32 +-
 .../sdn/fabric/section_config/protocol/mod.rs |   1 +
 .../section_config/protocol/wireguard.rs      | 810 ++++++++++++++++++
 proxmox-ve-config/src/sdn/mod.rs              |   1 +
 proxmox-ve-config/src/sdn/wireguard.rs        | 309 +++++++
 14 files changed, 1671 insertions(+), 71 deletions(-)
 create mode 100644 proxmox-sdn-types/src/wireguard.rs
 create mode 100644 proxmox-ve-config/src/sdn/fabric/section_config/protocol/wireguard.rs
 create mode 100644 proxmox-ve-config/src/sdn/wireguard.rs


proxmox-perl-rs:

Christoph Heiss (1):
  pve-rs: fabrics: wireguard: generate ifupdown2 configuration

Stefan Hanreich (2):
  pve-rs: fabrics: add helpers for parsing interface property strings
  pve-rs: sdn: wireguard: add private keys module

 pve-rs/Cargo.toml                    |   1 +
 pve-rs/Makefile                      |   1 +
 pve-rs/src/bindings/sdn/fabrics.rs   | 217 +++++++++++++++++++++++----
 pve-rs/src/bindings/sdn/mod.rs       |   1 +
 pve-rs/src/bindings/sdn/wireguard.rs | 103 +++++++++++++
 pve-rs/src/sdn/status.rs             |  29 +++-
 6 files changed, 316 insertions(+), 36 deletions(-)
 create mode 100644 pve-rs/src/bindings/sdn/wireguard.rs


pve-network:

Christoph Heiss (1):
  sdn: add wireguard helper module

Stefan Hanreich (2):
  fabrics: wireguard: add schema definitions for wireguard
  fabrics: wireguard: implement wireguard key auto-generation

 src/PVE/API2/Network/SDN.pm                   |   4 +-
 .../API2/Network/SDN/Fabrics/FabricNode.pm    | 106 ++++++++++-
 src/PVE/Network/SDN.pm                        |   2 +
 src/PVE/Network/SDN/Fabrics.pm                | 180 +++++++++++++++++-
 src/PVE/Network/SDN/Makefile                  |   3 +-
 src/PVE/Network/SDN/WireGuard.pm              | 176 +++++++++++++++++
 6 files changed, 457 insertions(+), 14 deletions(-)
 create mode 100644 src/PVE/Network/SDN/WireGuard.pm


pve-manager:

Christoph Heiss (2):
  ui: fabrics: edit: make ipv4/6 support generic over fabric panels
  ui: fabrics: interface: make ipv4/6 support generic over edit panels

Stefan Hanreich (11):
  network: sdn: generate wireguard configuration on apply
  ui: fix parsing of property-strings when values contain =
  ui: fabrics: i18n: make node loading string translatable
  sdn: fabrics view: handle case where interfaces are deleted
  ui: fabrics: split node selector creation and config
  ui: fabrics: node: make ipv4/6 support generic over edit panels
  ui: fabrics: wireguard: add interface edit panel
  ui: fabrics: wireguard: add node edit panel
  ui: fabrics: wireguard: add fabric edit panel
  ui: fabrics: hook up wireguard components
  fabrics: node edit: add option to include wireguard interfaces

 PVE/API2/Network.pm                           |   1 +
 www/manager6/Makefile                         |   3 +
 www/manager6/Parser.js                        |   7 +-
 www/manager6/sdn/FabricsView.js               |  16 +
 www/manager6/sdn/fabrics/FabricEdit.js        |  68 ++-
 www/manager6/sdn/fabrics/InterfacePanel.js    |  18 +
 www/manager6/sdn/fabrics/NodeEdit.js          | 107 +++-
 .../sdn/fabrics/openfabric/FabricEdit.js      |  32 --
 .../sdn/fabrics/openfabric/InterfacePanel.js  |  13 -
 .../sdn/fabrics/openfabric/NodeEdit.js        |  14 -
 www/manager6/sdn/fabrics/ospf/FabricEdit.js   |   2 +
 .../sdn/fabrics/ospf/InterfacePanel.js        |   2 +
 www/manager6/sdn/fabrics/ospf/NodeEdit.js     |   3 +
 .../sdn/fabrics/wireguard/FabricEdit.js       |  29 +
 .../sdn/fabrics/wireguard/InterfacePanel.js   | 518 ++++++++++++++++++
 .../sdn/fabrics/wireguard/NodeEdit.js         | 202 +++++++
 16 files changed, 941 insertions(+), 94 deletions(-)
 create mode 100644 www/manager6/sdn/fabrics/wireguard/FabricEdit.js
 create mode 100644 www/manager6/sdn/fabrics/wireguard/InterfacePanel.js
 create mode 100644 www/manager6/sdn/fabrics/wireguard/NodeEdit.js


pve-docs:

Stefan Hanreich (1):
  sdn: fabrics: add section about wireguard

 pvesdn.adoc | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)


Summary over all repositories:
  45 files changed, 3487 insertions(+), 215 deletions(-)

-- 
Generated by murpp 0.11.0




^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-05-15  5:05 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 17:31 [PATCH cluster/docs/manager/network/proxmox{-ve-rs,-perl-rs} v5 00/29] Add WireGuard as protocol to SDN fabrics Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-cluster v5 01/29] cfs: add 'priv/wg-keys.cfg' to observed files Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 02/29] sdn-types: add wireguard-specific PersistentKeepalive api type Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 03/29] ve-config: fabrics: split interface name regex into two parts Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 04/29] ve-config: fabric: refactor fabric config entry impl using macro Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 05/29] ve-config: fabrics: add protocol-specific properties for wireguard Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 06/29] ve-config: wireguard: add private keys section config Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 07/29] ve-config: sdn: fabrics: add wireguard to the fabric config Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 08/29] ve-config: fabrics: wireguard add validation for wireguard config Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-ve-rs v5 09/29] ve-config: fabrics: implement wireguard config generation Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-perl-rs v5 10/29] pve-rs: fabrics: wireguard: generate ifupdown2 configuration Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-perl-rs v5 11/29] pve-rs: fabrics: add helpers for parsing interface property strings Stefan Hanreich
2026-05-12 17:31 ` [PATCH proxmox-perl-rs v5 12/29] pve-rs: sdn: wireguard: add private keys module Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-network v5 13/29] sdn: add wireguard helper module Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-network v5 14/29] fabrics: wireguard: add schema definitions for wireguard Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-network v5 15/29] fabrics: wireguard: implement wireguard key auto-generation Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 16/29] network: sdn: generate wireguard configuration on apply Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 17/29] ui: fix parsing of property-strings when values contain = Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 18/29] ui: fabrics: i18n: make node loading string translatable Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 19/29] sdn: fabrics view: handle case where interfaces are deleted Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 20/29] ui: fabrics: split node selector creation and config Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 21/29] ui: fabrics: edit: make ipv4/6 support generic over fabric panels Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 22/29] ui: fabrics: node: make ipv4/6 support generic over edit panels Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 23/29] ui: fabrics: interface: " Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 24/29] ui: fabrics: wireguard: add interface edit panel Stefan Hanreich
2026-05-12 17:41   ` Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 25/29] ui: fabrics: wireguard: add node " Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 26/29] ui: fabrics: wireguard: add fabric " Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 27/29] ui: fabrics: hook up wireguard components Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-manager v5 28/29] fabrics: node edit: add option to include wireguard interfaces Stefan Hanreich
2026-05-12 17:31 ` [PATCH pve-docs v5 29/29] sdn: fabrics: add section about wireguard Stefan Hanreich
2026-05-12 17:38   ` Stefan Hanreich
2026-05-13  2:51 ` partially-applied: [PATCH cluster/docs/manager/network/proxmox{-ve-rs,-perl-rs} v5 00/29] Add WireGuard as protocol to SDN fabrics Thomas Lamprecht
2026-05-15  5:02 ` applied: " Thomas Lamprecht
2026-05-15  5:04 ` Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal