From: Hannes Laimer <h.laimer@proxmox.com>
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 [thread overview]
Message-ID: <20261112124201.2844423-6-h.laimer@proxmox.com> (raw)
In-Reply-To: <20261112124201.2844423-1-h.laimer@proxmox.com>
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 <h.laimer@proxmox.com>
---
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
next prev parent reply other threads:[~2026-11-12 12:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 12:41 [PATCH container/docs/manager/network/proxmox{,-perl-rs,-ve-rs}/qemu-server v7 00/21] sdn: implement DHCP for all zones using eBPF Hannes Laimer
2026-11-12 12:41 ` [PATCH proxmox v7 01/21] network-types: mac address: add an accessor for the bytes Hannes Laimer
2026-11-12 12:41 ` [PATCH proxmox-perl-rs v7 02/21] pve-rs: sdn: add bindings for the eBPF DHCP responder Hannes Laimer
2026-11-12 12:41 ` [PATCH proxmox-perl-rs v7 03/21] pve-rs: fire the pve-ebpf-update trigger on upgrade Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 04/21] sdn: zones: take the VXLAN and EVPN MTU from the underlay interface Hannes Laimer
2026-11-12 12:41 ` Hannes Laimer [this message]
2026-11-12 12:41 ` [PATCH pve-network v7 06/21] sdn: dhcp: make the lease time configurable per subnet Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 07/21] sdn: dhcp: require a backend only if a zone on this node uses it Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 08/21] bpf: add the build, the package and a native harness for BPF programs Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 09/21] sdn: dhcp: add the per-tap DHCPv4 responder program Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 10/21] sdn: dhcp: add an eBPF backend answering on each guest interface Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 11/21] sdn: zones: report interface plugs and unplugs to the DHCP backends Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 12/21] sdn: zones: factor out the underlay lookup of VXLAN and EVPN zones Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-network v7 13/21] sdn: zones: allow the ebpf DHCP backend on every zone type Hannes Laimer
2026-11-12 12:41 ` [PATCH qemu-server v7 14/21] network: sdn: keep the DHCP backends current on guest NICs Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-container v7 15/21] net: report NIC plugs and removals to the SDN DHCP backends Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-manager v7 16/21] ui: sdn: add zone DHCP backend selector and subnet DHCP options Hannes Laimer
2026-11-12 12:41 ` [PATCH pve-manager v7 17/21] sdn: bring up the DHCP backends at boot before the guests start Hannes Laimer
2026-11-12 12:41 ` [PATCH proxmox-ve-rs v7 18/21] ve-config: sdn: add the ebpf dhcp backend Hannes Laimer
2026-11-12 12:41 ` [PATCH proxmox-ve-rs v7 19/21] sdn-dhcp: add the crate that runs the eBPF DHCP responder Hannes Laimer
2026-11-12 12:42 ` [PATCH pve-docs v7 20/21] sdn: zones: document the MTU taken from the underlay interface Hannes Laimer
2026-11-12 12:42 ` [PATCH pve-docs v7 21/21] sdn: dhcp: add eBPF backend section Hannes Laimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261112124201.2844423-6-h.laimer@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.