On 12.03.2026 09:30, Hannes Laimer wrote:
> On 2026-03-10 13:08, 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]>
> > ---
>
> [..]
>
> > diff --git a/proxmox-frr-templates/templates/bgpd.jinja
> > b/proxmox-frr-templates/templates/bgpd.jinja
> > new file mode 100644
> > index 000000000000..cdd0a50abf8c
> > --- /dev/null
> > +++ b/proxmox-frr-templates/templates/bgpd.jinja
> > @@ -0,0 +1,35 @@
> > +{% from "bgp_router.jinja" import bgp_router %}
> > +{% for vrf_name, vrf in bgp.vrfs|items %}
> > +!
> > +vrf {{ vrf_name }}
> > +{% if vrf.vni %}
> ^
> > + vni {{ vrf.vni }}
>
> I don't we do that currently, but it is possible to have routes in a VRF
> but no VNI, shouldn't be a problem for us, just wanted to note it
Yep, also just noticed this when pulling out the templates for the VRF stuff!
Thanks for the review!
> > +{% for ip_route in vrf.ip_routes %}
> > +{% if ip_route.vrf %}
> > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route {{ ip_route.prefix }} {{
> > ip_route.via }} {{ ip_route.vrf }}
> > +{% else %}
> > + {{ "ipv6" if ip_route.is_ipv6 else "ip" }} route {{ ip_route.prefix }} {{
> > ip_route.via }}
> > +{% endif %}
> > +{% endfor %}
> > +{% endif %}
> ^
> > +{% for line in vrf.custom_frr_config %}
> > +{{ line }}
> > +{% endfor %}
> > +exit-vrf
> > +{% endfor %}
> > +{% for vrf_name, router_config in bgp.vrf_router|items %}
> > +!
> > +{% if vrf_name == "default" %}
> > +router bgp {{ router_config.asn }}
> > +{% else %}
> > +router bgp {{ router_config.asn }} vrf {{ vrf_name }}
> > +{% endif %}
> > +{{ bgp_router(router_config) -}}
> > +exit
> > +{% endfor %}
> > +{% for view_id, router_config in bgp.view_router|items %}
> > +!
> > +router bgp {{ router_config.asn }} view {{ view_id }}
> > +{{ bgp_router(router_config) -}}
> > +exit
> > +{% endfor %}
>
> [..]