all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network v6 5/9] sdn: forbid BGP controller and BGP fabric coexistence
Date: Fri, 15 May 2026 12:24:56 +0200	[thread overview]
Message-ID: <20260515102500.216264-6-h.laimer@proxmox.com> (raw)
In-Reply-To: <20260515102500.216264-1-h.laimer@proxmox.com>

The BGP controller and the BGP fabric both populate the default-VRF
BGP router. The merge in proxmox-frr was designed for the
EVPN-controller + fabric overlap, not for two BGP underlays in one
router: the resulting router-level ASN is order-dependent, the two
source-correction route-maps fight for the single 'ip protocol bgp'
binding, and loopback prefixes get advertised over two sessions with
differing path attributes.

Reject the combination when creating either side while the other exists.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/PVE/API2/Network/SDN/Fabrics/Fabric.pm   | 10 ++++++++++
 src/PVE/Network/SDN/Controllers/BgpPlugin.pm |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm b/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm
index 1201654..4695a6e 100644
--- a/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm
+++ b/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use PVE::Network::SDN;
+use PVE::Network::SDN::Controllers;
 use PVE::Network::SDN::Fabrics;
 
 use PVE::JSONSchema qw(get_standard_option);
@@ -147,6 +148,15 @@ __PACKAGE__->register_method({
                 my $digest = extract_param($param, 'digest');
                 PVE::Tools::assert_if_modified($config->digest(), $digest) if $digest;
 
+                if (($param->{protocol} // '') eq 'bgp') {
+                    my $controller_cfg = PVE::Network::SDN::Controllers::config();
+                    for my $id (keys %{ $controller_cfg->{ids} // {} }) {
+                        die "cannot add a BGP fabric while BGP controller '$id' exists:"
+                            . " both target the default-VRF BGP router\n"
+                            if $controller_cfg->{ids}->{$id}->{type} eq 'bgp';
+                    }
+                }
+
                 $config->add_fabric($param);
                 PVE::Network::SDN::Fabrics::write_config($config);
             },
diff --git a/src/PVE/Network/SDN/Controllers/BgpPlugin.pm b/src/PVE/Network/SDN/Controllers/BgpPlugin.pm
index 43d97f0..ea2ba5a 100644
--- a/src/PVE/Network/SDN/Controllers/BgpPlugin.pm
+++ b/src/PVE/Network/SDN/Controllers/BgpPlugin.pm
@@ -8,6 +8,7 @@ use PVE::JSONSchema qw(get_standard_option);
 use PVE::Tools qw(run_command file_set_contents file_get_contents);
 
 use PVE::Network::SDN::Controllers::Plugin;
+use PVE::Network::SDN::Fabrics;
 use PVE::Network::SDN::Zones::Plugin;
 use Net::IP;
 
@@ -201,6 +202,14 @@ sub on_update_hook {
         die "only 1 bgp controller can be defined" if $controllernb > 1;
     }
 
+    my $fabric_config = PVE::Network::SDN::Fabrics::config();
+    my $fabrics = $fabric_config->list_fabrics();
+    for my $id (keys %$fabrics) {
+        die "cannot configure a BGP controller while BGP fabric '$id' exists:"
+            . " both target the default-VRF BGP router\n"
+            if $fabrics->{$id}->{protocol} eq 'bgp';
+    }
+
     my $controller = $controller_cfg->{ids}->{$controllerid};
     my $route_map_config = PVE::Network::SDN::RouteMaps::config(0);
 
-- 
2.47.3





  parent reply	other threads:[~2026-05-15 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 10:24 [PATCH docs/manager/network/proxmox{-ve-rs,-perl-rs} v6 0/9] sdn: add BGP fabric Hannes Laimer
2026-05-15 10:24 ` [PATCH proxmox-ve-rs v6 1/9] sdn: fabric: add BGP protocol support Hannes Laimer
2026-05-15 10:24 ` [PATCH proxmox-perl-rs v6 2/9] sdn: fabrics: add BGP config generation Hannes Laimer
2026-05-15 10:24 ` [PATCH proxmox-perl-rs v6 3/9] sdn: fabrics: add BGP status endpoints Hannes Laimer
2026-05-15 10:24 ` [PATCH pve-network v6 4/9] sdn: fabrics: register bgp as a fabric protocol type Hannes Laimer
2026-05-15 10:24 ` Hannes Laimer [this message]
2026-05-15 10:24 ` [PATCH pve-network v6 6/9] sdn: evpn: support eBGP VTEPs over BGP fabric underlays Hannes Laimer
2026-05-15 10:24 ` [PATCH pve-network v6 7/9] test: evpn: add integration test for EVPN over BGP fabric Hannes Laimer
2026-05-15 10:24 ` [PATCH pve-manager v6 8/9] ui: sdn: add BGP fabric support Hannes Laimer
2026-05-15 10:25 ` [PATCH pve-docs v6 9/9] sdn: add bgp fabric section Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515102500.216264-6-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal