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 1E05F1FF0A7 for ; Wed, 02 Sep 2026 14:49:23 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D972021669; Wed, 02 Sep 2026 14:48:34 +0200 (CEST) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 10/12] sdn: zones: offer dhcp on all zone types, keep dnsmasq simple-only Date: Wed, 2 Sep 2026 14:47:37 +0200 Message-ID: <20260902124739.750853-11-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260902124739.750853-1-h.laimer@proxmox.com> References: <20260902124739.750853-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788353267287 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.660 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: UYK2BITZNWOB46ETHNOJWFDAWDULN7QW X-Message-ID-Hash: UYK2BITZNWOB46ETHNOJWFDAWDULN7QW X-MailFrom: h.laimer@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: The dnsmasq backend is confined to simple zones because it is a node-local process on the vnet bridge, on a zone spanning nodes every node's instance would answer the shared broadcast domain. The ebpf backend answers on the guest's own tap and has no such restriction, so the dhcp property moves from a simple-zone option to a common one, with dnsmasq rejected on other zone types. The backends ask the zone for the guest-facing MTU to serve, so the zone types gaining dhcp implement get_mtu, with vxlan derived zones accounting for the encapsulation overhead. Signed-off-by: Hannes Laimer --- src/PVE/API2/Network/SDN/Zones.pm | 6 ++++++ src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 1 + src/PVE/Network/SDN/Zones/FaucetPlugin.pm | 1 + src/PVE/Network/SDN/Zones/QinQPlugin.pm | 7 +++++++ src/PVE/Network/SDN/Zones/VlanPlugin.pm | 7 +++++++ src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 9 +++++++++ 6 files changed, 31 insertions(+) diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm index ad16bef..b39c0c9 100644 --- a/src/PVE/API2/Network/SDN/Zones.pm +++ b/src/PVE/API2/Network/SDN/Zones.pm @@ -447,6 +447,9 @@ __PACKAGE__->register_method({ raise_param_exc({ ipam => "$ipam not existing" }) if $ipam && !$ipam_cfg->{ids}->{$ipam}; + raise_param_exc({ dhcp => "the dnsmasq backend only supports simple zones" }) + if ($opts->{dhcp} // '') eq 'dnsmasq' && $plugin->type() ne 'simple'; + $zone_cfg->{ids}->{$id} = $opts; $plugin->on_update_hook($id, $zone_cfg, $controller_cfg); @@ -543,6 +546,9 @@ __PACKAGE__->register_method({ raise_param_exc({ ipam => "$ipam not existing" }) if $ipam && !$ipam_cfg->{ids}->{$ipam}; + raise_param_exc({ dhcp => "the dnsmasq backend only supports simple zones" }) + if ($opts->{dhcp} // '') eq 'dnsmasq' && $plugin->type() ne 'simple'; + $plugin->on_update_hook($id, $zone_cfg, $controller_cfg); PVE::Network::SDN::Zones::write_config($zone_cfg); diff --git a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm index 0e79707..7f1fd90 100644 --- a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm @@ -125,6 +125,7 @@ sub options { reversedns => { optional => 1 }, dnszone => { optional => 1 }, ipam => { optional => 1 }, + dhcp => { optional => 1 }, }; } diff --git a/src/PVE/Network/SDN/Zones/FaucetPlugin.pm b/src/PVE/Network/SDN/Zones/FaucetPlugin.pm index 5f069ae..4e3f5ef 100644 --- a/src/PVE/Network/SDN/Zones/FaucetPlugin.pm +++ b/src/PVE/Network/SDN/Zones/FaucetPlugin.pm @@ -30,6 +30,7 @@ sub options { reversedns => { optional => 1 }, dnszone => { optional => 1 }, ipam => { optional => 1 }, + dhcp => { optional => 1 }, }; } diff --git a/src/PVE/Network/SDN/Zones/QinQPlugin.pm b/src/PVE/Network/SDN/Zones/QinQPlugin.pm index a75940c..e70912a 100644 --- a/src/PVE/Network/SDN/Zones/QinQPlugin.pm +++ b/src/PVE/Network/SDN/Zones/QinQPlugin.pm @@ -36,6 +36,12 @@ sub properties { }; } +sub get_mtu { + my ($class, $plugin_config) = @_; + + return $plugin_config->{mtu}; +} + sub options { return { nodes => { optional => 1 }, @@ -48,6 +54,7 @@ sub options { reversedns => { optional => 1 }, dnszone => { optional => 1 }, ipam => { optional => 1 }, + dhcp => { optional => 1 }, }; } diff --git a/src/PVE/Network/SDN/Zones/VlanPlugin.pm b/src/PVE/Network/SDN/Zones/VlanPlugin.pm index 9102b34..4f24b2a 100644 --- a/src/PVE/Network/SDN/Zones/VlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VlanPlugin.pm @@ -36,6 +36,12 @@ sub properties { }; } +sub get_mtu { + my ($class, $plugin_config) = @_; + + return $plugin_config->{mtu}; +} + sub options { return { @@ -47,6 +53,7 @@ sub options { reversedns => { optional => 1 }, dnszone => { optional => 1 }, ipam => { optional => 1 }, + dhcp => { optional => 1 }, }; } diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index a408261..6ae1998 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -47,6 +47,14 @@ sub properties { }; } +# without an explicit zone MTU the vnet bridges default to 1450, +# leaving room for the vxlan encapsulation +sub get_mtu { + my ($class, $plugin_config) = @_; + + return $plugin_config->{mtu} // 1450; +} + sub options { return { nodes => { optional => 1 }, @@ -58,6 +66,7 @@ sub options { dnszone => { optional => 1 }, ipam => { optional => 1 }, fabric => { optional => 1 }, + dhcp => { optional => 1 }, }; } -- 2.47.3