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 040A41FF13A for ; Wed, 13 May 2026 17:07:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5455F134B3; Wed, 13 May 2026 17:07:14 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v3 09/18] evpn controller: add ebgp-multihop setting Date: Wed, 13 May 2026 17:05:55 +0200 Message-ID: <20260513150609.375436-10-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260513150609.375436-1-s.hanreich@proxmox.com> References: <20260513150609.375436-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: 1778684772953 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.610 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: FYPWYJQ4RFIJWNCQTDTYVDUAXFDT5VSZ X-Message-ID-Hash: FYPWYJQ4RFIJWNCQTDTYVDUAXFDT5VSZ 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 b8499485..43d97f04 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 a130784d..b62fdfff 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -65,6 +65,7 @@ sub options { 'route-map-out' => { optional => 1 }, 'nodes' => { optional => 1 }, 'peer-group-name' => { optional => 1 }, + 'ebgp-multihop' => { optional => 1 }, 'bgp-mode' => { optional => 1 }, }; } @@ -208,7 +209,12 @@ sub generate_frr_config { interfaces => [], }; - $neighbor_group->{ebgp_multihop} = 10 if $ebgp && $loopback && $bgp_mode eq 'auto'; + if ($bgp_mode eq 'auto') { + $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 17f55ff9..6da3eec5 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