From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 2A7611FF0B0 for ; Fri, 23 Oct 2026 11:33:31 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BA43221635; Fri, 23 Oct 2026 11:33:30 +0200 (CEST) Date: Fri, 23 Oct 2026 11:33:26 +0200 From: Gabriel Goller To: Stefan Hanreich Subject: Re: [PATCH proxmox-perl-rs 06/15] pve-rs: fabrics: assign network interfaces to configured VRFs Message-ID: References: <20260821140404.322081-1-g.goller@proxmox.com> <20260821140404.322081-7-g.goller@proxmox.com> <85270a59-b3f8-4c23-868b-56c4dd5d0302@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <85270a59-b3f8-4c23-868b-56c4dd5d0302@proxmox.com> User-Agent: NeoMutt/20260504 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792748007439 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.252 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: HVVPWRMEVVKJAUITN6XGV2A7BZS75VCP X-Message-ID-Hash: HVVPWRMEVVKJAUITN6XGV2A7BZS75VCP X-MailFrom: g.goller@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 21.10.2026 18:14, Stefan Hanreich wrote: > On 8/21/26 4:04 PM, Gabriel Goller wrote: > > Add the VRF stanza to generated interface configuration when a fabric > > has a VRF. Apply it to dummy addresses, protocol interfaces, and BGP > > unnumbered interfaces so traffic enters the correct routing table. > > > > Fabrics without a VRF keep their existing configuration. > > > > Signed-off-by: Gabriel Goller > > --- > > pve-rs/src/bindings/sdn/fabrics.rs | 69 +++++++++++++++++++++++------- > > 1 file changed, 53 insertions(+), 16 deletions(-) > > > > diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs > > index f96b6b1c656f..98470eeaa397 100644 > > --- a/pve-rs/src/bindings/sdn/fabrics.rs > > +++ b/pve-rs/src/bindings/sdn/fabrics.rs > > @@ -582,8 +582,23 @@ pub mod pve_rs_sdn_fabrics { > > Ok(interface) > > } > > > > + pub(crate) fn fabric_vrf_name(fabric: &FabricEntry) -> Option { > > + let zone = match fabric { > > + FabricEntry::Ospf(entry) => entry.fabric_section().properties().zone(), > > + FabricEntry::Bgp(entry) => entry.fabric_section().properties().zone(), > > + FabricEntry::Openfabric(_) | FabricEntry::WireGuard(_) => None, > > + }; > > + > > + zone.map(|zone| format!("vrf_{zone}")) > > + } > > + > > nit: maybe better as a method on the fabric config itself? Although I suppose it could be > argued that it's not the decision of the config how the VRF should be named. Makes sense, done. Thanks for the review! > > /// Helper function to generate the default `/etc/network/interfaces` config for a given CIDR. > > - fn render_interface(name: &str, cidr: Cidr, link_type: Option<&str>) -> Result { > > + fn render_interface( > > + name: &str, > > + cidr: Cidr, > > + link_type: Option<&str>, > > + vrf: Option<&str>, > > + ) -> Result { > > let mut interface = String::new(); > > > > writeln!(interface, "auto {name}")?; > > @@ -595,6 +610,9 @@ pub mod pve_rs_sdn_fabrics { > > if let Some(link_type) = link_type { > > writeln!(interface, "\tlink-type {link_type}")?; > > } > > + if let Some(vrf) = vrf { > > + writeln!(interface, "\tvrf {vrf}")?; > > + } > > writeln!(interface, "\tip-forward 1")?; > > > > Ok(interface) > > [snip]