From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 493551FF0DE for ; Thu, 19 Nov 2026 14:44:53 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3637A216AC; Thu, 19 Nov 2026 14:44:52 +0100 (CET) Date: Thu, 19 Nov 2026 14:44:46 +0100 From: Gabriel Goller To: Stefan Hanreich Subject: Re: [PATCH pve-network v3 15/32] sdn: add optional VRFs for simple zones Message-ID: References: <20261116161154.343743-1-g.goller@proxmox.com> <20261116161154.343743-16-g.goller@proxmox.com> <4fd4b511-43f7-4cde-80c6-dd387280517c@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4fd4b511-43f7-4cde-80c6-dd387280517c@proxmox.com> User-Agent: NeoMutt/20260616 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795095887516 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.229 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: OB2RFPO7DEGGSTKK5UMHZS72GKX25GYD X-Message-ID-Hash: OB2RFPO7DEGGSTKK5UMHZS72GKX25GYD 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 CC: pve-devel@lists.proxmox.com 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 18.11.2026 17:18, Stefan Hanreich wrote: > > > On 11/16/26 5:16 PM, Gabriel Goller wrote: > > Allow simple zones to isolate routing with dedicated-vrf. It is > > disabled by default to preserve existing behavior. > > > > Create the VRF even when the zone has no VNets, so fabrics can use it > > without requiring a VNet. > > > > Add unreachable IPv4 and IPv6 default routes with the highest metric > > to the VRF, as EVPN does on non-exit nodes. Otherwise lookups that find > > no route in the VRF table fall through to the main table, e.g. if no > > default route is configured or before FRR has installed it. > > > > Signed-off-by: Gabriel Goller > > --- > > src/PVE/API2/Network/SDN/Zones.pm | 6 ++++ > > src/PVE/Network/SDN/Zones.pm | 19 +++++++++-- > > src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 5 +-- > > src/PVE/Network/SDN/Zones/Plugin.pm | 11 ++++++ > > src/PVE/Network/SDN/Zones/SimplePlugin.pm | 32 +++++++++++++++-- > > .../hetzner-vrf/expected_sdn_interfaces | 27 +++++++++++++++ > > src/test/zones/simple/hetzner-vrf/interfaces | 6 ++++ > > src/test/zones/simple/hetzner-vrf/sdn_config | 34 +++++++++++++++++++ > > .../simple/vrf-empty/expected_sdn_interfaces | 7 ++++ > > src/test/zones/simple/vrf-empty/interfaces | 2 ++ > > src/test/zones/simple/vrf-empty/sdn_config | 12 +++++++ > > .../zones/simple/vrf/expected_sdn_interfaces | 14 ++++++++ > > src/test/zones/simple/vrf/interfaces | 2 ++ > > src/test/zones/simple/vrf/sdn_config | 17 ++++++++++ > > 14 files changed, 187 insertions(+), 7 deletions(-) > > create mode 100644 src/test/zones/simple/hetzner-vrf/expected_sdn_interfaces > > create mode 100644 src/test/zones/simple/hetzner-vrf/interfaces > > create mode 100644 src/test/zones/simple/hetzner-vrf/sdn_config > > create mode 100644 src/test/zones/simple/vrf-empty/expected_sdn_interfaces > > create mode 100644 src/test/zones/simple/vrf-empty/interfaces > > create mode 100644 src/test/zones/simple/vrf-empty/sdn_config > > create mode 100644 src/test/zones/simple/vrf/expected_sdn_interfaces > > create mode 100644 src/test/zones/simple/vrf/interfaces > > create mode 100644 src/test/zones/simple/vrf/sdn_config > > > > diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm > > index 74b10f032bf4..38d950fda076 100644 > > --- a/src/PVE/API2/Network/SDN/Zones.pm > > +++ b/src/PVE/API2/Network/SDN/Zones.pm > > @@ -61,6 +61,12 @@ my $ZONE_PROPERTIES = { > > optional => 1, > > description => 'Name of DHCP server backend for this zone.', > > }, > > + 'dedicated-vrf' => { > > + type => 'boolean', > > + default => 0, > > + optional => 1, > > + description => 'Create a dedicated VRF for a simple zone.', > > + }, > > 'rt-import' => { > > type => 'string', > > optional => 1, > > diff --git a/src/PVE/Network/SDN/Zones.pm b/src/PVE/Network/SDN/Zones.pm > > index c189652a79eb..cf81c002c4a5 100644 > > --- a/src/PVE/Network/SDN/Zones.pm > > +++ b/src/PVE/Network/SDN/Zones.pm > > @@ -124,6 +124,9 @@ sub generate_etc_network_config { > > my $controller_cfg = $cfg->{controllers}; > > return if !$vnet_cfg && !$zone_cfg; > > > > + my $vnet_ids = $vnet_cfg ? ($vnet_cfg->{ids} // {}) : {}; > > + my $zone_ids = $zone_cfg ? ($zone_cfg->{ids} // {}) : {}; > > + > > my $interfaces_config = PVE::INotify::read_file('interfaces'); > > my $bridge_ports = PVE::IPRoute2::get_bridge_port_mapping(); > > > > @@ -131,8 +134,18 @@ sub generate_etc_network_config { > > my $config = {}; > > my $nodename = PVE::INotify::nodename(); > > > > - for my $id (sort keys %{ $vnet_cfg->{ids} }) { > > - my $vnet = $vnet_cfg->{ids}->{$id}; > > + for my $zone_id (sort keys %$zone_ids) { > > + my $plugin_config = $zone_ids->{$zone_id}; > > + next if $plugin_config->{type} ne 'simple'; > > + next if defined($plugin_config->{nodes}) && !$plugin_config->{nodes}->{$nodename}; > > + > > + PVE::Network::SDN::Zones::SimplePlugin->generate_zone_config( > > fine for now, but shouldn't we make this a method of the ZonePlugin? Already done in the "sdn: always generate EVPN zone VRFs" commit, but pulled it back here. > > + $plugin_config, $zone_id, $config, > > + ); > > + } > > + > > + for my $id (sort keys %$vnet_ids) { > > + my $vnet = $vnet_ids->{$id}; > > my $zone = $vnet->{zone}; > > > > if (!$zone) { > > @@ -140,7 +153,7 @@ sub generate_etc_network_config { > > next; > > } > > > > - my $plugin_config = $zone_cfg->{ids}->{$zone}; > > + my $plugin_config = $zone_ids->{$zone}; > > > > if (!defined($plugin_config)) { > > warn "can't generate vnet '$id': zone $zone don't exist\n"; > > [snip] Thanks for the review