[pve-devel] [PATCH pve-network] fix #5324: non vlanaware zone: add mtu to veth links

Alexandre Derumier aderumier at odiso.com
Mon Mar 25 18:01:49 CET 2024


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/Network/SDN/Zones/VlanPlugin.pm            | 3 +++
 src/test/zones/vlan/bridge/expected_sdn_interfaces | 4 ++++
 src/test/zones/vlan/bridge/sdn_config              | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Network/SDN/Zones/VlanPlugin.pm b/src/PVE/Network/SDN/Zones/VlanPlugin.pm
index 6a68e8d..13fb49e 100644
--- a/src/PVE/Network/SDN/Zones/VlanPlugin.pm
+++ b/src/PVE/Network/SDN/Zones/VlanPlugin.pm
@@ -106,17 +106,20 @@ sub generate_sdn_config {
 	@iface_config = ();
 	push @iface_config, "link-type veth";
 	push @iface_config, "veth-peer-name $vnet_uplinkpeer";
+	push @iface_config, "mtu $mtu" if $mtu;
 	push(@{$config->{$vnet_uplink}}, @iface_config) if !$config->{$vnet_uplink};
 
 	@iface_config = ();
 	push @iface_config, "link-type veth";
 	push @iface_config, "veth-peer-name $vnet_uplink";
+	push @iface_config, "mtu $mtu" if $mtu;
 	push(@{$config->{$vnet_uplinkpeer}}, @iface_config) if !$config->{$vnet_uplinkpeer};
 
 	@iface_config = ();
 	push @iface_config, "bridge_ports $bridge_ports $vnet_uplinkpeer";
 	push @iface_config, "bridge_stp off";
 	push @iface_config, "bridge_fd 0";
+	push @iface_config, "mtu $mtu" if $mtu;
 	push(@{$config->{$bridgevlan}}, @iface_config) if !$config->{$bridgevlan};
     }
 
diff --git a/src/test/zones/vlan/bridge/expected_sdn_interfaces b/src/test/zones/vlan/bridge/expected_sdn_interfaces
index f9e96d1..fc05ff7 100644
--- a/src/test/zones/vlan/bridge/expected_sdn_interfaces
+++ b/src/test/zones/vlan/bridge/expected_sdn_interfaces
@@ -4,20 +4,24 @@ auto ln_myvnet
 iface ln_myvnet
 	link-type veth
 	veth-peer-name pr_myvnet
+	mtu 9200
 
 auto myvnet
 iface myvnet
 	bridge_ports ln_myvnet
 	bridge_stp off
 	bridge_fd 0
+	mtu 9200
 
 auto pr_myvnet
 iface pr_myvnet
 	link-type veth
 	veth-peer-name ln_myvnet
+	mtu 9200
 
 auto vmbr0v100
 iface vmbr0v100
 	bridge_ports  eth0.100 pr_myvnet
 	bridge_stp off
 	bridge_fd 0
+	mtu 9200
diff --git a/src/test/zones/vlan/bridge/sdn_config b/src/test/zones/vlan/bridge/sdn_config
index c6cfaaa..c61e659 100644
--- a/src/test/zones/vlan/bridge/sdn_config
+++ b/src/test/zones/vlan/bridge/sdn_config
@@ -6,6 +6,6 @@
                       },
              },
   zones   => {
-               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan" } },
+               ids => { myzone => { bridge => "vmbr0", ipam => "pve", type => "vlan", mtu => "9200" } },
              },
 }
-- 
2.39.2




More information about the pve-devel mailing list