From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D526D1FF14C for ; Fri, 15 May 2026 12:25:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F327418678; Fri, 15 May 2026 12:25:11 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs v6 2/9] sdn: fabrics: add BGP config generation Date: Fri, 15 May 2026 12:24:53 +0200 Message-ID: <20260515102500.216264-3-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260515102500.216264-1-h.laimer@proxmox.com> References: <20260515102500.216264-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: 1778840699369 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.082 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [fabrics.rs] Message-ID-Hash: Q3PSBF3IHJHSG2BCO4XY454LMJXMNR2W X-Message-ID-Hash: Q3PSBF3IHJHSG2BCO4XY454LMJXMNR2W 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: Hannes Laimer Signed-off-by: Stefan Hanreich --- pve-rs/src/bindings/sdn/fabrics.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs index 4012bb8..074ff7e 100644 --- a/pve-rs/src/bindings/sdn/fabrics.rs +++ b/pve-rs/src/bindings/sdn/fabrics.rs @@ -32,6 +32,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 proxmox_ve_config::sdn::wireguard::WireGuardConfigBuilder; @@ -407,6 +408,15 @@ pub mod pve_rs_sdn_fabrics { } } ConfigNode::WireGuard(_) => {} + 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); + } + } + } + } } } @@ -500,6 +510,8 @@ pub mod pve_rs_sdn_fabrics { daemons.insert("fabricd"); } FabricEntry::WireGuard(_) => {} // not a frr fabric + // bgpd is enabled by default in /etc/frr/daemons + FabricEntry::Bgp(_) => {} }; } @@ -742,6 +754,22 @@ 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")?; + writeln!(interfaces, "\tip6-forward 1")?; + // BGP unnumbered uses RAs to discover peer link-local + // addresses. frr listens for them itself, but the kernel + // would otherwise install RA-derived routes we don't want. + writeln!(interfaces, "\taccept-ra 0")?; + } + } + } } } -- 2.47.3