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 0034A1FF0DA for ; Thu, 19 Nov 2026 20:47:26 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 99223218F4; Thu, 19 Nov 2026 20:46:29 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager 13/14] network: warn if pve-firewall cannot isolate guests in zone VRFs Date: Thu, 19 Nov 2026 20:45:45 +0100 Message-ID: <20261119194547.674512-14-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119194547.674512-1-s.hanreich@proxmox.com> References: <20261119194547.674512-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795117557625 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: QH5WSHC2GFFUONVZIZBMCM244SXLUUGC X-Message-ID-Hash: QH5WSHC2GFFUONVZIZBMCM244SXLUUGC X-MailFrom: s.hanreich@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: pve-firewall tracks the connections of guests with the firewall enabled on a network device on their firewall bridges, in a conntrack zone that is shared by all VRFs, so the conntrack zones of zone VRFs do not keep these connections apart. Warn when applying the network configuration if zone VRFs exist and the enabled firewall is pve-firewall instead of the nftables firewall, which sets the conntrack zone before tracking the connections of guests. Signed-off-by: Stefan Hanreich --- PVE/API2/Network.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 064fe40a..a10a47e1 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -12,6 +12,8 @@ use PVE::RESTHandler; use PVE::RPCEnvironment; use PVE::JSONSchema qw(get_standard_option); use PVE::AccessControl; +use PVE::Firewall; +use PVE::Firewall::Helpers; use PVE::Network; use IO::File; @@ -42,6 +44,18 @@ my sub apply_vrf_ct_zones { warn "failed to apply the conntrack zones of zone VRFs - $@" if $@; } +# pve-firewall tracks the connections of guests with the firewall enabled on a network device on +# the firewall bridges, in a conntrack zone that is shared by all zone VRFs +my sub warn_vrf_zones_with_legacy_firewall { + my $zones = PVE::Network::SDN::running_config()->{zones}->{ids} // {}; + return if !grep { defined($_->{'ct-zone'}) } values $zones->%*; + return if PVE::Firewall::Helpers::is_nftables(); + return if !PVE::Firewall::load_clusterfw_conf()->{options}->{enable}; + + warn "guests with the firewall enabled on a network device are not isolated between zone" + . " VRFs with pve-firewall, use the nftables firewall instead\n"; +} + my $bond_mode_enum = [ 'balance-rr', 'active-backup', # OVS and Linux @@ -985,7 +999,10 @@ __PACKAGE__->register_method({ }; PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err); - apply_vrf_ct_zones() if $have_sdn; + if ($have_sdn) { + apply_vrf_ct_zones(); + eval { warn_vrf_zones_with_legacy_firewall() }; + } # needs the zone VRFs created by ifreload, because dnsmasq is started inside # them with 'ip vrf exec' -- 2.47.3