Skip to content

Commit

Permalink
Merge pull request #4227 from c-po/T6746-frr-10
Browse files Browse the repository at this point in the history
frr: upgrade to 10.2 and migrate protocols to unified FRRender class
  • Loading branch information
c-po authored Dec 16, 2024
2 parents 86b5288 + 90e9aa9 commit 1da518c
Show file tree
Hide file tree
Showing 88 changed files with 2,202 additions and 2,579 deletions.
2 changes: 0 additions & 2 deletions data/templates/frr/babeld.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ exit
{% endfor %}
{% endif %}
!
{# Babel configuration #}
router babel
{% if parameters.diversity is vyos_defined %}
babel diversity
Expand Down Expand Up @@ -82,4 +81,3 @@ router babel
{% endif %}
exit
!
end
24 changes: 17 additions & 7 deletions data/templates/frr/bgpd.frr.j2
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{### MACRO definition for recurring peer patter, this can be either fed by a ###}
{### peer-group or an individual BGP neighbor ###}
{% macro bgp_neighbor(neighbor, config, peer_group=false) %}
{# BGP order of peer-group and remote-as placement must be honored #}
{% if peer_group == true %}
neighbor {{ neighbor }} peer-group
{% elif config.peer_group is vyos_defined %}
neighbor {{ neighbor }} peer-group {{ config.peer_group }}
{% endif %}
{% if config.remote_as is vyos_defined %}
{% if config.remote_as is vyos_defined %}
neighbor {{ neighbor }} remote-as {{ config.remote_as }}
{% endif %}
{% else %}
{% if config.remote_as is vyos_defined %}
neighbor {{ neighbor }} remote-as {{ config.remote_as }}
{% endif %}
{% if config.peer_group is vyos_defined %}
neighbor {{ neighbor }} peer-group {{ config.peer_group }}
{% endif %}
{% endif %}
{% if config.local_role is vyos_defined %}
{% for role, strict in config.local_role.items() %}
Expand Down Expand Up @@ -245,9 +251,11 @@
neighbor {{ neighbor }} activate
exit-address-family
!
{# j2lint: disable=jinja-statements-delimeter #}
{% endfor %}
{% endif %}
{% endmacro %}
{# j2lint: disable=jinja-statements-delimeter #}
{%- endmacro -%}
!
router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% if parameters.ebgp_requires_policy is vyos_defined %}
Expand Down Expand Up @@ -512,13 +520,15 @@ router bgp {{ system_as }} {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% if peer_group is vyos_defined %}
{% for peer, config in peer_group.items() %}
{{ bgp_neighbor(peer, config, true) }}
{% endfor %}
{# j2lint: disable=jinja-statements-delimeter #}
{%- endfor %}
{% endif %}
!
{% if neighbor is vyos_defined %}
{% for peer, config in neighbor.items() %}
{{ bgp_neighbor(peer, config) }}
{% endfor %}
{# j2lint: disable=jinja-statements-delimeter #}
{%- endfor %}
{% endif %}
!
{% if listen.limit is vyos_defined %}
Expand Down
3 changes: 2 additions & 1 deletion data/templates/frr/distribute_list_macro.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
{% if distribute_list.prefix_list.out is vyos_defined %}
distribute-list prefix {{ distribute_list.prefix_list.out }} out
{% endif %}
{% endmacro %}
{# j2lint: disable=jinja-statements-delimeter #}
{%- endmacro -%}
28 changes: 16 additions & 12 deletions data/templates/frr/evpn.mh.frr.j2
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
!
interface {{ ifname }}
{% if evpn.es_df_pref is vyos_defined %}
evpn mh es-df-pref {{ evpn.es_df_pref }}
{% endif %}
{% if evpn.es_id is vyos_defined %}
evpn mh es-id {{ evpn.es_id }}
{% endif %}
{% if evpn.es_sys_mac is vyos_defined %}
evpn mh es-sys-mac {{ evpn.es_sys_mac }}
{% endif %}
{% if evpn.uplink is vyos_defined %}
{% if interfaces is vyos_defined %}
{% for if_name, if_config in interfaces.items() %}
interface {{ if_name }}
{% if if_config.evpn.es_df_pref is vyos_defined %}
evpn mh es-df-pref {{ if_config.evpn.es_df_pref }}
{% endif %}
{% if if_config.evpn.es_id is vyos_defined %}
evpn mh es-id {{ if_config.evpn.es_id }}
{% endif %}
{% if if_config.evpn.es_sys_mac is vyos_defined %}
evpn mh es-sys-mac {{ if_config.evpn.es_sys_mac }}
{% endif %}
{% if if_config.evpn.uplink is vyos_defined %}
evpn mh uplink
{% endif %}
{% endif %}
exit
!
{% endfor %}
{% endif %}
1 change: 1 addition & 0 deletions data/templates/frr/fabricd.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ router openfabric {{ name }}
exit
!
{% endfor %}
!
3 changes: 2 additions & 1 deletion data/templates/frr/ipv6_distribute_list_macro.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
{% if distribute_list.prefix_list.out is vyos_defined %}
ipv6 distribute-list prefix {{ distribute_list.prefix_list.out }} out
{% endif %}
{% endmacro %}
{# j2lint: disable=jinja-statements-delimeter #}
{%- endmacro -%}
7 changes: 5 additions & 2 deletions data/templates/frr/ospfd.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ interface {{ iface }}
{% if iface_config.retransmit_interval is vyos_defined %}
ip ospf retransmit-interval {{ iface_config.retransmit_interval }}
{% endif %}
{% if iface_config.retransmit_window is vyos_defined %}
ip ospf retransmit-window {{ iface_config.retransmit_window }}
{% endif %}
{% if iface_config.transmit_delay is vyos_defined %}
ip ospf transmit-delay {{ iface_config.transmit_delay }}
{% endif %}
Expand Down Expand Up @@ -125,7 +128,7 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% endfor %}
{% endif %}
{# The following values are default values #}
area {{ area_id }} virtual-link {{ link }} hello-interval {{ link_config.hello_interval }} retransmit-interval {{ link_config.retransmit_interval }} transmit-delay {{ link_config.transmit_delay }} dead-interval {{ link_config.dead_interval }}
area {{ area_id }} virtual-link {{ link }} hello-interval {{ link_config.hello_interval }} retransmit-interval {{ link_config.retransmit_interval }} retransmit-window {{ link_config.retransmit_window }} transmit-delay {{ link_config.transmit_delay }} dead-interval {{ link_config.dead_interval }}
{% endfor %}
{% endif %}
{% endfor %}
Expand Down Expand Up @@ -233,6 +236,7 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% endfor %}
{% endif %}
{% if segment_routing is vyos_defined %}
segment-routing on
{% if segment_routing.maximum_label_depth is vyos_defined %}
segment-routing node-msd {{ segment_routing.maximum_label_depth }}
{% endif %}
Expand All @@ -252,7 +256,6 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }}
{% endif %}
{% endfor %}
{% endif %}
segment-routing on
{% endif %}
{% if timers.throttle.spf.delay is vyos_defined and timers.throttle.spf.initial_holdtime is vyos_defined and timers.throttle.spf.max_holdtime is vyos_defined %}
{# Timer values have default values #}
Expand Down
21 changes: 12 additions & 9 deletions data/templates/frr/pim6d.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ interface {{ iface }}
{% for group, group_config in iface_config.mld.join.items() %}
{% if group_config.source is vyos_defined %}
{% for source in group_config.source %}
ipv6 mld join {{ group }} {{ source }}
ipv6 mld join-group {{ group }} {{ source }}
{% endfor %}
{% else %}
ipv6 mld join {{ group }}
ipv6 mld join-group {{ group }}
{% endif %}
{% endfor %}
{% endif %}
Expand All @@ -52,30 +52,33 @@ exit
{% endfor %}
{% endif %}
!
router pim6
{% if join_prune_interval is vyos_defined %}
ipv6 pim join-prune-interval {{ join_prune_interval }}
join-prune-interval {{ join_prune_interval }}
{% endif %}
{% if keep_alive_timer is vyos_defined %}
ipv6 pim keep-alive-timer {{ keep_alive_timer }}
keep-alive-timer {{ keep_alive_timer }}
{% endif %}
{% if packets is vyos_defined %}
ipv6 pim packets {{ packets }}
packets {{ packets }}
{% endif %}
{% if register_suppress_time is vyos_defined %}
ipv6 pim register-suppress-time {{ register_suppress_time }}
register-suppress-time {{ register_suppress_time }}
{% endif %}
{% if rp.address is vyos_defined %}
{% for address, address_config in rp.address.items() %}
{% if address_config.group is vyos_defined %}
{% for group in address_config.group %}
ipv6 pim rp {{ address }} {{ group }}
rp {{ address }} {{ group }}
{% endfor %}
{% endif %}
{% if address_config.prefix_list6 is vyos_defined %}
ipv6 pim rp {{ address }} prefix-list {{ address_config.prefix_list6 }}
rp {{ address }} prefix-list {{ address_config.prefix_list6 }}
{% endif %}
{% endfor %}
{% endif %}
{% if rp.keep_alive_timer is vyos_defined %}
ipv6 pim rp keep-alive-timer {{ rp.keep_alive_timer }}
rp keep-alive-timer {{ rp.keep_alive_timer }}
{% endif %}
exit
!
36 changes: 19 additions & 17 deletions data/templates/frr/pimd.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ interface {{ iface }}
{% for join, join_config in iface_config.igmp.join.items() %}
{% if join_config.source_address is vyos_defined %}
{% for source_address in join_config.source_address %}
ip igmp join {{ join }} {{ source_address }}
ip igmp join-group {{ join }} {{ source_address }}
{% endfor %}
{% else %}
ip igmp join {{ join }}
ip igmp join-group {{ join }}
{% endif %}
{% endfor %}
{% endif %}
Expand All @@ -51,45 +51,47 @@ exit
{% endfor %}
{% endif %}
!
{% if igmp.watermark_warning is vyos_defined %}
ip igmp watermark-warn {{ igmp.watermark_warning }}
{% endif %}
!
router pim
{% if ecmp is vyos_defined %}
ip pim ecmp {{ 'rebalance' if ecmp.rebalance is vyos_defined }}
ecmp {{ 'rebalance' if ecmp.rebalance is vyos_defined }}
{% endif %}
{% if join_prune_interval is vyos_defined %}
ip pim join-prune-interval {{ join_prune_interval }}
join-prune-interval {{ join_prune_interval }}
{% endif %}
{% if keep_alive_timer is vyos_defined %}
ip pim keep-alive-timer {{ keep_alive_timer }}
keep-alive-timer {{ keep_alive_timer }}
{% endif %}
{% if packets is vyos_defined %}
ip pim packets {{ packets }}
packets {{ packets }}
{% endif %}
{% if register_accept_list.prefix_list is vyos_defined %}
ip pim register-accept-list {{ register_accept_list.prefix_list }}
register-accept-list {{ register_accept_list.prefix_list }}
{% endif %}
{% if register_suppress_time is vyos_defined %}
ip pim register-suppress-time {{ register_suppress_time }}
register-suppress-time {{ register_suppress_time }}
{% endif %}
{% if rp.address is vyos_defined %}
{% for address, address_config in rp.address.items() %}
{% for group in address_config.group %}
ip pim rp {{ address }} {{ group }}
rp {{ address }} {{ group }}
{% endfor %}
{% endfor %}
{% endif %}
{% if rp.keep_alive_timer is vyos_defined %}
ip pim rp keep-alive-timer {{ rp.keep_alive_timer }}
rp keep-alive-timer {{ rp.keep_alive_timer }}
{% endif %}
{% if no_v6_secondary is vyos_defined %}
no ip pim send-v6-secondary
no send-v6-secondary
{% endif %}
{% if spt_switchover.infinity_and_beyond is vyos_defined %}
ip pim spt-switchover infinity-and-beyond {{ 'prefix-list ' ~ spt_switchover.infinity_and_beyond.prefix_list if spt_switchover.infinity_and_beyond.prefix_list is defined }}
spt-switchover infinity-and-beyond {{ 'prefix-list ' ~ spt_switchover.infinity_and_beyond.prefix_list if spt_switchover.infinity_and_beyond.prefix_list is defined }}
{% endif %}
{% if ssm.prefix_list is vyos_defined %}
ip pim ssm prefix-list {{ ssm.prefix_list }}
{% endif %}
!
{% if igmp.watermark_warning is vyos_defined %}
ip igmp watermark-warn {{ igmp.watermark_warning }}
ssm prefix-list {{ ssm.prefix_list }}
{% endif %}
exit
!
4 changes: 2 additions & 2 deletions data/templates/frr/rpki.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ rpki
{% for peer, peer_config in cache.items() %}
{# port is mandatory and preference uses a default value #}
{% if peer_config.ssh.username is vyos_defined %}
rpki cache {{ peer | replace('_', '-') }} {{ peer_config.port }} {{ peer_config.ssh.username }} {{ peer_config.ssh.private_key_file }} {{ peer_config.ssh.public_key_file }} preference {{ peer_config.preference }}
rpki cache ssh {{ peer | replace('_', '-') }} {{ peer_config.port }} {{ peer_config.ssh.username }} {{ peer_config.ssh.private_key_file }} {{ peer_config.ssh.public_key_file }} preference {{ peer_config.preference }}
{% else %}
rpki cache {{ peer | replace('_', '-') }} {{ peer_config.port }} preference {{ peer_config.preference }}
rpki cache tcp {{ peer | replace('_', '-') }} {{ peer_config.port }} preference {{ peer_config.preference }}
{% endif %}
{% endfor %}
{% endif %}
Expand Down
11 changes: 0 additions & 11 deletions data/templates/frr/static_mcast.frr.j2

This file was deleted.

31 changes: 0 additions & 31 deletions data/templates/frr/static_routes_macro.j2

This file was deleted.

Loading

0 comments on commit 1da518c

Please sign in to comment.