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 E1C3B1FF136 for ; Mon, 04 May 2026 18:06:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 020232C92; Mon, 4 May 2026 18:04:58 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-ve-rs v4 18/47] fabrics: ospf: openfabric: allow user-defined route filter Date: Mon, 4 May 2026 18:03:15 +0200 Message-ID: <20260504160350.395470-19-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260504160350.395470-1-s.hanreich@proxmox.com> References: <20260504160350.395470-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777910533977 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.673 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: AX25LMOKUFBF4TWU4Y65EIQF3KS7MEL7 X-Message-ID-Hash: AX25LMOKUFBF4TWU4Y65EIQF3KS7MEL7 X-MailFrom: s.hanreich@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: This property allows overriding the auto-generated filter for fabrics, which would only install routes from the configured IP prefix into the kernel routing table. It allows specifying a custom prefix list, that is used for filtering the routes installed by zebra into the kernel routing table. It does not affect which routes get announced via OSPF / Openfabric. Signed-off-by: Stefan Hanreich --- proxmox-ve-config/src/sdn/fabric/mod.rs | 19 ++++++++++++++++++- .../section_config/protocol/openfabric.rs | 8 ++++++++ .../fabric/section_config/protocol/ospf.rs | 11 ++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/proxmox-ve-config/src/sdn/fabric/mod.rs b/proxmox-ve-config/src/sdn/fabric/mod.rs index 677a309..ab369ec 100644 --- a/proxmox-ve-config/src/sdn/fabric/mod.rs +++ b/proxmox-ve-config/src/sdn/fabric/mod.rs @@ -655,6 +655,7 @@ impl FabricConfig { OpenfabricPropertiesUpdater { hello_interval, csnp_interval, + route_filter, }, delete, } = updater; @@ -675,6 +676,10 @@ impl FabricConfig { fabric_section.properties.csnp_interval = Some(csnp_interval); } + if let Some(route_filter) = route_filter { + fabric_section.properties.route_filter = Some(route_filter); + } + for property in delete { match property { FabricDeletableProperties::IpPrefix => { @@ -689,6 +694,9 @@ impl FabricConfig { FabricDeletableProperties::Protocol( OpenfabricDeletableProperties::HelloInterval, ) => fabric_section.properties.hello_interval = None, + FabricDeletableProperties::Protocol( + OpenfabricDeletableProperties::RouteFilter, + ) => fabric_section.properties.route_filter = None, } } @@ -698,7 +706,7 @@ impl FabricConfig { let FabricSectionUpdater:: { ip_prefix, ip6_prefix, - properties: OspfPropertiesUpdater { area }, + properties: OspfPropertiesUpdater { area, route_filter }, delete, } = updater; @@ -714,6 +722,10 @@ impl FabricConfig { fabric_section.properties.area = area; } + if let Some(route_filter) = route_filter { + fabric_section.properties.route_filter = Some(route_filter); + } + for property in delete { match property { FabricDeletableProperties::IpPrefix => { @@ -722,6 +734,11 @@ impl FabricConfig { FabricDeletableProperties::Ip6Prefix => { fabric_section.ip6_prefix = None; } + FabricDeletableProperties::Protocol( + OspfDeletableProperties::RouteFilter, + ) => { + fabric_section.properties.route_filter = None; + } } } diff --git a/proxmox-ve-config/src/sdn/fabric/section_config/protocol/openfabric.rs b/proxmox-ve-config/src/sdn/fabric/section_config/protocol/openfabric.rs index c68147d..7e55375 100644 --- a/proxmox-ve-config/src/sdn/fabric/section_config/protocol/openfabric.rs +++ b/proxmox-ve-config/src/sdn/fabric/section_config/protocol/openfabric.rs @@ -11,6 +11,7 @@ use crate::sdn::fabric::section_config::fabric::FabricSection; use crate::sdn::fabric::section_config::interface::InterfaceName; use crate::sdn::fabric::section_config::node::NodeSection; use crate::sdn::fabric::FabricConfigError; +use crate::sdn::prefix_list::PrefixListId; /// Protocol-specific options for an OpenFabric Fabric. #[api] @@ -26,6 +27,12 @@ pub struct OpenfabricProperties { /// Packets (CSNP) interval in seconds. The interval range is 1 to 600. #[serde(skip_serializing_if = "Option::is_none")] pub(crate) csnp_interval: Option, + + /// By default only routes from the configured IP prefix are imported into the local routing + /// table. This setting can be used to override the allowed IPs and import additional routes + /// besides the configured IP prefix. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) route_filter: Option, } impl Validatable for FabricSection { @@ -48,6 +55,7 @@ impl Validatable for FabricSection { pub enum OpenfabricDeletableProperties { HelloInterval, CsnpInterval, + RouteFilter, } /// Properties for an OpenFabric node diff --git a/proxmox-ve-config/src/sdn/fabric/section_config/protocol/ospf.rs b/proxmox-ve-config/src/sdn/fabric/section_config/protocol/ospf.rs index fcec5df..793e536 100644 --- a/proxmox-ve-config/src/sdn/fabric/section_config/protocol/ospf.rs +++ b/proxmox-ve-config/src/sdn/fabric/section_config/protocol/ospf.rs @@ -11,6 +11,7 @@ use crate::sdn::fabric::section_config::fabric::FabricSection; use crate::sdn::fabric::section_config::interface::InterfaceName; use crate::sdn::fabric::section_config::node::NodeSection; use crate::sdn::fabric::FabricConfigError; +use crate::sdn::prefix_list::PrefixListId; #[api] #[derive(Debug, Clone, Serialize, Deserialize, Updater, Hash)] @@ -18,6 +19,12 @@ use crate::sdn::fabric::FabricConfigError; pub struct OspfProperties { /// OSPF area pub(crate) area: Area, + + /// By default only routes from the configured IP prefix are imported into the local routing + /// table. This setting can be used to override the allowed IPs and import additional routes + /// besides the configured IP prefix. + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) route_filter: Option, } impl OspfProperties { @@ -51,7 +58,9 @@ impl Validatable for FabricSection { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] -pub enum OspfDeletableProperties {} +pub enum OspfDeletableProperties { + RouteFilter, +} #[api( properties: { -- 2.47.3