From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B41241FF13A for ; Wed, 15 Apr 2026 13:12:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 47977F8C6; Wed, 15 Apr 2026 13:12:14 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v2 2/7] sdn: fabrics: add BGP config generation Date: Wed, 15 Apr 2026 13:11:29 +0200 Message-ID: <20260415111134.124720-3-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260415111134.124720-1-h.laimer@proxmox.com> References: <20260415111134.124720-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776251423339 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.084 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: RFRPXK556U7P6IO6SVEQ5MKPRBOVLKAV X-Message-ID-Hash: RFRPXK556U7P6IO6SVEQ5MKPRBOVLKAV X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Stefan Hanreich Add BGP support to the fabric config generation pipeline. This includes interface name mapping and network interface output for BGP unnumbered links. Co-authored-by: Hannes Laimer Signed-off-by: Stefan Hanreich Signed-off-by: Hannes Laimer --- pve-rs/src/bindings/sdn/fabrics.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs index 18848c4..15dfee8 100644 --- a/pve-rs/src/bindings/sdn/fabrics.rs +++ b/pve-rs/src/bindings/sdn/fabrics.rs @@ -31,6 +31,7 @@ pub mod pve_rs_sdn_fabrics { }; use proxmox_ve_config::sdn::fabric::section_config::interface::InterfaceName; use proxmox_ve_config::sdn::fabric::section_config::node::{Node as ConfigNode, NodeId}; + use proxmox_ve_config::sdn::fabric::section_config::protocol::bgp::BgpNode; use proxmox_ve_config::sdn::fabric::{FabricConfig, FabricEntry}; use crate::sdn::status::{self, RunningConfig}; @@ -361,6 +362,15 @@ pub mod pve_rs_sdn_fabrics { } } } + ConfigNode::Bgp(node_section) => { + if let BgpNode::Internal(properties) = node_section.properties_mut() { + for interface in properties.interfaces_mut() { + if let Some(mapped_name) = map_name(&mapping, interface.name())? { + interface.set_name(mapped_name); + } + } + } + } } } @@ -453,6 +463,8 @@ pub mod pve_rs_sdn_fabrics { FabricEntry::Openfabric(_) => { daemons.insert("fabricd"); } + // bgpd is enabled by default in /etc/frr/daemons + FabricEntry::Bgp(_) => {} }; } @@ -567,6 +579,17 @@ pub mod pve_rs_sdn_fabrics { } } } + ConfigNode::Bgp(node_section) => { + if let BgpNode::Internal(properties) = node_section.properties() { + for interface in properties.interfaces() { + let name = interface.name(); + writeln!(interfaces)?; + writeln!(interfaces, "auto {name}")?; + writeln!(interfaces, "iface {name} inet manual")?; + writeln!(interfaces, "\tip-forward 1")?; + } + } + } } } -- 2.47.3