public inbox for pve-devel@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 08/32] sdn: support static routes in EVPN zone VRFs
Date: Mon, 16 Nov 2026 17:11:28 +0100	[thread overview]
Message-ID: <20261116161154.343743-9-g.goller@proxmox.com> (raw)
In-Reply-To: <20261116161154.343743-1-g.goller@proxmox.com>

Allow EVPN zones to reach networks behind appliances or external routers
using the same zone-wide static routes as simple zones. EVPN routes
always belong to vrf_<zone>, without requiring the dedicated-vrf option
used by simple zones.

Generate routes on all nodes that belong to the zone, not just exit
nodes. This does not enable redistribution of static routes, so adding
a route does not by itself advertise it to other nodes.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 proxmox-ve-config/src/sdn/static_route.rs     | 11 +++--
 proxmox-ve-config/tests/static_routes/main.rs | 40 ++++++++++++++++++-
 ...tatic_routes__evpn_zone_routes_to_frr.snap | 12 ++++++
 3 files changed, 56 insertions(+), 7 deletions(-)
 create mode 100644 proxmox-ve-config/tests/static_routes/snapshots/static_routes__evpn_zone_routes_to_frr.snap

diff --git a/proxmox-ve-config/src/sdn/static_route.rs b/proxmox-ve-config/src/sdn/static_route.rs
index eab6300374ff..0a5e0b3939f4 100644
--- a/proxmox-ve-config/src/sdn/static_route.rs
+++ b/proxmox-ve-config/src/sdn/static_route.rs
@@ -1,4 +1,4 @@
-//! Static routes stored as repeatable property strings in simple SDN zones.
+//! Static routes stored as repeatable property strings in Simple and EVPN SDN zones.
 
 use std::collections::BTreeMap;
 use std::net::IpAddr;
@@ -22,7 +22,7 @@ use crate::sdn::fabric::section_config::interface::InterfaceName;
 )]
 #[derive(Clone, Debug, Serialize, Deserialize)]
 #[serde(rename_all = "kebab-case", deny_unknown_fields)]
-/// A static route in a simple zone. The destination VRF is determined by the zone.
+/// A static route in a Simple or EVPN zone. The destination VRF is determined by the zone.
 pub struct StaticRoute {
     /// Destination prefix, including 0.0.0.0/0 or ::/0 for a default route.
     pub prefix: Cidr,
@@ -119,8 +119,8 @@ impl ZoneRoutesConfig {
             if config.route.is_empty() {
                 continue;
             }
-            if config.ty != "simple" {
-                bail!("static routes are only supported in simple zones (zone '{zone}')");
+            if !matches!(config.ty.as_str(), "simple" | "evpn") {
+                bail!("static routes are only supported in Simple and EVPN zones (zone '{zone}')");
             }
             if config
                 .nodes
@@ -129,8 +129,7 @@ impl ZoneRoutesConfig {
             {
                 continue;
             }
-            let destination_vrf = config
-                .dedicated_vrf
+            let destination_vrf = (config.ty == "evpn" || config.dedicated_vrf)
                 .then(|| FrrInterfaceName::try_from(format!("vrf_{zone}")))
                 .transpose()?;
             for route in &config.route {
diff --git a/proxmox-ve-config/tests/static_routes/main.rs b/proxmox-ve-config/tests/static_routes/main.rs
index a0daf38449ff..f198a3bf3353 100644
--- a/proxmox-ve-config/tests/static_routes/main.rs
+++ b/proxmox-ve-config/tests/static_routes/main.rs
@@ -59,6 +59,44 @@ fn simple_zone_routes_to_frr() -> Result<(), Error> {
     Ok(())
 }
 
+#[test]
+fn evpn_zone_routes_to_frr() -> Result<(), Error> {
+    let zones: ZoneRoutesConfig = serde_json::from_value(json!({"ids": {
+        "blue": {
+            "type": "evpn",
+            "nodes": {"pve1": 1, "pve2": 1},
+            "exitnodes": {"pve1": 1},
+            "route": [
+                "prefix=0.0.0.0/0,via=10.10.0.2",
+                "prefix=172.20.0.0/16,via=192.0.2.1,distance=200,nexthop-vrf=default",
+                "prefix=::/0,via=fe80::1,iface=vnetblue",
+                "prefix=198.51.100.0/24,iface=uplink0"
+            ]
+        },
+        "disabled": {
+            "type": "evpn",
+            "nodes": {},
+            "route": ["prefix=192.0.2.0/24,iface=unused0"]
+        }
+    }}))?;
+    let config = FrrConfig {
+        ip_routes: zones.routes_for_node("pve1")?,
+        ..Default::default()
+    };
+    // EVPN always uses the zone VRF, without requiring the Simple-only dedicated-vrf flag.
+    let output = dump(&config)?;
+    insta::assert_snapshot!(output);
+
+    // Routes apply to every zone node, not just exit nodes. FRR resolves local interfaces.
+    let other = FrrConfig {
+        ip_routes: zones.routes_for_node("pve2")?,
+        ..Default::default()
+    };
+    assert_eq!(dump(&other)?, output);
+    assert!(zones.routes_for_node("pve3")?.is_empty());
+    Ok(())
+}
+
 #[test]
 fn validate_route_properties() {
     for value in [
@@ -109,7 +147,7 @@ fn validate_route_properties() {
 
 #[test]
 fn reject_routes_in_other_zone_types() -> Result<(), Error> {
-    for ty in ["vlan", "qinq", "vxlan", "evpn", "faucet"] {
+    for ty in ["vlan", "qinq", "vxlan", "faucet"] {
         let zones: ZoneRoutesConfig = serde_json::from_value(json!({"ids": {
             "zone1": {"type": ty, "route": ["prefix=0.0.0.0/0,via=192.0.2.1"]}
         }}))?;
diff --git a/proxmox-ve-config/tests/static_routes/snapshots/static_routes__evpn_zone_routes_to_frr.snap b/proxmox-ve-config/tests/static_routes/snapshots/static_routes__evpn_zone_routes_to_frr.snap
new file mode 100644
index 000000000000..0301559a6d77
--- /dev/null
+++ b/proxmox-ve-config/tests/static_routes/snapshots/static_routes__evpn_zone_routes_to_frr.snap
@@ -0,0 +1,12 @@
+---
+source: proxmox-ve-config/tests/static_routes/main.rs
+expression: output
+---
+!
+ip route 0.0.0.0/0 10.10.0.2 vrf vrf_blue
+!
+ip route 172.20.0.0/16 192.0.2.1 200 nexthop-vrf default vrf vrf_blue
+!
+ipv6 route ::/0 fe80::1 vnetblue vrf vrf_blue
+!
+ip route 198.51.100.0/24 uplink0 vrf vrf_blue
-- 
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 ` [PATCH proxmox-ve-rs v3 02/32] frr: add VRF-aware OSPF rendering Gabriel Goller
2026-11-18 14:41   ` 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 ` Gabriel Goller [this message]
2026-11-18 15:32   ` [PATCH proxmox-ve-rs v3 08/32] sdn: support static routes in EVPN " 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-9-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal