[pve-devel] [PATCH common] fix #4547: set MTU on dynamically created vlan bridges

Dominik Csapak d.csapak at proxmox.com
Fri Feb 24 12:06:21 CET 2023


Otherwise the created vlan bridge has the default MTU, which is
unexpected when the original bridge has some other MTU configured.

We already do this for the firewall bridges, so we should do so too for
the vlan bridges.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
technically this is a breaking change i think, since someone might
depend on the fact that the vlan bridges always have the default mtu,
but there is no way to configure that besides from manually modifying
the /etc/network/interfaces file, so not completely sure
if we want to do that now, or with the next major release

 src/PVE/Network.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 355637b..22ca5b3 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -620,6 +620,9 @@ sub activate_bridge_vlan {
 	    iface_create($bridgevlan, 'bridge');
 	}
 
+	my $bridgemtu = read_bridge_mtu($bridge);
+	eval { run_command(['/sbin/ip', 'link', 'set', $bridgevlan, 'mtu', $bridgemtu]) };
+
 	# for each physical interface (eth or bridge) bind them to bridge vlan
 	foreach my $iface (@ifaces) {
 	    activate_bridge_vlan_slave($bridgevlan, $iface, $tag);
-- 
2.30.2






More information about the pve-devel mailing list