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 01/15] frr: add VRF-aware OSPF rendering
Date: Fri, 21 Aug 2026 16:03:45 +0200	[thread overview]
Message-ID: <20260821140404.322081-2-g.goller@proxmox.com> (raw)
In-Reply-To: <20260821140404.322081-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/debian/control                      |  8 ++++----
 proxmox-frr/src/ser/mod.rs                      |  6 ++++++
 6 files changed, 28 insertions(+), 8 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/debian/control b/proxmox-frr/debian/control
index b118becedeea..183472b32d5e 100644
--- a/proxmox-frr/debian/control
+++ b/proxmox-frr/debian/control
@@ -10,8 +10,8 @@ Build-Depends-Arch: cargo:native <!nocheck>,
  librust-minijinja-2+default-dev (>= 2.5-~~) <!nocheck>,
  librust-minijinja-2+loader-dev (>= 2.5-~~) <!nocheck>,
  librust-minijinja-2+multi-template-dev (>= 2.5-~~) <!nocheck>,
- librust-proxmox-network-types-1+api-types-dev (>= 1.0.1-~~) <!nocheck>,
- librust-proxmox-network-types-1+default-dev (>= 1.0.1-~~) <!nocheck>,
+ librust-proxmox-network-types-1+api-types-dev (>= 1.1.2-~~) <!nocheck>,
+ librust-proxmox-network-types-1+default-dev (>= 1.1.2-~~) <!nocheck>,
  librust-proxmox-sdn-types-0.2+default-dev <!nocheck>,
  librust-proxmox-serde-1+default-dev <!nocheck>,
  librust-proxmox-sortable-macro-1+default-dev <!nocheck>,
@@ -36,8 +36,8 @@ Depends:
  librust-minijinja-2+default-dev (>= 2.5-~~),
  librust-minijinja-2+loader-dev (>= 2.5-~~),
  librust-minijinja-2+multi-template-dev (>= 2.5-~~),
- librust-proxmox-network-types-1+api-types-dev (>= 1.0.1-~~),
- librust-proxmox-network-types-1+default-dev (>= 1.0.1-~~),
+ librust-proxmox-network-types-1+api-types-dev (>= 1.1.2-~~),
+ librust-proxmox-network-types-1+default-dev (>= 1.1.2-~~),
  librust-proxmox-sdn-types-0.2+default-dev,
  librust-proxmox-serde-1+default-dev,
  librust-proxmox-sortable-macro-1+default-dev,
diff --git a/proxmox-frr/src/ser/mod.rs b/proxmox-frr/src/ser/mod.rs
index b651121b4a82..22c503950ba3 100644
--- a/proxmox-frr/src/ser/mod.rs
+++ b/proxmox-frr/src/ser/mod.rs
@@ -146,6 +146,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,
@@ -155,6 +157,7 @@ impl From<openfabric::OpenfabricInterface> for Interface<openfabric::OpenfabricI
         Interface {
             addresses_v4: Vec::new(),
             addresses_v6: Vec::new(),
+            vrf: None,
             properties: value,
         }
     }
@@ -165,6 +168,7 @@ impl From<ospf::OspfInterface> for Interface<ospf::OspfInterface> {
         Interface {
             addresses_v4: Vec::new(),
             addresses_v6: Vec::new(),
+            vrf: None,
             properties: value,
         }
     }
@@ -259,6 +263,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





  reply	other threads:[~2026-08-21 14:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 14:03 [RFC manager/network/proxmox{-ve-rs,-perl-rs} 00/15] SDN VRF support Gabriel Goller
2026-08-21 14:03 ` Gabriel Goller [this message]
2026-08-21 14:03 ` [PATCH proxmox-ve-rs 02/15] sdn: add zone references to OSPF and BGP fabrics Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-ve-rs 03/15] sdn: generate fabric routing configuration in zone VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-ve-rs 04/15] sdn: fix VRF route-map scoping and zone ID validation Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-ve-rs 05/15] tests: fabrics: add test for fabrics in VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-perl-rs 06/15] pve-rs: fabrics: assign network interfaces to configured VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-perl-rs 07/15] pve-rs: fabrics: make per-fabric status queries VRF-aware Gabriel Goller
2026-08-21 14:03 ` [PATCH proxmox-perl-rs 08/15] pve-rs: fabrics: include VRF routes in aggregate status Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-network 09/15] sdn: add optional VRFs for simple zones Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-network 10/15] sdn: allow fabrics to use simple zone VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-network 11/15] sdn: always generate EVPN " Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-network 12/15] api: sdn: allow EVPN zones as fabric VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-network 13/15] api: sdn: disallow BGP fabrics in EVPN zone VRFs Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-manager 14/15] ui: sdn: add VRF zone selection for fabrics Gabriel Goller
2026-08-21 14:03 ` [PATCH pve-manager 15/15] ui: sdn: expose EVPN zones as fabric VRFs 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=20260821140404.322081-2-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