[PATCH proxmox-ve-rs 01/16] frr: add local-as setting

Stefan Hanreich
2026-04-14T16:33:41Z

This can be used for overriding the ASN for a given neighbor group.
This is particularly useful when running BGP as routing protocol both
for the overlay and the underlay, but utilizing different ASNs for
each.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
proxmox-frr/src/ser/bgp.rs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/proxmox-frr/src/ser/bgp.rs b/proxmox-frr/src/ser/bgp.rs
index dcad3b8..79bc920 100644
--- a/proxmox-frr/src/ser/bgp.rs
+++ b/proxmox-frr/src/ser/bgp.rs
@@ -27,11 +27,33 @@ pub enum NeighborRemoteAs {
Asn(#[serde(deserialize_with = "proxmox_serde::perl::deserialize_u32")] u32),
}

+// Each flag requires the previous flag to be set. It is not possible to set replace-as without
+// no-prepend.
+#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
+#[serde(rename_all = "kebab-case")]
+pub enum LocalAsFlags {
+ NoPrepend,
+ #[serde(rename = "no-prepend replace-as")]
+ ReplaceAs,
+ #[serde(rename = "no-prepend replace-as dual-as")]
+ DualAs,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub struct LocalAsSettings {
+ asn: u32,
+ #[serde(default)]
+ mode: Option<LocalAsFlags>,
+}
+
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
pub struct NeighborGroup {
pub name: FrrWord,
#[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")]
pub bfd: bool,
+ #[serde(default)]
+ pub local_as: Option<LocalAsSettings>,
pub remote_as: NeighborRemoteAs,
#[serde(default)]
pub ips: Vec<IpAddr>,
--
2.47.3