public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-perl-rs v5 2/8] sdn: fabrics: add BGP config generation
Date: Wed, 13 May 2026 20:42:07 +0200	[thread overview]
Message-ID: <20260513184213.506775-3-h.laimer@proxmox.com> (raw)
In-Reply-To: <20260513184213.506775-1-h.laimer@proxmox.com>

From: Stefan Hanreich <s.hanreich@proxmox.com>

Add BGP support to the fabric config generation pipeline. This
includes interface name mapping and network interface output for
BGP unnumbered links.

Co-authored-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 pve-rs/src/bindings/sdn/fabrics.rs | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs
index 4012bb8..074ff7e 100644
--- a/pve-rs/src/bindings/sdn/fabrics.rs
+++ b/pve-rs/src/bindings/sdn/fabrics.rs
@@ -32,6 +32,7 @@ pub mod pve_rs_sdn_fabrics {
     };
     use proxmox_ve_config::sdn::fabric::section_config::interface::InterfaceName;
     use proxmox_ve_config::sdn::fabric::section_config::node::{Node as ConfigNode, NodeId};
+    use proxmox_ve_config::sdn::fabric::section_config::protocol::bgp::BgpNode;
     use proxmox_ve_config::sdn::fabric::{FabricConfig, FabricEntry};
     use proxmox_ve_config::sdn::wireguard::WireGuardConfigBuilder;
 
@@ -407,6 +408,15 @@ pub mod pve_rs_sdn_fabrics {
                     }
                 }
                 ConfigNode::WireGuard(_) => {}
+                ConfigNode::Bgp(node_section) => {
+                    if let BgpNode::Internal(properties) = node_section.properties_mut() {
+                        for interface in properties.interfaces_mut() {
+                            if let Some(mapped_name) = map_name(&mapping, interface.name())? {
+                                interface.set_name(mapped_name);
+                            }
+                        }
+                    }
+                }
             }
         }
 
@@ -500,6 +510,8 @@ pub mod pve_rs_sdn_fabrics {
                     daemons.insert("fabricd");
                 }
                 FabricEntry::WireGuard(_) => {} // not a frr fabric
+                // bgpd is enabled by default in /etc/frr/daemons
+                FabricEntry::Bgp(_) => {}
             };
         }
 
@@ -742,6 +754,22 @@ pub mod pve_rs_sdn_fabrics {
                         }
                     }
                 }
+                ConfigNode::Bgp(node_section) => {
+                    if let BgpNode::Internal(properties) = node_section.properties() {
+                        for interface in properties.interfaces() {
+                            let name = interface.name();
+                            writeln!(interfaces)?;
+                            writeln!(interfaces, "auto {name}")?;
+                            writeln!(interfaces, "iface {name} inet manual")?;
+                            writeln!(interfaces, "\tip-forward 1")?;
+                            writeln!(interfaces, "\tip6-forward 1")?;
+                            // BGP unnumbered uses RAs to discover peer link-local
+                            // addresses. frr listens for them itself, but the kernel
+                            // would otherwise install RA-derived routes we don't want.
+                            writeln!(interfaces, "\taccept-ra 0")?;
+                        }
+                    }
+                }
             }
         }
 
-- 
2.47.3





  parent reply	other threads:[~2026-05-13 18:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 18:42 [PATCH docs/manager/network/proxmox{-ve-rs,-perl-rs} v5 0/8] sdn: add BGP fabric Hannes Laimer
2026-05-13 18:42 ` [PATCH proxmox-ve-rs v5 1/8] sdn: fabric: add BGP protocol support Hannes Laimer
2026-05-13 18:42 ` Hannes Laimer [this message]
2026-05-13 18:42 ` [PATCH proxmox-perl-rs v5 3/8] sdn: fabrics: add BGP status endpoints Hannes Laimer
2026-05-13 18:42 ` [PATCH pve-network v5 4/8] sdn: fabrics: register bgp as a fabric protocol type Hannes Laimer
2026-05-13 18:42 ` [PATCH pve-network v5 5/8] sdn: evpn: support eBGP VTEPs over BGP fabric underlays Hannes Laimer
2026-05-13 18:42 ` [PATCH pve-network v5 6/8] test: evpn: add integration test for EVPN over BGP fabric Hannes Laimer
2026-05-13 18:42 ` [PATCH pve-manager v5 7/8] ui: sdn: add BGP fabric support Hannes Laimer
2026-05-13 18:42 ` [PATCH pve-docs v5 8/8] sdn: add bgp fabric section Hannes Laimer
2026-05-15 10:26 ` superseded: [PATCH docs/manager/network/proxmox{-ve-rs,-perl-rs} v5 0/8] sdn: add BGP fabric 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=20260513184213.506775-3-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal