[PATCH pve-network 09/16] evpn controller: add ebgp-multihop setting

Stefan Hanreich
2026-04-14T16:34:12Z

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 <s.hanreich@proxmox.com>
---
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