all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-ve-rs v3 02/32] frr: add VRF-aware OSPF rendering
Date: Mon, 16 Nov 2026 17:11:22 +0100	[thread overview]
Message-ID: <20261116161154.343743-3-g.goller@proxmox.com> (raw)
In-Reply-To: <20261116161154.343743-1-g.goller@proxmox.com>

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 <g.goller@proxmox.com>
---
 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<T> {
     pub addresses_v4: Vec<Ipv4Cidr>,
     #[serde(default)]
     pub addresses_v6: Vec<Ipv6Cidr>,
+    #[serde(default)]
+    pub vrf: Option<VrfName>,
 
     #[serde(flatten)]
     pub properties: T,
@@ -144,6 +146,7 @@ impl From<openfabric::OpenfabricInterface> for Interface<openfabric::OpenfabricI
         Interface {
             addresses_v4: Vec::new(),
             addresses_v6: Vec::new(),
+            vrf: None,
             properties: value,
         }
     }
@@ -154,6 +157,7 @@ impl From<ospf::OspfInterface> for Interface<ospf::OspfInterface> {
         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<ospf::OspfRouter>,
     #[serde(default)]
+    pub vrf_router: BTreeMap<VrfName, ospf::OspfRouter>,
+    #[serde(default)]
     pub interfaces: BTreeMap<InterfaceName, Interface<ospf::OspfInterface>>,
 }
 
-- 
2.47.3





  parent reply	other threads:[~2026-11-16 16:12 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:11 [PATCH common/manager/network/proxmox{-ve-rs,-perl-rs,-widget-toolkit} v3 00/32] SDN VRF support Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-common v3 01/32] interfaces: preserve VRF membership across address family changes Gabriel Goller
2026-11-18 14:13   ` Stefan Hanreich
2026-11-18 15:41     ` Gabriel Goller
2026-11-16 16:11 ` Gabriel Goller [this message]
2026-11-18 14:41   ` [PATCH proxmox-ve-rs v3 02/32] frr: add VRF-aware OSPF rendering Stefan Hanreich
2026-11-18 16:21     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 03/32] sdn: add zone references to OSPF and BGP fabrics Gabriel Goller
2026-11-18 14:10   ` Stefan Hanreich
2026-11-18 16:55     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 04/32] sdn: generate fabric routing configuration in zone VRFs Gabriel Goller
2026-11-18 14:53   ` Stefan Hanreich
2026-11-18 17:26     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 05/32] sdn: fix VRF route-map scoping and zone ID validation Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 06/32] tests: fabrics: add test for fabrics in VRFs Gabriel Goller
2026-11-18 15:01   ` Stefan Hanreich
2026-11-18 17:33     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 07/32] sdn: allow static routes in simple zone VRFs Gabriel Goller
2026-11-18 15:29   ` Stefan Hanreich
2026-11-18 18:10     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-ve-rs v3 08/32] sdn: support static routes in EVPN " Gabriel Goller
2026-11-18 15:32   ` Stefan Hanreich
2026-11-19 13:12     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-perl-rs v3 09/32] pve-rs: fabrics: assign network interfaces to configured VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-perl-rs v3 10/32] pve-rs: fabrics: make per-fabric status queries VRF-aware Gabriel Goller
2026-11-18 15:42   ` Stefan Hanreich
2026-11-19 13:30     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-perl-rs v3 11/32] pve-rs: fabrics: include VRF routes in aggregate status Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-perl-rs v3 12/32] pve-rs: fabrics: expose host interface membership Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-perl-rs v3 13/32] sdn: expose static routes for simple zone uplinks Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 14/32] sdn: evpn: add unreachable IPv6 default route to zone VRFs Gabriel Goller
2026-11-18 16:08   ` Stefan Hanreich
2026-11-18 16:39     ` Stefan Hanreich
2026-11-19 13:38       ` Gabriel Goller
2026-11-19 15:51         ` Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 15/32] sdn: add optional VRFs for simple zones Gabriel Goller
2026-11-18 16:18   ` Stefan Hanreich
2026-11-19 13:44     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 16/32] sdn: allow fabrics to use simple zone VRFs Gabriel Goller
2026-11-18 16:27   ` Stefan Hanreich
2026-11-19 14:14     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 17/32] sdn: require underlay fabrics to use the default VRF Gabriel Goller
2026-11-18 16:30   ` Stefan Hanreich
2026-11-19 14:33     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 18/32] sdn: always generate EVPN zone VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 19/32] api: sdn: allow EVPN zones as fabric VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 20/32] api: sdn: disallow BGP fabrics in EVPN zone VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 21/32] sdn: simple: support static routes in zone routing tables Gabriel Goller
2026-11-18 16:49   ` Stefan Hanreich
2026-11-19 14:53     ` Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 22/32] sdn: evpn: allow static routes Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 23/32] sdn: zones: SNAT via dedicated uplinks in zone VRFs Gabriel Goller
2026-11-18 18:07   ` Stefan Hanreich
2026-11-16 16:11 ` [PATCH pve-network v3 24/32] sdn: dhcp: only configure DHCP for zones on the local node Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-network v3 25/32] sdn: dhcp: run dnsmasq in the zone VRF Gabriel Goller
2026-11-16 16:11 ` [PATCH proxmox-widget-toolkit v3 26/32] ui: network: allow selecting a VRF for host interfaces Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 27/32] ui: sdn: add VRF zone selection for fabrics Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 28/32] ui: sdn: expose EVPN zones as fabric VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 29/32] network: allow setting the VRF of host interfaces Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 30/32] ui: sdn: allow static routes for Simple zone VRFs Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 31/32] ui: sdn: allow static routes in EVPN zones Gabriel Goller
2026-11-16 16:11 ` [PATCH pve-manager v3 32/32] network: generate SDN DHCP config after ifreload Gabriel Goller
2026-11-18 18:27 ` [PATCH common/manager/network/proxmox{-ve-rs,-perl-rs,-widget-toolkit} v3 00/32] SDN VRF support Stefan Hanreich
2026-11-19 15:33   ` Gabriel Goller
2026-11-19 20:10 ` Gabriel Goller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116161154.343743-3-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal