From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id B019D1FF09C for ; Mon, 02 Nov 2026 13:48:46 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 59B7B217DD; Mon, 02 Nov 2026 13:48:35 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH installer v4 19/30] gui: network: add vlan setup options to advanced network dialog Date: Mon, 2 Nov 2026 13:45:25 +0100 Message-ID: <20261102124539.1008075-20-c.heiss@proxmox.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261102124539.1008075-1-c.heiss@proxmox.com> References: <20261102124539.1008075-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: 1793623640676 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.198 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: BXFABCZ25LFPNTG5PWTTSZIAIR2XRH3L X-Message-ID-Hash: BXFABCZ25LFPNTG5PWTTSZIAIR2XRH3L 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: Fixes #2164 [0]. Adds a third frame to the advanced network options dialog, allowing to set a VLAN ID for the management interface. [0] https://bugzilla.proxmox.com/show_bug.cgi?id=2164 Signed-off-by: Christoph Heiss --- Changes v3 -> v4: * don't expand checkbox and grid, which resulted in unnecessary padding and dialog size Changes v2 -> v3: * new patch proxinstall | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/proxinstall b/proxinstall index a676018..2622871 100755 --- a/proxinstall +++ b/proxinstall @@ -87,6 +87,7 @@ my @steps = ( # GUI global variables my $gtk_state = { network_bonding_enabled => 0, + network_vlan_enabled => 0, }; my $target_hds; # only for the summary view @@ -641,6 +642,64 @@ my sub create_network_bond_frame { return ($frame, $refresh_if_names, $on_done); } +my sub create_network_vlan_frame { + my $frame = Gtk3::Frame->new('Management VLAN'); + + my $vbox = Gtk3::Box->new('vertical', 5); + $frame->add($vbox); + $vbox->set_margin_start(10); + $vbox->set_margin_end(10); + $vbox->set_margin_top(5); + $vbox->set_margin_bottom(5); + + my $enable_checkbox = Gtk3::CheckButton->new('Enable VLAN setup on management interface'); + $enable_checkbox->set_active($gtk_state->{network_vlan_enabled}); + $vbox->pack_start($enable_checkbox, 1, 0, 5); + + my $vlan_opts = Proxmox::Install::Config::get_mngmt_vlan_opt(); + + my $initial_vid = $vlan_opts->{vid} > 0 ? $vlan_opts->{vid} : 1; + my $vid_adjustment = Gtk3::Adjustment->new($initial_vid, 2, 4095, 1, 1, 1); + my $vid_input = Gtk3::SpinButton->new($vid_adjustment, 1, 0); + $vid_input->set_tooltip_text('Must be between 2 and 4094 inclusive.'); + + my $opts_grid = $create_label_widget_grid->([ + ['VLAN tag', $vid_input], + ]); + + $vbox->pack_start($opts_grid, 0, 0, 5); + + my $set_sensitive = sub { + my ($active) = @_; + + $opts_grid->foreach(sub { + $_[0]->set_sensitive($active); + }); + }; + $set_sensitive->($gtk_state->{network_vlan_enabled}); + + $enable_checkbox->signal_connect( + toggled => sub { + my $active = !!$enable_checkbox->get_active(); + + $gtk_state->{network_vlan_enabled} = $active; + $set_sensitive->($active); + }, + ); + + my $on_done = sub { + if (!$enable_checkbox->get_active()) { + Proxmox::Install::Config::set_mngmt_vlan_opt('enabled', 0); + return; + } + + Proxmox::Install::Config::set_mngmt_vlan_opt('vid', $vid_input->get_value_as_int()); + Proxmox::Install::Config::set_mngmt_vlan_opt('enabled', 1); + }; + + return ($frame, $on_done); +} + my sub create_network_advanced_options_view { my ($done_cb) = @_; @@ -661,9 +720,11 @@ my sub create_network_advanced_options_view { my ($bond_frame, $bond_refresh, $bond_on_done) = create_network_bond_frame(); my ($pin_frame, $pin_on_done) = create_network_interface_pin_frame($bond_refresh); + my ($vlan_frame, $vlan_on_done) = create_network_vlan_frame(); $hbox->pack_start($pin_frame, 0, 0, 10); $hbox->pack_start($bond_frame, 0, 0, 10); + $hbox->pack_start($vlan_frame, 0, 0, 10); $scrolled_window->add($hbox); $content->pack_start($scrolled_window, 1, 1, 10); @@ -674,6 +735,7 @@ my sub create_network_advanced_options_view { eval { $pin_on_done->(); $bond_on_done->(); + $vlan_on_done->(); }; if ($@) { Proxmox::UI::message($@, $dialog); @@ -1062,6 +1124,11 @@ sub create_ack_view { : $iface->{name}; } + if (Proxmox::Install::Config::get_mngmt_vlan_enabled()) { + my $vid = Proxmox::Install::Config::get_mngmt_vlan_opt('vid'); + $interface .= ", VLAN $vid"; + } + my %config_values = ( __target_hd__ => join(' | ', $target_hds->@*), __target_fs__ => Proxmox::Install::Config::get_filesys(), -- 2.55.0