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 72A261FF145 for ; Thu, 22 Jan 2026 14:52:13 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 27AEC17975; Thu, 22 Jan 2026 14:52:29 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Date: Thu, 22 Jan 2026 14:51:46 +0100 Message-ID: <20260122135151.292794-2-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260122135151.292794-1-h.laimer@proxmox.com> References: <20260122135151.292794-1-h.laimer@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769089857775 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.942 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_MAILER 2 Automated Mailer Tag Left in Email SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH pve-network 1/6] sdn: evpn: prepare IPv6 underlay support X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Align EVPN's fabric and peer handling with VXLAN. So IPv6-capable underlays can be selected and IPv6 peers configured. Like with VXLAN, we don't support a dual-stack underlay, the reasoning is the same. There is no real value adding that. Signed-off-by: Hannes Laimer --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 70 ++++++++++++++++--- src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 28 ++++++-- 2 files changed, 83 insertions(+), 15 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index e53000a..88bdcb8 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -82,22 +82,41 @@ sub generate_frr_config { return; } - if (!$current_node->{ip}) { + my $all_v6 = 1; + my $all_v4 = 1; + for my $node (values %$nodes) { + $all_v6 = 0 if !$node->{ip6}; + $all_v4 = 0 if !$node->{ip}; + } + + my $addr_key; + if ($all_v6) { + $addr_key = 'ip6'; + } elsif ($all_v4) { + $addr_key = 'ip'; + } else { log_warn( - "Node $local_node requires an IP in the fabric $fabric->{id} to configure the EVPN controller" + "Fabric $fabric->{id} has no consistent address family for all nodes (need all v6 or all v4)" + ); + return; + } + + if (!$current_node->{$addr_key}) { + log_warn( + "Node $local_node requires a $addr_key address in the fabric $fabric->{id} to configure the EVPN controller" ); return; } for my $node_id (sort keys %$nodes) { my $node = $nodes->{$node_id}; - push @peers, $node->{ip} if $node->{ip}; + push @peers, $node->{$addr_key} if $node->{$addr_key}; } $loopback = "dummy_$fabric->{id}"; - $ifaceip = $current_node->{ip}; - $routerid = $current_node->{ip}; + $ifaceip = $current_node->{$addr_key}; + $routerid = $current_node->{$addr_key}; } elsif ($plugin_config->{'peers'}) { @peers = PVE::Tools::split_list($plugin_config->{'peers'}); @@ -216,21 +235,40 @@ sub generate_zone_frr_config { return; } - if (!$current_node->{ip}) { + my $all_v6 = 1; + my $all_v4 = 1; + for my $node (values %$nodes) { + $all_v6 = 0 if !$node->{ip6}; + $all_v4 = 0 if !$node->{ip}; + } + + my $addr_key; + if ($all_v6) { + $addr_key = 'ip6'; + } elsif ($all_v4) { + $addr_key = 'ip'; + } else { + log_warn( + "Fabric $fabric->{id} has no consistent address family for all nodes (need all v6 or all v4)" + ); + return; + } + + if (!$current_node->{$addr_key}) { log_warn( - "Node $local_node requires an IP in the fabric $fabric->{id} to configure the EVPN controller" + "Node $local_node requires a $addr_key address in the fabric $fabric->{id} to configure the EVPN controller" ); return; } for my $node (values %$nodes) { - push @peers, $node->{ip} if $node->{ip}; + push @peers, $node->{$addr_key} if $node->{$addr_key}; } $loopback = "dummy_$fabric->{id}"; - $ifaceip = $current_node->{ip}; - $routerid = $current_node->{ip}; + $ifaceip = $current_node->{$addr_key}; + $routerid = $current_node->{$addr_key}; } elsif ($controller->{peers}) { @peers = PVE::Tools::split_list($controller->{'peers'}) if $controller->{'peers'}; @@ -497,6 +535,18 @@ sub on_update_hook { die "must have exactly one of peers / fabric defined" if ($controller->{peers} && $controller->{fabric}) || !($controller->{peers} || $controller->{fabric}); + if ($controller->{peers}) { + my @peers = PVE::Tools::split_list($controller->{peers}); + my $family; + + foreach my $peer (@peers) { + my $peer_family = Net::IP::ip_is_ipv6($peer) ? 6 : 4; + if (defined($family) && $family != $peer_family) { + die "peers must contain only IPv4 or only IPv6 addresses\n"; + } + $family = $peer_family; + } + } } } diff --git a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm index 6d89499..227d917 100644 --- a/src/PVE/Network/SDN/Zones/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Zones/EvpnPlugin.pm @@ -176,17 +176,35 @@ sub generate_sdn_config { my $current_node = eval { $config->get_node($controller->{fabric}, $local_node) }; die "could not configure EVPN zone $plugin_config->{id}: $@" if $@; - die "Node $local_node requires an IP in the fabric $fabric->{id} to configure the EVPN zone" - if !$current_node->{ip}; + my $all_v6 = 1; + my $all_v4 = 1; + for my $node (values %$nodes) { + $all_v6 = 0 if !$node->{ip6}; + $all_v4 = 0 if !$node->{ip}; + } + + my $addr_key; + if ($all_v6) { + $addr_key = 'ip6'; + } elsif ($all_v4) { + $addr_key = 'ip'; + } else { + die + "Fabric $fabric->{id} has no consistent address family for all nodes (need all v6 or all v4)"; + } + + die + "Node $local_node requires a $addr_key address in the fabric $fabric->{id} to configure the EVPN zone" + if !$current_node->{$addr_key}; for my $node (values %$nodes) { - push @peers, $node->{ip} if $node->{ip}; + push @peers, $node->{$addr_key} if $node->{$addr_key}; } $loopback = "dummy_$fabric->{id}"; - $ifaceip = $current_node->{ip}; - $routerid = $current_node->{ip}; + $ifaceip = $current_node->{$addr_key}; + $routerid = $current_node->{$addr_key}; } else { die "neither fabric nor peers configured for EVPN controller $controller->{id}"; } -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel