From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 0CA7A1FF141 for ; Fri, 27 Feb 2026 12:55:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 13379F73E; Fri, 27 Feb 2026 12:56:06 +0100 (CET) Message-ID: <6c18cedd-3c78-4219-bf9c-ca9870021518@proxmox.com> Date: Fri, 27 Feb 2026 12:56:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-ve-rs 8/9] frr: add bgp support with templates and serialization To: Gabriel Goller , pve-devel@lists.proxmox.com References: <20260203160246.353351-1-g.goller@proxmox.com> <20260203160246.353351-9-g.goller@proxmox.com> Content-Language: en-US From: Stefan Hanreich In-Reply-To: <20260203160246.353351-9-g.goller@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.342 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 1.158 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.306 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.668 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 4V7GIDHJCMVZS6HZZHZNQISJGNERHAWO X-Message-ID-Hash: 4V7GIDHJCMVZS6HZZHZNQISJGNERHAWO X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2/3/26 5:01 PM, Gabriel Goller wrote: > Implements bgp routing configuration (rust types and templates) > including routers, neighbor groups, address families (IPv4/IPv6 unicast, > L2VPN EVPN), VRFs, route redistribution, and prefix lists. > > Co-authored-by: Stefan Hanreich > Signed-off-by: Gabriel Goller > --- > .../templates/bgp_router.jinja | 118 +++++++++++ > proxmox-frr-templates/templates/bgpd.jinja | 35 ++++ > .../templates/frr.conf.jinja | 3 + > .../templates/ip_routes.jinja | 8 + > .../templates/prefix_lists.jinja | 6 + > proxmox-frr/src/ser/bgp.rs | 184 ++++++++++++++++++ > proxmox-frr/src/ser/mod.rs | 34 +++- > proxmox-frr/src/ser/serializer.rs | 12 ++ > 8 files changed, 399 insertions(+), 1 deletion(-) > create mode 100644 proxmox-frr-templates/templates/bgp_router.jinja > create mode 100644 proxmox-frr-templates/templates/bgpd.jinja > create mode 100644 proxmox-frr-templates/templates/ip_routes.jinja > create mode 100644 proxmox-frr-templates/templates/prefix_lists.jinja > create mode 100644 proxmox-frr/src/ser/bgp.rs > > diff --git a/proxmox-frr-templates/templates/bgp_router.jinja b/proxmox-frr-templates/templates/bgp_router.jinja > new file mode 100644 > index 000000000000..6f48d6ca17a4 > --- /dev/null > +++ b/proxmox-frr-templates/templates/bgp_router.jinja > @@ -0,0 +1,118 @@ > +{% macro address_family_common(common_address_family) -%} > +{% for vrf in common_address_family.import_vrf %} > + import vrf {{ vrf }} > +{% endfor %} > +{% for neighbor in common_address_family.neighbors %} > + neighbor {{ neighbor.name }} activate > + {% if neighbor.soft_reconfiguration_inbound %} > + neighbor {{ neighbor.name }} soft-reconfiguration inbound > + {% endif %} > + {% if neighbor.route_map_in %} > + neighbor {{ neighbor.name }} route-map {{ neighbor.route_map_in }} in > + {% endif %} > + {% if neighbor.route_map_out %} > + neighbor {{ neighbor.name }} route-map {{ neighbor.route_map_out }} out > + {% endif %} > +{% endfor -%} > +{% for line in common_address_family.custom_frr_config %} > +{{ line }} > +{% endfor -%} > +{% endmacro -%} > +{% macro bgp_router(router_config) %} > + bgp router-id {{ router_config.router_id }} > + no bgp hard-administrative-reset this option should be exposed and not hardcoded > +{% if router_config.default_ipv4_unicast == false %} > + no bgp default ipv4-unicast > +{% endif %} > +{% if router_config.coalesce_time %} > + coalesce-time {{ router_config.coalesce_time }} > +{% endif %} > + no bgp graceful-restart notification here as well