From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7DCA91FF13A for ; Wed, 10 Jun 2026 15:27:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5D58CF059; Wed, 10 Jun 2026 15:27:30 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer 2/2] install: do not force gateway to IPv6 RA-received on non-bridged setups Date: Wed, 10 Jun 2026 15:27:02 +0200 Message-ID: <20260610132710.199825-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260610132710.199825-1-c.heiss@proxmox.com> References: <20260610132710.199825-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1781097992564 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.075 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: N3LTGV6DGBBKARB3CLHT3PKBYXXLCLGR X-Message-ID-Hash: N3LTGV6DGBBKARB3CLHT3PKBYXXLCLGR X-MailFrom: c.heiss@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: Skip writing the default gateway for the management interface to /etc/network/interfaces if it was originally received through an IPv6 RA. Otherwise, fresh, non-bridged (aka. anything other than PVE) installations will repeatedly, i.e. on every received RA advertising a different SLAAC-capable prefix, report an error in the journal that a default gateway already exists. The Rust struct definitions are not touched, as the information is not needed there (yet). Suggested-by: Gabriel Goller Signed-off-by: Christoph Heiss --- Proxmox/Install.pm | 18 +++++++++++++----- Proxmox/Sys/Net.pm | 6 ++++++ ...dn_from_dhcp_no_default_domain.run-env.json | 3 ++- .../no_fqdn_from_dhcp.run-env.json | 3 ++- .../tests/resources/run-env-info.json | 3 ++- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm index 5f748d6..d025360 100644 --- a/Proxmox/Install.pm +++ b/Proxmox/Install.pm @@ -1182,6 +1182,12 @@ sub extract_data { } } + my $routes = $run_env->{network}->{routes}; + my $is_gateway6_from_ra = + defined($routes->{gateway6}) + && $routes->{gateway6}->{gateway} eq $gateway + && $routes->{gateway6}->{protocol} eq 'ra'; + if ($iso_env->{cfg}->{bridged_network}) { $ifaces .= "iface $ethdev $ntype manual\n"; @@ -1193,11 +1199,13 @@ sub extract_data { . "\tbridge-stp off\n" . "\tbridge-fd 0\n"; } else { - $ifaces .= - "auto $ethdev\n" - . "iface $ethdev $ntype static\n" - . "\taddress $cidr\n" - . "\tgateway $gateway\n"; + $ifaces .= "auto $ethdev\n" . # + "iface $ethdev $ntype static\n" . # + "\taddress $cidr\n"; + + if (!$is_gateway6_from_ra) { + $ifaces .= "\tgateway $gateway\n"; + } } my $interfaces = $run_env->{network}->{interfaces}; diff --git a/Proxmox/Sys/Net.pm b/Proxmox/Sys/Net.pm index d175742..c4fdd7b 100644 --- a/Proxmox/Sys/Net.pm +++ b/Proxmox/Sys/Net.pm @@ -279,12 +279,16 @@ sub query_netdevs : prototype() { # gateway4 => { # gateway => , # dev => , +# protocol => , # }, # gateway6 => { # gateway => , # dev => , +# protocol => , # }, # } +# +# can be one of: "kernel", "ra" sub query_routes : prototype() { my $routes = {}; @@ -295,6 +299,7 @@ sub query_routes : prototype() { $routes->{gateway4} = { dev => $route->{dev}, gateway => $route->{gateway}, + protocol => $route->{protocol}, }; last; } @@ -306,6 +311,7 @@ sub query_routes : prototype() { $routes->{gateway6} = { dev => $route->{dev}, gateway => $route->{gateway}, + protocol => $route->{protocol}, }; last; } diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json index 566e261..3fbf2aa 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json @@ -177,7 +177,8 @@ "routes": { "gateway4": { "dev": "eno1", - "gateway": "192.168.1.1" + "gateway": "192.168.1.1", + "protocol": "kernel" } } }, diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json index 909cd7c..58cd634 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json @@ -176,7 +176,8 @@ "routes": { "gateway4": { "dev": "eno1", - "gateway": "192.168.1.1" + "gateway": "192.168.1.1", + "protocol": "kernel" } } }, diff --git a/proxmox-auto-installer/tests/resources/run-env-info.json b/proxmox-auto-installer/tests/resources/run-env-info.json index 55c4fe0..321e7e8 100644 --- a/proxmox-auto-installer/tests/resources/run-env-info.json +++ b/proxmox-auto-installer/tests/resources/run-env-info.json @@ -177,7 +177,8 @@ "routes": { "gateway4": { "dev": "eno1", - "gateway": "192.168.1.1" + "gateway": "192.168.1.1", + "protocol": "kernel" } } }, -- 2.54.0