From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7976F1FF15E for ; Mon, 1 Sep 2025 18:22:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F0A873281D; Mon, 1 Sep 2025 18:22:29 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Mon, 1 Sep 2025 18:20:36 +0200 In-Reply-To: <20250901162036.2651-1-09couplet.bitmap@icloud.com> References: <20250901162036.2651-1-09couplet.bitmap@icloud.com> MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Guillaume via pve-devel Precedence: list Cc: Guillaume <09couplet.bitmap@icloud.com> X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH container v2 4/4] setup: disabled ipv4 or ipv6 if not used in NetworkManager files Content-Type: multipart/mixed; boundary="===============5138387845766665679==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============5138387845766665679== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <09couplet.bitmap@icloud.com> X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id EF569D1E39 for ; Mon, 1 Sep 2025 18:22:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C6E703279A for ; Mon, 1 Sep 2025 18:21:57 +0200 (CEST) Received: from 9.mo575.mail-out.ovh.net (9.mo575.mail-out.ovh.net [46.105.78.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 1 Sep 2025 18:21:56 +0200 (CEST) Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.254.66]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4cFvJt0QBwz642m for ; Mon, 1 Sep 2025 16:21:49 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-gqwhg (unknown [10.108.54.199]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 64B73C2B64; Mon, 1 Sep 2025 16:21:49 +0000 (UTC) Received: from cours.cloud ([37.59.142.111]) by ghost-submission-5b5ff79f4f-gqwhg with ESMTPSA id mNA4FwHItWi54wAAq4irsw:T5 (envelope-from <09couplet.bitmap@icloud.com>); Mon, 01 Sep 2025 16:21:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-111S005b328531e-4df0-4ad4-90d5-26d1ce7be746, 626740C7795EBEF0A24945DD74755F9321337A95) smtp.auth=guillaume@cours.cloud X-OVh-ClientIp: 90.50.10.13 From: Guillaume <09couplet.bitmap@icloud.com> To: pve-devel@lists.proxmox.com Cc: Guillaume <09couplet.bitmap@icloud.com> Subject: [PATCH container v2 4/4] setup: disabled ipv4 or ipv6 if not used in NetworkManager files Date: Mon, 1 Sep 2025 18:20:36 +0200 Message-ID: <20250901162036.2651-5-09couplet.bitmap@icloud.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250901162036.2651-1-09couplet.bitmap@icloud.com> References: <20250901162036.2651-1-09couplet.bitmap@icloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 14419681583084042360 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduledvieduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefiuhhilhhlrghumhgvuceotdeltghouhhplhgvthdrsghithhmrghpsehitghlohhuugdrtghomheqnecuggftrfgrthhtvghrnhepuefftdduudetteefleeujeetleekgfetieduhfegudehhfehueeikedugfegveeknecukfhppeduvdejrddtrddtrddupdeltddrhedtrddutddrudefpdefjedrheelrddugedvrdduuddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpedtlegtohhuphhlvghtrdgsihhtmhgrphesihgtlhhouhgurdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtohepphhvvgdquggvvhgvlheslhhishhtshdrphhrohigmhhogidrtghomhdpoffvtefjohhsthepmhhoheejhegmpdhmohguvgepshhmthhpohhuth X-SPAM-LEVEL: Spam detection results: 2 AWL 0.668 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_QUAR 0.1 DMARC quarantine policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider KAM_DMARC_QUARANTINE 4 DKIM has Failed or SPF has failed on the message and the domain has a DMARC quarantine policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust RCVD_IN_MSPIKE_H5 -1 Excellent reputation (+5) RCVD_IN_MSPIKE_WL -0.01 Mailspike good senders RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_SOFTFAIL 0.665 SPF: sender does not match SPF record (softfail) Signed-off-by: Guillaume <09couplet.bitmap@icloud.com> --- src/PVE/LXC/Setup/CentOS.pm | 12 ++++++++---- .../system-connections/eth0.nmconnection.exp | 2 ++ .../system-connections/eth0.nmconnection.exp | 2 ++ .../system-connections/eth1.nmconnection.exp | 2 ++ .../system-connections/eth2.nmconnection.exp | 2 ++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm index 06b4dac..42119ea 100644 --- a/src/PVE/LXC/Setup/CentOS.pm +++ b/src/PVE/LXC/Setup/CentOS.pm @@ -229,8 +229,8 @@ sub setup_netork_with_networkmanager { my $header = "[connection]\nid=$d->{name}\nuuid=" . UUID::uuid() . "\ntype=ethernet\ninterface-name=$d->{name}\n"; my $data = ''; + $data .= "[ipv4]\n"; if ($d->{ip} && $d->{ip} ne 'manual') { - $data .= "[ipv4]\n"; if ($d->{ip} eq 'dhcp') { $data .= "method=auto\n"; } else { @@ -245,10 +245,12 @@ sub setup_netork_with_networkmanager { } $data .= "dns=" . join(',', @nameserversv4) . "\n" if @nameserversv4; $data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n" if @nameserversv4 && $searchdomains; - } + } else { + $data .= "method=disabled\n"; + } + $data .= "[ipv6]\n"; if ($d->{ip6} && $d->{ip6} ne 'manual') { - $data .= "[ipv6]\n"; if ($d->{ip6} eq 'auto' || $d->{ip6} eq 'dhcp') { $data .= "method=auto\n"; } else { @@ -266,7 +268,9 @@ sub setup_netork_with_networkmanager { } $data .= "dns=" . join(',', @nameserversv6) . "\n" if @nameserversv6; $data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n" if @nameserversv6 && $searchdomains; - } + } else { + $data .= "method=disabled\n"; + } next unless $data; $self->ct_file_set_contents($filename, $header . $data, 0600); diff --git a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp index 25a907d..3bf5d2d 100644 --- a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp +++ b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp @@ -7,3 +7,5 @@ interface-name=eth0 method=auto dns=127.0.0.1 dns-search=example.com +[ipv6] +method=disabled diff --git a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp index c6c5417..49b0aed 100644 --- a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp +++ b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth0.nmconnection.exp @@ -10,3 +10,5 @@ gateway=11.0.0.1 routes=11.0.0.1 dns=127.0.0.1 dns-search=example.com +[ipv6] +method=disabled diff --git a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp index a99b707..271f928 100644 --- a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp +++ b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth1.nmconnection.exp @@ -3,6 +3,8 @@ id=eth1 uuid=00000000-0000-0000-0000-000000000000 type=ethernet interface-name=eth1 +[ipv4] +method=disabled [ipv6] method=manual address=fc00::1/64 diff --git a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp index 53a6df6..1a4a900 100644 --- a/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp +++ b/src/test/test-centos10-002/etc/NetworkManager/system-connections/eth2.nmconnection.exp @@ -8,3 +8,5 @@ method=manual addresses=192.168.0.1/24 dns=127.0.0.1 dns-search=example.com +[ipv6] +method=disabled -- 2.47.2 --===============5138387845766665679== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============5138387845766665679==--