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 B0FDC1FF0BC for ; Mon, 16 Nov 2026 17:13:59 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 120E920496; Mon, 16 Nov 2026 17:12:47 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v3 17/32] sdn: require underlay fabrics to use the default VRF Date: Mon, 16 Nov 2026 17:11:37 +0100 Message-ID: <20261116161154.343743-18-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116161154.343743-1-g.goller@proxmox.com> References: <20261116161154.343743-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794845520976 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.227 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: 47E6NAPHGLD4JEE7J3IENBWPKLTJI65S X-Message-ID-Hash: 47E6NAPHGLD4JEE7J3IENBWPKLTJI65S X-MailFrom: g.goller@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: EVPN controllers and VXLAN zones set up their VTEPs and BGP peering in the default VRF, so an underlay fabric in a zone VRF breaks them. A fabric's VRF cannot change after creation, so checking the fabric when a controller or zone references it is enough. Signed-off-by: Gabriel Goller --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 2 ++ src/PVE/Network/SDN/Fabrics.pm | 10 ++++++++++ src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 4220cb6721e5..67afe936ecc9 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -688,6 +688,8 @@ sub on_update_hook { die "must have exactly one of peers / fabric defined" if ($controller->{peers} && $controller->{fabric}) || !($controller->{peers} || $controller->{fabric}); + PVE::Network::SDN::Fabrics::assert_underlay_fabric($controller->{fabric}) + if $controller->{fabric}; if ($controller->{peers}) { my @peers = PVE::Tools::split_list($controller->{peers}); my $family; diff --git a/src/PVE/Network/SDN/Fabrics.pm b/src/PVE/Network/SDN/Fabrics.pm index e7cec1fe9582..a9ea0b74301e 100644 --- a/src/PVE/Network/SDN/Fabrics.pm +++ b/src/PVE/Network/SDN/Fabrics.pm @@ -246,6 +246,16 @@ sub assert_fabric_nodes_in_zone { } } +sub assert_underlay_fabric { + my ($fabric_id) = @_; + + my $fabric = eval { config()->get_fabric($fabric_id) }; + die "fabric '$fabric_id' does not exist\n" if !$fabric; + die "fabric '$fabric_id' is in the VRF of zone '$fabric->{zone}', underlay fabrics must use" + . " the default VRF\n" + if $fabric->{zone}; +} + sub get_frr_daemon_status { my ($fabric_config) = @_; diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index b8b1ef0eeb7f..059bc90f4211 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -167,6 +167,11 @@ sub on_update_hook { fabric => "must have exactly one of peers / fabric defined", }); } + + if ($zone->{fabric}) { + eval { PVE::Network::SDN::Fabrics::assert_underlay_fabric($zone->{fabric}) }; + raise_param_exc({ fabric => "$@" }) if $@; + } } sub vnet_update_hook { -- 2.47.3