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 <[email protected]>
> Signed-off-by: Gabriel Goller <[email protected]>
> ---
> .../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