From: "Rémi PAETA" <remi.paeta@comaite.com>
To: pve-devel@lists.proxmox.com
Subject: [RFC PATCH v2 network 07/15] sdn: subnets: refuse gateway, snat and dhcp on ovn zones
Date: Fri, 27 Nov 2026 11:28:28 +0100 [thread overview]
Message-ID: <20261127102836.313797-8-remi.paeta@comaite.com> (raw)
In-Reply-To: <20261127102836.313797-1-remi.paeta@comaite.com>
OVN zones do not route nor serve DHCP yet, so a subnet gateway, SNAT or
DHCP ranges would have no effect on them. Refuse them instead of
silently ignoring them.
Signed-off-by: Rémi PAETA <remi.paeta@comaite.com>
---
No changes since v1.
src/PVE/Network/SDN/SubnetPlugin.pm | 9 +++++++++
src/test/run_test_ovn.pl | 12 ++++++++++++
2 files changed, 21 insertions(+)
diff --git a/src/PVE/Network/SDN/SubnetPlugin.pm b/src/PVE/Network/SDN/SubnetPlugin.pm
index 05d5959..0169d84 100644
--- a/src/PVE/Network/SDN/SubnetPlugin.pm
+++ b/src/PVE/Network/SDN/SubnetPlugin.pm
@@ -224,6 +224,15 @@ sub on_update_hook {
$mac = $vnet->{mac};
}
+ # OVN zones neither route nor serve DHCP (yet), so these options would have no effect
+ if (($zone->{type} // '') eq 'ovn') {
+ for my $option ('gateway', 'snat', 'dhcp-range') {
+ my $value = $subnet->{$option};
+ next if !$value || (ref($value) eq 'ARRAY' && !@$value);
+ raise_param_exc({ $option => "$option is not supported on OVN zones" });
+ }
+ }
+
my $pointopoint = Net::IP::ip_is_ipv4($gateway) && $mask == 32;
#for /32 pointopoint, we allow gateway outside the subnet
diff --git a/src/test/run_test_ovn.pl b/src/test/run_test_ovn.pl
index fc5d098..4e1829b 100755
--- a/src/test/run_test_ovn.pl
+++ b/src/test/run_test_ovn.pl
@@ -12,6 +12,7 @@ use Test::MockModule;
use PVE::Network::SDN;
use PVE::Network::SDN::Ovn;
use PVE::Network::SDN::Controllers::OvnPlugin;
+use PVE::Network::SDN::SubnetPlugin;
use PVE::Network::SDN::Zones::OvnPlugin;
my $controller = {
@@ -607,6 +608,17 @@ eval {
};
like($@, qr/isolate-ports is not supported/, 'vnet_update_hook: isolate-ports refused');
+for my $option (['gateway', '10.0.0.1'], ['snat', 1], ['dhcp-range', ['start-address=a']]) {
+ eval {
+ PVE::Network::SDN::SubnetPlugin->on_update_hook(
+ { type => 'ovn' },
+ 'zone1-10.0.0.0-24',
+ { cidr => '10.0.0.0/24', mask => 24, $option->[0] => $option->[1] },
+ );
+ };
+ like($@, qr/$option->[0] is not supported on OVN zones/, "subnet: $option->[0] refused");
+}
+
# chassis
is(
--
2.47.3
next prev parent reply other threads:[~2026-11-27 10:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 10:28 [RFC PATCH v2 network/manager/docs 00/15] sdn: add OVN zone and controller plugins Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 01/15] sdn: controllers: add ovn plugin Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 02/15] sdn: zones: " Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 03/15] sdn: ovn: sync the northbound database on reload Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 04/15] sdn: ovn: configure the chassis on boot and on network reload Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 05/15] sdn: ovn: add port security Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 06/15] sdn: ovn: allow overriding the port security per vnet Rémi PAETA
2026-11-27 10:28 ` Rémi PAETA [this message]
2026-11-27 10:28 ` [RFC PATCH v2 network 08/15] sdn: ovn: support ssl connections to the databases Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 network 09/15] sdn: ovn: bind guest ports to the chassis of their node Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 manager 10/15] ui: sdn: controller selector: allow filtering by controller type Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 manager 11/15] ui: sdn: add ovn controller Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 manager 12/15] ui: sdn: add ovn zone Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 manager 13/15] ui: sdn: vnet: add port security for ovn zones Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 manager 14/15] ui: sdn: vnet: disable isolate ports " Rémi PAETA
2026-11-27 10:28 ` [RFC PATCH v2 docs 15/15] sdn: document ovn zones and controllers Rémi PAETA
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=20261127102836.313797-8-remi.paeta@comaite.com \
--to=remi.paeta@comaite.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