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 D98B41FF140 for ; Fri, 27 Mar 2026 16:10:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 239F711476; Fri, 27 Mar 2026 16:10:41 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs 1/2] sdn: fabrics: add BGP config generation Date: Fri, 27 Mar 2026 16:10:27 +0100 Message-ID: <20260327151031.149360-3-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260327151031.149360-1-h.laimer@proxmox.com> References: <20260327151031.149360-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: 1774624186951 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.081 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: HQTGGNEYSVHSDEZ3FZQUW7DZH6SVVDIF X-Message-ID-Hash: HQTGGNEYSVHSDEZ3FZQUW7DZH6SVVDIF 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: 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: 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..8af4f3f 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"); } + // enabled by the frr package + 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