From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id F15C51FF136 for ; Mon, 04 May 2026 18:25:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 613EB9809; Mon, 4 May 2026 18:25:25 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v2 09/18] evpn controller: add ebgp-multihop setting Date: Mon, 4 May 2026 18:24:48 +0200 Message-ID: <20260504162501.425135-10-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260504162501.425135-1-s.hanreich@proxmox.com> References: <20260504162501.425135-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: 1777911803228 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.661 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: MF6HHMTR5QNWOIJ4BDQGNFJOHMPJA6O7 X-Message-ID-Hash: MF6HHMTR5QNWOIJ4BDQGNFJOHMPJA6O7 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 Reviewed-by: Hannes Laimer --- 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 b849948..43d97f0 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 2b9fe5b..3264cf5 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