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 412E71FF18C for ; Tue, 14 Apr 2026 18:34:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 23FAA1F303; Tue, 14 Apr 2026 18:33:59 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network 09/16] evpn controller: add ebgp-multihop setting Date: Tue, 14 Apr 2026 18:33:06 +0200 Message-ID: <20260414163315.419384-10-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260414163315.419384-1-s.hanreich@proxmox.com> References: <20260414163315.419384-1-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776184326697 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.695 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 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: F4P3JPP6OEPIWA32FBRMNTYORVY66KHO X-Message-ID-Hash: F4P3JPP6OEPIWA32FBRMNTYORVY66KHO X-MailFrom: s.hanreich@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: This setting already exists in the BGP plugin, so it is moved to the base plugin - so that it can be reused by the EVPN controller as well. This setting only has an effect if the BGP mode is explicitly set to eBGP. This setting is required in particular for implementing Inter-AS Option C, defined in RFC 4364, which requires the use of multihop eBGP sessions. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Controllers/BgpPlugin.pm | 5 ----- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 8 +++++++- src/PVE/Network/SDN/Controllers/Plugin.pm | 5 +++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/PVE/Network/SDN/Controllers/BgpPlugin.pm b/src/PVE/Network/SDN/Controllers/BgpPlugin.pm index 5edbae6..b54b566 100644 --- a/src/PVE/Network/SDN/Controllers/BgpPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/BgpPlugin.pm @@ -30,11 +30,6 @@ sub properties { optional => 1, description => "Enable eBGP (remote-as external).", }, - 'ebgp-multihop' => { - type => 'integer', - optional => 1, - description => 'Set maximum amount of hops for eBGP peers.', - }, loopback => { description => "Name of the loopback/dummy interface that provides the Router-IP.", type => 'string', diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index e9bee33..ac92ea8 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -64,6 +64,7 @@ sub options { 'route-map-out' => { optional => 1 }, 'nodes' => { optional => 1 }, 'peer-group-name' => { optional => 1 }, + 'ebgp-multihop' => { optional => 1 }, 'bgp-mode' => { optional => 1 }, }; } @@ -207,7 +208,12 @@ sub generate_frr_config { interfaces => [], }; - $neighbor_group->{ebgp_multihop} = 10 if $ebgp && $loopback && $bgp_mode eq 'legacy'; + if ($bgp_mode eq 'legacy') { + $neighbor_group->{ebgp_multihop} = 10 if $ebgp && $loopback; + } elsif ($bgp_mode eq 'external') { + $neighbor_group->{ebgp_multihop} = int($plugin_config->{'ebgp-multihop'}) + if $ebgp && $plugin_config->{'ebgp-multihop'}; + } if ($asn != int($bgp_router->{asn})) { # should never trigger due to validation, but asserting it here nonetheless diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm index f9301a3..7cd98ca 100644 --- a/src/PVE/Network/SDN/Controllers/Plugin.pm +++ b/src/PVE/Network/SDN/Controllers/Plugin.pm @@ -54,6 +54,11 @@ my $defaultData = { format => 'pve-sdn-route-map-id', optional => 1, }, + 'ebgp-multihop' => { + type => 'integer', + optional => 1, + description => 'Set maximum amount of hops for eBGP peers.', + }, }, }; -- 2.47.3