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 3BFA61FF0DA for ; Thu, 19 Nov 2026 20:46:07 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 61F2721752; Thu, 19 Nov 2026 20:46:05 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-firewall 06/14] firewall: apply vnet rules to host traffic from vnets in a VRF Date: Thu, 19 Nov 2026 20:45:38 +0100 Message-ID: <20261119194547.674512-7-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: 1795117557143 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.242 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: VLZTUZ57LFP5RNVJTRH3Q7LHONPKITMZ X-Message-ID-Hash: VLZTUZ57LFP5RNVJTRH3Q7LHONPKITMZ 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: The vnet firewall checks traffic from guests to the host by looking up the input interface in the bridge map. For a vnet in a VRF, such as the vnets of EVPN zones, the input interface of locally delivered traffic is the VRF device, so the lookup never matched and the vnet rules for traffic towards the host were silently skipped. Additionally look up the slave device, which holds the bridge the packet arrived on for traffic received in a VRF and is unset otherwise. This only adds verdicts in a chain that runs before the host input chain, so traffic that was allowed by the host rules before can now be dropped by the vnet rules. With a restrictive forward policy on such a vnet, traffic to the gateway, e.g. ICMP, needs to be allowed explicitly, as for vnets outside a VRF. Signed-off-by: Stefan Hanreich --- proxmox-firewall/resources/proxmox-firewall.nft | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxmox-firewall/resources/proxmox-firewall.nft b/proxmox-firewall/resources/proxmox-firewall.nft index 265ed80..2675727 100644 --- a/proxmox-firewall/resources/proxmox-firewall.nft +++ b/proxmox-firewall/resources/proxmox-firewall.nft @@ -240,6 +240,9 @@ table inet proxmox-firewall { chain host-bridge-input { type filter hook input priority filter - 1; policy accept; meta iifname vmap @bridge-map + # traffic received in a VRF has the VRF device as input interface, the bridge it + # arrived on is the slave device + meta sdifname vmap @bridge-map } chain host-bridge-output { -- 2.47.3