From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 5013D1FF0C0 for ; Wed, 18 Nov 2026 15:41:35 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2DD1721724; Wed, 18 Nov 2026 15:41:33 +0100 (CET) Message-ID: <369bf097-711d-4e1c-bee0-70d9a64d6930@proxmox.com> Date: Wed, 18 Nov 2026 15:41:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-ve-rs v3 02/32] frr: add VRF-aware OSPF rendering To: pve-devel@lists.proxmox.com References: <20261116161154.343743-1-g.goller@proxmox.com> <20261116161154.343743-3-g.goller@proxmox.com> Content-Language: en-US From: Stefan Hanreich In-Reply-To: <20261116161154.343743-3-g.goller@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.222 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: 6CXQX4CNJNGS3DCRLS7CKVX7SSZJPYNH X-Message-ID-Hash: 6CXQX4CNJNGS3DCRLS7CKVX7SSZJPYNH 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: On 11/16/26 5:12 PM, Gabriel Goller wrote: > Add an optional VRF name and render it in the FRR interface declaration. > Keep OSPF router configuration for custom VRFs separately from the > router in the default routing table (like we do with BGP). > > Signed-off-by: Gabriel Goller > --- > proxmox-frr-templates/templates/fabricd.jinja | 2 +- > proxmox-frr-templates/templates/interface.jinja | 6 +++++- > proxmox-frr-templates/templates/isisd.jinja | 2 +- > proxmox-frr-templates/templates/ospfd.jinja | 12 +++++++++++- > proxmox-frr/src/ser/mod.rs | 6 ++++++ > 5 files changed, 24 insertions(+), 4 deletions(-) > > diff --git a/proxmox-frr-templates/templates/fabricd.jinja b/proxmox-frr-templates/templates/fabricd.jinja > index 068959a97e0e..04283180679e 100644 > --- a/proxmox-frr-templates/templates/fabricd.jinja > +++ b/proxmox-frr-templates/templates/fabricd.jinja > @@ -6,7 +6,7 @@ router openfabric {{ router_name }} > exit > {% endfor %} > {% for interface_name, interface_config in openfabric.interfaces|items %} > -{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6) %} > +{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6, interface_config.vrf) %} > {% if interface_config.fabric_id and interface_config.is_ipv4 %} > ip router openfabric {{ interface_config.fabric_id }} > {% endif %} > diff --git a/proxmox-frr-templates/templates/interface.jinja b/proxmox-frr-templates/templates/interface.jinja > index 4c5014844fc8..e52b05681bb8 100644 > --- a/proxmox-frr-templates/templates/interface.jinja > +++ b/proxmox-frr-templates/templates/interface.jinja > @@ -1,6 +1,10 @@ > -{% macro interface(name, addresses_v4, addresses_v6) %} > +{% macro interface(name, addresses_v4, addresses_v6, vrf) %} > ! > +{% if vrf %} > +interface {{ name }} vrf {{ vrf }} > +{% else %} > interface {{ name }} > +{% endif %} > {% for address in addresses_v6 %} > ipv6 address {{address}} > {% endfor %} > diff --git a/proxmox-frr-templates/templates/isisd.jinja b/proxmox-frr-templates/templates/isisd.jinja > index e3c9292d575c..2d369d75eee6 100644 > --- a/proxmox-frr-templates/templates/isisd.jinja > +++ b/proxmox-frr-templates/templates/isisd.jinja > @@ -20,7 +20,7 @@ router isis {{ router_name }} > exit > {% endfor %} > {% for interface_name, interface_config in isis.interfaces|items %} > -{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6) %} > +{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6, interface_config.vrf) %} > {% if interface_config.domain and interface_config.is_ipv4 %} > ip router isis {{ interface_config.domain }} > {% endif %} > diff --git a/proxmox-frr-templates/templates/ospfd.jinja b/proxmox-frr-templates/templates/ospfd.jinja > index 427ed7f9ddb4..5d440f2ff663 100644 > --- a/proxmox-frr-templates/templates/ospfd.jinja > +++ b/proxmox-frr-templates/templates/ospfd.jinja > @@ -9,8 +9,18 @@ router ospf > {% endfor %} > exit > {% endif %} > +{% for vrf_name, router in ospf.vrf_router|items %} > +! > +router ospf vrf {{ vrf_name }} > + ospf router-id {{ router.router_id }} > +{% for redistribution in router.redistribute %} > + redistribute {{ redistribution.source }}{% if redistribution.metric is defined %} metric {{ redistribution.metric }}{% endif %}{% if redistribution.route_map is defined %} route-map {{ redistribution.route_map }}{% endif %} > + > +{% endfor %} > +exit > +{% endfor %} > {% for interface_name, interface_config in ospf.interfaces|items %} > -{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6) %} > +{% call interface(interface_name, interface_config.addresses_v4, interface_config.addresses_v6, interface_config.vrf) %} > ip ospf area {{ interface_config.area }} > {% if interface_config.passive %} > ip ospf passive > diff --git a/proxmox-frr/src/ser/mod.rs b/proxmox-frr/src/ser/mod.rs > index 0f2b52138cf3..cd3025213fb9 100644 > --- a/proxmox-frr/src/ser/mod.rs > +++ b/proxmox-frr/src/ser/mod.rs > @@ -135,6 +135,8 @@ pub struct Interface { > pub addresses_v4: Vec, > #[serde(default)] > pub addresses_v6: Vec, > + #[serde(default)] > + pub vrf: Option, would it be better to add this to the concrete interface types that actually support it? > > #[serde(flatten)] > pub properties: T, > @@ -144,6 +146,7 @@ impl From for Interface Interface { > addresses_v4: Vec::new(), > addresses_v6: Vec::new(), > + vrf: None, instead of setting it to None for protocols where it isn't supported? > properties: value, > } > } > @@ -154,6 +157,7 @@ impl From for Interface { > Interface { > addresses_v4: Vec::new(), > addresses_v6: Vec::new(), > + vrf: None, > properties: value, > } > } > @@ -248,6 +252,8 @@ pub struct OspfFrrConfig { > #[serde(default)] > pub router: Option, > #[serde(default)] > + pub vrf_router: BTreeMap, can we handle this the same as in BGP where the default VRF is just an entry in the map? > + #[serde(default)] > pub interfaces: BTreeMap>, > } >