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 3E7C91FF0B6 for ; Thu, 12 Nov 2026 13:42:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 54577216EC; Thu, 12 Nov 2026 13:42:30 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v7 05/21] sdn: zones: account for IPv6 in the VXLAN and EVPN MTU Date: Thu, 12 Nov 2026 13:41:45 +0100 Message-ID: <20261112124201.2844423-6-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112124201.2844423-1-h.laimer@proxmox.com> References: <20261112124201.2844423-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794487335939 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.709 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) KAM_MAILER 2 Automated Mailer Tag Left in Email 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: 454PNO5THT3IAEEFO76NVANWDWZIPG55 X-Message-ID-Hash: 454PNO5THT3IAEEFO76NVANWDWZIPG55 X-MailFrom: h.laimer@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: VXLAN encapsulation takes 50 bytes over IPv4 and 70 over IPv6, since the IPv6 header is 20 bytes larger. The MTU of a VXLAN or EVPN zone without its own setting always had 50 taken off, so over an IPv6 underlay it came out 20 bytes too large. The encapsulation now follows the address family of the local tunnel address. A zone with an IPv6 underlay and no MTU of its own gets 1430 where it got 1450, or its underlay interface's MTU minus 70. Signed-off-by: Hannes Laimer --- src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 2 +- src/PVE/Network/SDN/Zones/VxlanPlugin.pm | 16 +++++++++------- .../evpn/ipv6underlay/expected_sdn_interfaces | 8 ++++---- .../expected_sdn_interfaces | 8 ++++---- .../expected_sdn_interfaces | 8 ++++---- .../zones/vxlan/ipv6/expected_sdn_interfaces | 4 ++-- .../underlay_mtu_ipv6/expected_sdn_interfaces | 16 ++++++++++++++++ .../zones/vxlan/underlay_mtu_ipv6/interfaces | 8 ++++++++ .../zones/vxlan/underlay_mtu_ipv6/sdn_config | 17 +++++++++++++++++ 9 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 src/test/zones/vxlan/underlay_mtu_ipv6/expected_sdn_interfaces create mode 100644 src/test/zones/vxlan/underlay_mtu_ipv6/interfaces create mode 100644 src/test/zones/vxlan/underlay_mtu_ipv6/sdn_config diff --git a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm index 1720e1ff5735..9a85a9d9bf72 100644 --- a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm @@ -219,7 +219,7 @@ sub generate_sdn_config { my $exitnodes_local_routing = $plugin_config->{'exitnodes-local-routing'}; my $mtu = PVE::Network::SDN::Zones::VxlanPlugin::vxlan_mtu( - $plugin_config, $iface, $interfaces_config, + $plugin_config, $iface, $interfaces_config, $ifaceip, ); #vxlan interface diff --git a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm index 4992757c1c5b..d8301bac0f3a 100644 --- a/src/PVE/Network/SDN/Zones/VxlanPlugin.pm +++ b/src/PVE/Network/SDN/Zones/VxlanPlugin.pm @@ -49,15 +49,17 @@ sub properties { } # the vnet bridge takes the underlay interface's MTU minus the vxlan -# encapsulation where the peers name a local interface, the default -# otherwise. An explicit zone MTU wins +# encapsulation where the peers name a local interface, and 1500 minus the +# encapsulation otherwise. The encapsulation takes 50 bytes over IPv4 and 70 +# over IPv6, by the family of the local tunnel address. An explicit zone MTU +# wins sub vxlan_mtu { - my ($plugin_config, $iface, $interfaces_config) = @_; + my ($plugin_config, $iface, $interfaces_config, $ifaceip) = @_; return $plugin_config->{mtu} if $plugin_config->{mtu}; - return $interfaces_config->{ifaces}->{$iface}->{mtu} - 50 - if $iface && $interfaces_config->{ifaces}->{$iface}->{mtu}; - return 1450; + my $family = PVE::Network::SDN::Zones::Plugin::ip_family($ifaceip) // 4; + my $underlay = ($iface && $interfaces_config->{ifaces}->{$iface}->{mtu}) || 1500; + return $underlay - ($family == 6 ? 70 : 50); } sub options { @@ -132,7 +134,7 @@ sub generate_sdn_config { die "neither peers nor fabric configured for VXLAN zone $plugin_config->{id}"; } - my $mtu = vxlan_mtu($plugin_config, $iface, $interfaces_config); + my $mtu = vxlan_mtu($plugin_config, $iface, $interfaces_config, $ifaceip); #vxlan interface my @iface_config = (); diff --git a/src/test/zones/evpn/ipv6underlay/expected_sdn_interfaces b/src/test/zones/evpn/ipv6underlay/expected_sdn_interfaces index 3b91f75eb3dd..c39cd77209ab 100644 --- a/src/test/zones/evpn/ipv6underlay/expected_sdn_interfaces +++ b/src/test/zones/evpn/ipv6underlay/expected_sdn_interfaces @@ -7,7 +7,7 @@ iface myvnet bridge_ports vxlan_myvnet bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 ip6-forward on arp-accept on vrf vrf_myzone @@ -22,7 +22,7 @@ iface vrfbr_myzone bridge-ports vrfvx_myzone bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 vrf vrf_myzone auto vrfvx_myzone @@ -31,7 +31,7 @@ iface vrfvx_myzone vxlan-local-tunnelip 2a08:2200:100:1::10 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 auto vxlan_myvnet iface vxlan_myvnet @@ -39,4 +39,4 @@ iface vxlan_myvnet vxlan-local-tunnelip 2a08:2200:100:1::10 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 diff --git a/src/test/zones/evpn/openfabric_fabric_ipv6/expected_sdn_interfaces b/src/test/zones/evpn/openfabric_fabric_ipv6/expected_sdn_interfaces index d01771386658..6286fea4052b 100644 --- a/src/test/zones/evpn/openfabric_fabric_ipv6/expected_sdn_interfaces +++ b/src/test/zones/evpn/openfabric_fabric_ipv6/expected_sdn_interfaces @@ -7,7 +7,7 @@ iface vnet0 bridge_ports vxlan_vnet0 bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 ip-forward on arp-accept on vrf vrf_evpn @@ -22,7 +22,7 @@ iface vrfbr_evpn bridge-ports vrfvx_evpn bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 vrf vrf_evpn auto vrfvx_evpn @@ -31,7 +31,7 @@ iface vrfvx_evpn vxlan-local-tunnelip fd00::1 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 auto vxlan_vnet0 iface vxlan_vnet0 @@ -39,7 +39,7 @@ iface vxlan_vnet0 vxlan-local-tunnelip fd00::1 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 auto dummy_test iface dummy_test inet static diff --git a/src/test/zones/evpn/openfabric_fabric_ipv6_only/expected_sdn_interfaces b/src/test/zones/evpn/openfabric_fabric_ipv6_only/expected_sdn_interfaces index 51507d7d3fbe..6e56e9cda300 100644 --- a/src/test/zones/evpn/openfabric_fabric_ipv6_only/expected_sdn_interfaces +++ b/src/test/zones/evpn/openfabric_fabric_ipv6_only/expected_sdn_interfaces @@ -7,7 +7,7 @@ iface vnet0 bridge_ports vxlan_vnet0 bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 ip-forward on arp-accept on vrf vrf_evpn @@ -22,7 +22,7 @@ iface vrfbr_evpn bridge-ports vrfvx_evpn bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 vrf vrf_evpn auto vrfvx_evpn @@ -31,7 +31,7 @@ iface vrfvx_evpn vxlan-local-tunnelip fd00::1 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 auto vxlan_vnet0 iface vxlan_vnet0 @@ -39,7 +39,7 @@ iface vxlan_vnet0 vxlan-local-tunnelip fd00::1 bridge-learning off bridge-arp-nd-suppress on - mtu 1450 + mtu 1430 auto dummy_test iface dummy_test inet6 static diff --git a/src/test/zones/vxlan/ipv6/expected_sdn_interfaces b/src/test/zones/vxlan/ipv6/expected_sdn_interfaces index 14354f61f923..85ea38b59502 100644 --- a/src/test/zones/vxlan/ipv6/expected_sdn_interfaces +++ b/src/test/zones/vxlan/ipv6/expected_sdn_interfaces @@ -5,7 +5,7 @@ iface myvnet bridge_ports vxlan_myvnet bridge_stp off bridge_fd 0 - mtu 1450 + mtu 1430 auto vxlan_myvnet iface vxlan_myvnet @@ -13,4 +13,4 @@ iface vxlan_myvnet vxlan-local-tunnelip 2a08:2200:100:1::10 vxlan_remoteip 2a08:2200:100:1::11 vxlan_remoteip 2a08:2200:100:1::12 - mtu 1450 + mtu 1430 diff --git a/src/test/zones/vxlan/underlay_mtu_ipv6/expected_sdn_interfaces b/src/test/zones/vxlan/underlay_mtu_ipv6/expected_sdn_interfaces new file mode 100644 index 000000000000..9a3b009459a8 --- /dev/null +++ b/src/test/zones/vxlan/underlay_mtu_ipv6/expected_sdn_interfaces @@ -0,0 +1,16 @@ +#version:1 + +auto myvnet +iface myvnet + bridge_ports vxlan_myvnet + bridge_stp off + bridge_fd 0 + mtu 8930 + +auto vxlan_myvnet +iface vxlan_myvnet + vxlan-id 100 + vxlan-local-tunnelip 2a08:2200:100:1::10 + vxlan_remoteip 2a08:2200:100:1::11 + vxlan_remoteip 2a08:2200:100:1::12 + mtu 8930 diff --git a/src/test/zones/vxlan/underlay_mtu_ipv6/interfaces b/src/test/zones/vxlan/underlay_mtu_ipv6/interfaces new file mode 100644 index 000000000000..1f61faea7fc5 --- /dev/null +++ b/src/test/zones/vxlan/underlay_mtu_ipv6/interfaces @@ -0,0 +1,8 @@ +auto vmbr0 +iface vmbr0 inet6 static + address 2a08:2200:100:1::10/64 + gateway 2a08:2200:100:1::1 + mtu 9000 + bridge-ports eth0 + bridge-stp off + bridge-fd 0 diff --git a/src/test/zones/vxlan/underlay_mtu_ipv6/sdn_config b/src/test/zones/vxlan/underlay_mtu_ipv6/sdn_config new file mode 100644 index 000000000000..484be230512d --- /dev/null +++ b/src/test/zones/vxlan/underlay_mtu_ipv6/sdn_config @@ -0,0 +1,17 @@ +{ + version => 1, + vnets => { + ids => { + myvnet => { tag => 100, type => "vnet", zone => "myzone" }, + }, + }, + zones => { + ids => { + myzone => { + ipam => "pve", + type => "vxlan", + peers => "2a08:2200:100:1::10,2a08:2200:100:1::11,2a08:2200:100:1::12", + }, + }, + }, +} -- 2.47.3