[PATCH proxmox-perl-rs v2 2/7] sdn: fabrics: add BGP config generation

Hannes Laimer
2026-04-15T11:12:46Z

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

diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs
index 18848c4..15dfee8 100644
--- a/pve-rs/src/bindings/sdn/fabrics.rs
+++ b/pve-rs/src/bindings/sdn/fabrics.rs
@@ -31,6 +31,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 crate::sdn::status::{self, RunningConfig};
@@ -361,6 +362,15 @@ pub mod pve_rs_sdn_fabrics {
}
}
}
+ 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);
+ }
+ }
+ }
+ }
}
}

@@ -453,6 +463,8 @@ pub mod pve_rs_sdn_fabrics {
FabricEntry::Openfabric(_) => {
daemons.insert("fabricd");
}
+ // bgpd is enabled by default in /etc/frr/daemons
+ FabricEntry::Bgp(_) => {}
};
}

@@ -567,6 +579,17 @@ 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")?;
+ }
+ }
+ }
}
}

--
2.47.3