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 18E361FF066 for ; Tue, 24 Nov 2026 18:58:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EBE612175A; Tue, 24 Nov 2026 18:57:32 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-firewall 5/7] tests: add network devices without MAC address Date: Tue, 24 Nov 2026 18:57:15 +0100 Message-ID: <20261124175718.512428-6-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261124175718.512428-1-s.hanreich@proxmox.com> References: <20261124175718.512428-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: 1795543046856 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.124 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) PROLO_LEO2 0.1 Meta Catches all Leo drug variations so far 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: OCHYUADMARPNYBTTHOAOTN5ZBUMIZD7Z X-Message-ID-Hash: OCHYUADMARPNYBTTHOAOTN5ZBUMIZD7Z 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: Cover a container network device without MAC address and type, whose default IP filter has no link-local address, and a VM network device without MAC address, for which the MAC filter drops all traffic of the guest. Signed-off-by: Stefan Hanreich --- proxmox-firewall/tests/input/100.conf | 1 + proxmox-firewall/tests/input/101.conf | 1 + .../integration_tests__firewall.snap | 399 ++++++++++++++++++ 3 files changed, 401 insertions(+) diff --git a/proxmox-firewall/tests/input/100.conf b/proxmox-firewall/tests/input/100.conf index 1f81186..8bce621 100644 --- a/proxmox-firewall/tests/input/100.conf +++ b/proxmox-firewall/tests/input/100.conf @@ -6,6 +6,7 @@ memory: 512 net1: name=eth0,bridge=simple1,firewall=1,hwaddr=BC:24:11:4D:B0:FF,ip=dhcp,ip6=fd80::1234/64,type=veth net2: name=eth0,bridge=simple1,hwaddr=BC:24:11:4D:B0:FF,ip=dhcp,ip6=fd80::1234/64,type=veth net3: name=eth0,bridge=simple2,firewall=1,hwaddr=BC:24:11:4D:B0:FE,ip=192.0.2.10/24,ip6=fd80::1235/64,type=veth +net4: name=eth0,bridge=simple2,firewall=1,ip=192.0.2.11/24 ostype: debian rootfs: local-lvm:vm-90001-disk-0,size=2G swap: 512 diff --git a/proxmox-firewall/tests/input/101.conf b/proxmox-firewall/tests/input/101.conf index 394e2e4..65f2e99 100644 --- a/proxmox-firewall/tests/input/101.conf +++ b/proxmox-firewall/tests/input/101.conf @@ -3,6 +3,7 @@ cores: 2 cpu: x86-64-v2-AES memory: 2048 meta: creation-qemu=8.1.5,ctime=1712322773 +net0: virtio,bridge=public,firewall=1 numa: 0 ostype: l26 scsihw: virtio-scsi-single diff --git a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap index 69fb10a..439a379 100644 --- a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap +++ b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap @@ -5493,6 +5493,337 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" } } }, + { + "add": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v4-guest-100/ipfilter-net4", + "type": "ipv4_addr", + "flags": [ + "interval" + ], + "auto-merge": true + } + } + }, + { + "flush": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v4-guest-100/ipfilter-net4" + } + } + }, + { + "add": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v4-guest-100/ipfilter-net4-nomatch", + "type": "ipv4_addr", + "flags": [ + "interval" + ], + "auto-merge": true + } + } + }, + { + "flush": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v4-guest-100/ipfilter-net4-nomatch" + } + } + }, + { + "add": { + "element": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v4-guest-100/ipfilter-net4", + "elem": [ + { + "prefix": { + "addr": "192.0.2.11", + "len": 32 + } + } + ] + } + } + }, + { + "add": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v6-guest-100/ipfilter-net4", + "type": "ipv6_addr", + "flags": [ + "interval" + ], + "auto-merge": true + } + } + }, + { + "flush": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v6-guest-100/ipfilter-net4" + } + } + }, + { + "add": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v6-guest-100/ipfilter-net4-nomatch", + "type": "ipv6_addr", + "flags": [ + "interval" + ], + "auto-merge": true + } + } + }, + { + "flush": { + "set": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "v6-guest-100/ipfilter-net4-nomatch" + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-in", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "oifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "!=", + "left": { + "payload": { + "protocol": "arp", + "field": "daddr ip" + } + }, + "right": "@v4-guest-100/ipfilter-net4" + } + }, + { + "drop": null + } + ] + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-out", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "iifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "!=", + "left": { + "payload": { + "protocol": "ip", + "field": "saddr" + } + }, + "right": "@v4-guest-100/ipfilter-net4" + } + }, + { + "drop": null + } + ] + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-out", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "iifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "==", + "left": { + "payload": { + "protocol": "ip", + "field": "saddr" + } + }, + "right": "@v4-guest-100/ipfilter-net4-nomatch" + } + }, + { + "drop": null + } + ] + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-out", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "iifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "!=", + "left": { + "payload": { + "protocol": "ip6", + "field": "saddr" + } + }, + "right": "@v6-guest-100/ipfilter-net4" + } + }, + { + "drop": null + } + ] + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-out", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "iifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "==", + "left": { + "payload": { + "protocol": "ip6", + "field": "saddr" + } + }, + "right": "@v6-guest-100/ipfilter-net4-nomatch" + } + }, + { + "drop": null + } + ] + } + } + }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-100-out", + "expr": [ + { + "match": { + "op": "==", + "left": { + "meta": { + "key": "iifname" + } + }, + "right": "veth100i4" + } + }, + { + "match": { + "op": "!=", + "left": { + "payload": { + "protocol": "arp", + "field": "saddr ip" + } + }, + "right": "@v4-guest-100/ipfilter-net4" + } + }, + { + "drop": null + } + ] + } + } + }, { "add": { "rule": { @@ -5859,6 +6190,14 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" "target": "guest-100-in" } } + ], + [ + "veth100i4", + { + "goto": { + "target": "guest-100-in" + } + } ] ] } @@ -6011,6 +6350,14 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" "target": "guest-100-out" } } + ], + [ + "veth100i4", + { + "goto": { + "target": "guest-100-out" + } + } ] ] } @@ -6216,6 +6563,20 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" } } }, + { + "add": { + "rule": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "chain": "guest-101-out", + "expr": [ + { + "drop": null + } + ] + } + } + }, { "add": { "rule": { @@ -6390,6 +6751,25 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" } } }, + { + "add": { + "element": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "vm-map-in", + "elem": [ + [ + "tap101i0", + { + "goto": { + "target": "guest-101-in" + } + } + ] + ] + } + } + }, { "add": { "rule": { @@ -6425,6 +6805,25 @@ expression: "firewall.full_host_fw().expect(\"firewall can be generated\")" } } }, + { + "add": { + "element": { + "family": "bridge", + "table": "proxmox-firewall-guests", + "name": "vm-map-out", + "elem": [ + [ + "tap101i0", + { + "goto": { + "target": "guest-101-out" + } + } + ] + ] + } + } + }, { "add": { "rule": { -- 2.47.3