all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH installer 1/2] network: align VLAN interface names with the documentation
Date: Tue, 24 Nov 2026 10:39:29 +0100	[thread overview]
Message-ID: <20261124094025.2479405-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20261124094025.2479405-1-s.ivanov@proxmox.com>

our documentation has relied on ifupdown(2)'s way of handling
$iface.$vid as identifier for VLAN interfaces for a long while
(looking through pve-docs commit history shows `vlan-raw-device`
only occurring in the api-viewer)

Sticking to our documentation should help reducing the different
ways that people are configuring their interfaces and thus hopefully
the potential for errors.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 Proxmox/Install.pm                |  4 +--
 test/generate-ifupdown2-config.pl | 42 +++++++++++++++----------------
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index 76bfd04..337f0d7 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -887,9 +887,9 @@ sub generate_ifupdown2_config {
     my $get_vlan_stanza = sub {
         my ($raw_device) = @_;
 
-        my $config = "auto vlan$vlan_id\niface vlan$vlan_id $ntype static\n\taddress $cidr\n";
+        my $config = "auto $raw_device.$vlan_id\niface $raw_device.$vlan_id $ntype static\n\taddress $cidr\n";
         $config .= "\tgateway $gateway\n" if !$is_gateway6_from_ra;
-        return [4, "vlan$vlan_id", $config . "\tvlan-raw-device $raw_device\n"];
+        return [4, "$raw_device.$vlan_id", $config . "\tvlan-raw-device $raw_device\n"];
     };
 
     if ($iso_env->{cfg}->{bridged_network} && defined($vlan_id)) {
diff --git a/test/generate-ifupdown2-config.pl b/test/generate-ifupdown2-config.pl
index a3b7bdb..b33f7a7 100755
--- a/test/generate-ifupdown2-config.pl
+++ b/test/generate-ifupdown2-config.pl
@@ -152,8 +152,8 @@ is_generated(
 auto eno1
 iface eno1 inet manual
 
-auto vlan5
-iface vlan5 inet static
+auto eno1.5
+iface eno1.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device eno1
@@ -194,8 +194,8 @@ iface bond0 inet manual
 	bond-miimon 100
 	bond-mode active-backup
 
-auto vlan5
-iface vlan5 inet static
+auto bond0.5
+iface bond0.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device bond0
@@ -244,8 +244,8 @@ iface vmbr0 inet manual
 	bridge-vlan-aware yes
 	bridge-vids 2-4094
 
-auto vlan5
-iface vlan5 inet static
+auto vmbr0.5
+iface vmbr0.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device vmbr0
@@ -304,8 +304,8 @@ iface vmbr0 inet manual
 	bridge-vlan-aware yes
 	bridge-vids 2-4094
 
-auto vlan5
-iface vlan5 inet static
+auto vmbr0.5
+iface vmbr0.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device vmbr0
@@ -323,8 +323,8 @@ iface eno1 inet manual
 
 iface eno2 inet manual
 
-auto vlan5
-iface vlan5 inet static
+auto eno1.5
+iface eno1.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device eno1
@@ -347,8 +347,8 @@ iface bond0 inet manual
 	bond-miimon 100
 	bond-mode active-backup
 
-auto vlan5
-iface vlan5 inet static
+auto bond0.5
+iface bond0.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device bond0
@@ -363,8 +363,8 @@ is_generated(
 auto eno1
 iface eno1 inet manual
 
-auto vlan5
-iface vlan5 inet static
+auto eno1.5
+iface eno1.5 inet static
 	address 192.168.0.10/24
 	gateway 192.168.0.1
 	vlan-raw-device eno1
@@ -749,8 +749,8 @@ iface bond0 inet6 manual
 	bond-miimon 100
 	bond-mode active-backup
 
-auto vlan5
-iface vlan5 inet6 static
+auto bond0.5
+iface bond0.5 inet6 static
 	address 2001:db8::1/64
 	gateway fe80::1
 	vlan-raw-device bond0
@@ -797,8 +797,8 @@ is_generated(
 auto eno1
 iface eno1 inet6 manual
 
-auto vlan5
-iface vlan5 inet6 static
+auto eno1.5
+iface eno1.5 inet6 static
 	address 2001:db8::1/64
 	vlan-raw-device eno1
 
@@ -822,8 +822,8 @@ iface vmbr0 inet6 manual
 	bridge-vlan-aware yes
 	bridge-vids 2-4094
 
-auto vlan5
-iface vlan5 inet6 static
+auto vmbr0.5
+iface vmbr0.5 inet6 static
 	address 2001:db8::1/64
 	vlan-raw-device vmbr0
 EOT
@@ -834,7 +834,7 @@ set_config(bridge => 0, bond => 0, vlan => 1);
 Proxmox::Install::Config::merge({ mngmt_vlan => { enabled => 1, vid => 200 } });
 like(
     Proxmox::Install::generate_ifupdown2_config(),
-    qr/^iface vlan200 inet6 static\n\taddress 2001:db8::1\/64\n\tgateway fe80::1\n/m,
+    qr/^iface eno1.200 inet6 static\n\taddress 2001:db8::1\/64\n\tgateway fe80::1\n/m,
     'management VLAN other than the installation environment one gets the configured gateway',
 );
 
-- 
2.47.3





  reply	other threads:[~2026-11-24  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  9:39 [PATCH installer 0/2] align generated vlan-interface config with our docs Stoiko Ivanov
2026-11-24  9:39 ` Stoiko Ivanov [this message]
2026-11-24  9:39 ` [PATCH installer 2/2] network: drop unneded vlan-raw-device Stoiko Ivanov
2026-11-24 10:24 ` [PATCH installer 0/2] align generated vlan-interface config with our docs Stefan Hanreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124094025.2479405-2-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal