public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [RFC network 0/2] sdn: frr: add append-only custom user config
@ 2026-07-01 10:30 Gabriel Goller
  2026-07-01 10:30 ` [PATCH pve-network 1/2] sdn: frr: add append-only custom frr config Gabriel Goller
  2026-07-01 10:30 ` [PATCH pve-network 2/2] tests: cover FRR append config files Gabriel Goller
  0 siblings, 2 replies; 3+ messages in thread
From: Gabriel Goller @ 2026-07-01 10:30 UTC (permalink / raw)
  To: pve-devel

This RFC adds an append-only mechanism for custom FRR configuration via
/etc/frr/frr.conf.d/*.conf.

Users sometimes need FRR configuration that SDN does not model yet. Editing
/etc/frr/frr.conf directly is not useful because it is generated, while
frr.conf.local is parsed and merged into the generated config, which can fail
for unsupported constructs.

The proposed approach copies snippets from /etc/frr/frr.conf.d/*.conf in sorted
filename order after the fully generated SDN FRR config, including Rust-generated
fabric config, and before the final line vty stanza. The snippets are copied as
raw config without parsing or modifying their content.

Each appended snippet is wrapped in marker comments in the installed config.
Those markers are also checked in the active /etc/frr/frr.conf so that removing
the last snippet, or the whole frr.conf.d directory, still triggers an FRR
rewrite and cleans up stale appended config. (This is not the case right now
with the frr.conf.local file, but we can't change this because that would be
breaking.)

Before replacing /etc/frr/frr.conf, the full candidate config is validated with
vtysh -C -f. On validation failure, the reload fails and shows the error. We
need this because previously with the frr.conf.local the merging code provided
some sort of syntax-checking and simply didn't merge code that did not match
the syntax.

Open questions for the RFC:
* Is append-only custom config the right user-facing model? Do we want to go all
  out with the user-editable templates?
* Is this possible/should we do this completely in rust? (perl-rs)
* Is /etc/frr/frr.conf.d/*.conf the right path and naming scheme?
* Is checking installed marker comments the right cleanup trigger?


pve-network:

Gabriel Goller (2):
  sdn: frr: add append-only custom frr config
  tests: cover FRR append config files

 src/PVE/Network/SDN.pm                        |  26 +++-
 src/PVE/Network/SDN/Frr.pm                    | 115 ++++++++++++++++--
 src/test/run_test_zones.pl                    |  53 ++++++++
 .../expected_controller_config                |   4 +
 .../evpn/auto_mode/expected_controller_config |   4 +
 .../evpn/bgp_ebgp/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../bgp_fabric/expected_controller_config     |   4 +
 .../bgp_loopback/expected_controller_config   |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../evpn/ebgp/expected_controller_config      |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../ebgp_loopback/expected_controller_config  |   4 +
 .../evpn/ebgp_only/expected_controller_config |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../evpn/exitnode/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../exitnode_snat/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../evpn/ipv4/expected_controller_config      |  10 ++
 .../zones/evpn/ipv4/frr.conf.d/00-empty.conf  |   0
 .../zones/evpn/ipv4/frr.conf.d/10-custom.conf |   1 +
 .../evpn/ipv4ipv6/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../evpn/ipv6/expected_controller_config      |   4 +
 .../ipv6underlay/expected_controller_config   |   4 +
 .../evpn/isis/expected_controller_config      |   4 +
 .../isis_loopback/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../multiplezones/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../ospf_fabric/expected_controller_config    |   4 +
 .../evpn/routemap/expected_controller_config  |   4 +
 .../expected_controller_config                |   4 +
 .../expected_controller_config                |   4 +
 .../evpn/rt_import/expected_controller_config |   4 +
 .../evpn/vxlanport/expected_controller_config |   4 +
 51 files changed, 374 insertions(+), 11 deletions(-)
 create mode 100644 src/test/zones/evpn/ipv4/frr.conf.d/00-empty.conf
 create mode 100644 src/test/zones/evpn/ipv4/frr.conf.d/10-custom.conf


Summary over all repositories:
  51 files changed, 374 insertions(+), 11 deletions(-)

-- 
Generated by murpp 0.11.0




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

end of thread, other threads:[~2026-07-01 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 10:30 [RFC network 0/2] sdn: frr: add append-only custom user config Gabriel Goller
2026-07-01 10:30 ` [PATCH pve-network 1/2] sdn: frr: add append-only custom frr config Gabriel Goller
2026-07-01 10:30 ` [PATCH pve-network 2/2] tests: cover FRR append config files Gabriel Goller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal