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 4DF971FF13F for ; Thu, 18 Jun 2026 08:35:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2943CBD18; Thu, 18 Jun 2026 08:35:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781721160; x=1782325960; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3oTQT78+zJ2vTi6nMBcMh18LCthbC7EBwBZDbyudbPI=; b=p48eYYT7A+OoQsRePVRU4n0N21GyCmeqbmIpLbMd9wFh7Tp22SWZAHquQ4mAhyKXSO wfiA/CtMUhpFNnIGXB7EKiC1RmG8R16QWVOmT10C0s/VPEVTi4SW7qegj5W7kskjDJfe xzu1YJJzwNvRsVwIT7ad5V5xejC13KyD/wOdwjIuNKee8M8BJVTzLzArffFjlpVTmZRk UO38g5+vgDkhbBCJmR21MYS46CkgEMA+ZKhtypuU3rodhmagsxmit8I5jLYt4V+ASH0a jCU8p7i4+THrpoU9IofWdOrB1uX2WjX6TiEza1XsZN7TFdlRG6c39nZSx87rHMFGH9pi 3f1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781721160; x=1782325960; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3oTQT78+zJ2vTi6nMBcMh18LCthbC7EBwBZDbyudbPI=; b=LgQ8ri8K4Uaiz2DOeiBVQxwiHm2wWV5NlMI4doWQfhDJUHevV+TdNb9lN4ysMWL9fg PLYU5XZ3TJ04/EcSiHY09gFxs1jEm/UunXwLqeL0B/N9AwoxjuB4ieFawMmzz4IwxRdf W5hB1srOXYItmxE12rATrgqnSTZtYbBSGSnlnezLcuvcGbkDgoRB+dCYnmcxNh+IOHrA PohfN3gy6rGU2nYMQkoHnNRwhanhK9lFGs5I2PxjMpAzMe/XmzljjB1PqD+isI0rj5eB RqQ+B7ECLnWN76cHKgnQ+gFJyBFY+KMEpNMcckzLSXzMk6TUDyprYjfzXuxn7oHvX1om u/aw== X-Gm-Message-State: AOJu0Yx0u5jNUFyq/237OzZr4EKmr3grgIFjPRjsALgq+XnyVUVTL7+E 8y0pZGZa4bfubBcf8QPZA4/TQB9jO0bCsOmVvGGeuzoIc01vgk0EXzgE/7DVbZ+b X-Gm-Gg: AfdE7cll575i+3s00JwhAyZP+k9Xk+v/Gv/NfLZbIEuPeAtQu+5Fjn3HrfwWAwsm7Ow bi4dIUh/z++bcErKdXB614MLeUvhhB7VjDmHhVvHD6TTYwlmJSojkLdBKmm+37HXLH2jYcxKCWi /I/T40RpVsYmiZWtd1IIC3dgXhGBYk3U2O89bL01bjUS8zi/7BTBxl+pJ1TCoNJQEhR2NOWg/Br EoLj03iyoT28ehRMn7sRMVK5XFOz3fTg3XyoxR3ZD7s2x0Pl3hG9UM86wR6kxU5j1SU2PnybVfE 76mK+pv6RZYUbYMTjOu95fqpF2824kxEwEjelcYenlApwQlf89fzLiqNb7B/Eau586P3Q9SiyLK 73QVBD51hCQlsv6aWpxcK/6l6DmES4BgfDbCd0B6G5WlP182F6uWfJFTUiRK6jvPnD06Tj+gauN 8gNwXOfkrYfdr4OUWpCT/2 X-Received: by 2002:a05:6214:3906:b0:8dc:6d77:30d4 with SMTP id 6a1803df08f44-8dc6d77336bmr38604696d6.10.1781721159704; Wed, 17 Jun 2026 11:32:39 -0700 (PDT) From: Ilan Karasik To: pve-devel@lists.proxmox.com Subject: [PATCH v2] fix #7571: emit mtu in ifupdown-based LXC guests Date: Wed, 17 Jun 2026 14:32:29 -0400 Message-ID: <20260617183228.95036-2-ilankarasik@gmail.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <1781605179.y4iy928e70.astroid@yuna.none> References: <1781605179.y4iy928e70.astroid@yuna.none> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [debian.pm] X-MailFrom: ilankarasik@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: FCUIK7KKBOUNCXGXYA3AQENNJA7N7JUA X-Message-ID-Hash: FCUIK7KKBOUNCXGXYA3AQENNJA7N7JUA X-Mailman-Approved-At: Thu, 18 Jun 2026 08:35:49 +0200 CC: Ilan Karasik X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This fixes a bug where custom mtu settings applied to an LXC container are silently ignored during network setup for Debian-based guests using ifupdown. Because the Proxmox network setup was failing to write the mtu value to the guest's `/etc/network/interfaces` file, the container would always default to an mtu of 1500. This patch resolves the issue by writing the `mtu ` directive into the guest's network configuration file at /etc/network/interfaces. Signed-off-by: Ilan Karasik --- src/PVE/LXC/Setup/Debian.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/LXC/Setup/Debian.pm b/src/PVE/LXC/Setup/Debian.pm index 837397b..bbf73d5 100644 --- a/src/PVE/LXC/Setup/Debian.pm +++ b/src/PVE/LXC/Setup/Debian.pm @@ -284,6 +284,7 @@ sub setup_network { $net->{needsroute6} = 1; } } + $net->{mtu} = $d->{mtu} if defined($d->{mtu}); $networks->{ $d->{name} } = $net if keys %$net; } } @@ -337,6 +338,7 @@ sub setup_network { $interfaces .= "\tgateway $gw\n"; } } + $interfaces .= "\tmtu $net->{mtu}\n" if defined($net->{mtu}); foreach my $attr (@{ $section->{attr} }) { $interfaces .= "\t$attr\n"; } @@ -450,6 +452,7 @@ sub setup_network { || $aname eq 'netmask' || $aname eq 'gateway' || $aname eq 'broadcast' + || $aname eq 'mtu' ) { # skip } else { -- 2.51.2