Skip to content

Commit

Permalink
sonic-buildimage: Add SONiC support to configure ISIS using FRRs ISIS…
Browse files Browse the repository at this point in the history
… implementation

* Update /src/sonic-yang-models: Add SONiC FRR-ISIS YANG model and ISIS YANG validation tests
* Update /dockers/docker-fpm-frr: FRR-ISIS config template files and isisd enabled by default in the FRR container
* Update /files/image_config/copp: Enable ISIS trap messages
* Update /src/sonic-frr-mgmt-framework: Added support for ISIS tables in frrcfgd and extended frrcfgd unit tests for FRR-ISIS configs

Signed-off-by: cchoate54@gmail.com
  • Loading branch information
cchoate54 committed Apr 1, 2023
1 parent 24bdfc1 commit a9ab226
Show file tree
Hide file tree
Showing 19 changed files with 1,653 additions and 11 deletions.
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then
-t /usr/share/sonic/templates/bgpd/gen_bgpd.conf.j2,/etc/frr/bgpd.conf \
-t /usr/share/sonic/templates/zebra/zebra.conf.j2,/etc/frr/zebra.conf \
-t /usr/share/sonic/templates/staticd/gen_staticd.conf.j2,/etc/frr/staticd.conf \
-t /usr/share/sonic/templates/isisd/gen_isisd.conf.j2,/etc/frr/isisd.conf \
"
MGMT_FRAMEWORK_CONFIG=$(echo $FRR_VARS | jq -r '.frr_mgmt_framework_config')
if [ -n "$MGMT_FRAMEWORK_CONFIG" ] && [ "$MGMT_FRAMEWORK_CONFIG" != "false" ]; then
Expand Down
5 changes: 5 additions & 0 deletions dockers/docker-fpm-frr/frr/isisd/gen_isisd.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
{% include "/usr/local/sonic/frrcfgd/isisd.conf.j2" %}
{% else %}
{% include "/usr/share/sonic/templates/isisd/isisd.conf.j2" %}
{% endif %}
11 changes: 11 additions & 0 deletions dockers/docker-fpm-frr/frr/isisd/isisd.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
!
! template: isisd/isisd.conf.j2
!
!
{% include "common/daemons.common.conf.j2" %}
!
!
{% include "isisd.main.conf.j2" %}
!
! end of template: isisd/isisd.conf.j2
!
168 changes: 168 additions & 0 deletions dockers/docker-fpm-frr/frr/isisd/isisd.main.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
! template: isisd/isid.main.conf.j2
!
! ISIS configuration
!
{% if ISIS_GLOBAL is defined and ISIS_GLOBAL|length > 0 %}
{% for instance, isis_instance in ISIS_GLOBAL.items() %}
{% if instance and instance.lower() != 'null' %}
router isis {{ instance }}
{% if 'net' in isis_instance and isis_instance['net'] != 'None' %}
net {{ isis_instance['net'] }}
{% endif %}
{% if 'level_capability' in isis_instance %}
{% if isis_instance['level_capability'] == 'level-2' %}
is-type level-2-only
{% endif %}
{% if (isis_instance['level_capability'] == 'level-1') or (isis_instance['level_capability'] == 'level-1-2') %}
is-type {{ isis_instance['level_capability'] }}
{% endif %}
{% endif %}
{% if 'dynamic_hostname' in isis_instance %}
{% if isis_instance['dynamic_hostname'] == 'true' %}
hostname dynamic
{% endif %}
{% if isis_instance['dynamic_hostname'] == 'false' %}
no hostname dynamic
{% endif %}
{% endif %}
{% if 'attach_send' in isis_instance %}
{% if isis_instance['attach_send'] == 'true' %}
attached-bit send
{% endif %}
{% if isis_instance['attach_send'] == 'false' %}
no attached-bit send
{% endif %}
{% endif %}
{% if 'attach_receive_ignore' in isis_instance %}
{% if isis_instance['attach_receive_ignore'] == 'true' %}
attached-bit receive ignore
{% endif %}
{% if isis_instance['attach_receive_ignore'] == 'false' %}
no attached-bit receive ignore
{% endif %}
{% endif %}
{% if 'set_overload_bit' in isis_instance %}
{% if isis_instance['set_overload_bit'] == 'true' %}
set-overload-bit
{% endif %}
{% if isis_instance['set_overload_bit'] == 'false' %}
no set-overload-bit
{% endif %}
{% endif %}
{% if 'lsp_mtu_size' in isis_instance %}
lsp-mtu {{ isis_instance['lsp_mtu_size'] }}
{% endif %}
{% if 'spf_init_delay' in isis_instance and 'spf_short_delay' in isis_instance and 'spf_long_delay' in isis_instance and 'spf_hold_down' in isis_instance and 'spf_time_to_learn' in isis_instance %}
spf-delay-ietf init-delay {{ isis_instance['spf_init_delay'] }} short-delay {{ isis_instance['spf_short_delay'] }} long-delay {{ isis_instance['spf_long_delay'] }} holddown {{ isis_instance['spf_hold_down'] }} time-to-learn {{ isis_instance['spf_time_to_learn'] }}
{% endif %}
{% if 'log_adjacency_changes' in isis_instance %}
{% if isis_instance['log_adjacency_changes'] == 'true' %}
log-adjacency-changes
{% endif %}
{% if isis_instance['log_adjacency_changes'] == 'false' %}
no log-adjacency-changes
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
!
{% if ISIS_LEVEL is defined and ISIS_LEVEL|length > 0 %}
{% for keys, isis_level_data in ISIS_LEVEL.items() %}
{% set instance = keys[0] %}
{% set level = keys[1] %}
{% if instance and instance.lower() != 'null' and level and (level.lower() == 'level-1' or level.lower() == 'level-2') %}
router isis {{ instance }}
{% if 'lsp_refresh_interval' in isis_level_data %}
lsp-refresh-interval {{ level }} {{ isis_level_data['lsp_refresh_interval'] }}
{% endif %}
{% if 'lsp_maximum_lifetime' in isis_level_data %}
max-lsp-lifetime {{ level }} {{ isis_level_data['lsp_maximum_lifetime'] }}
{% endif %}
{% if 'lsp_generation_interval' in isis_level_data %}
lsp-gen-interval {{ level }} {{ isis_level_data['lsp_generation_interval'] }}
{% endif %}
{% if 'spf_minimum_interval' in isis_level_data %}
spf-interval {{ level }} {{ isis_level_data['spf_minimum_interval'] }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
!
{% if ISIS_INTERFACE is defined and ISIS_INTERFACE|length > 0 %}
{% for keys, isis_interface_data in ISIS_INTERFACE.items() %}
{% set instance = keys[0] %}
{% set interface = keys[1] %}
{% if instance and instance.lower() != 'null' and interface and interface.lower() != 'null' %}
interface {{ interface }}
{% if (('ipv4_routing_instance' in isis_interface_data and not (isis_interface_data['ipv4_routing_instance'] == 'None' or isis_interface_data['ipv4_routing_instance'].lower() == 'null' )) or
('ipv6_routing_instance' in isis_interface_data and not (isis_interface_data['ipv6_routing_instance'] == 'None' or isis_interface_data['ipv6_routing_instance'].lower() == 'null'))) %}
{% if 'ipv4_routing_instance' in isis_interface_data and not (isis_interface_data['ipv4_routing_instance'] == 'None' or isis_interface_data['ipv4_routing_instance'].lower() == 'null' ) %}
ip router isis {{ isis_interface_data['ipv4_routing_instance'] }}
{% endif %}
{% if 'ipv6_routing_instance' in isis_interface_data and not (isis_interface_data['ipv6_routing_instance'] == 'None' or isis_interface_data['ipv6_routing_instance'].lower() == 'null') %}
ipv6 router isis {{ isis_interface_data['ipv6_routing_instance'] }}
{% endif %}
{% if 'passive' in isis_interface_data %}
{% if isis_interface_data['passive'] == 'true' %}
isis passive
{% endif %}
{% if isis_interface_data['passive'] == 'false' %}
no isis passive
{% endif %}
{% endif %}
{% if 'hello_padding' in isis_interface_data %}
{% if isis_interface_data['hello_padding'] == 'true' %}
isis hello padding
{% endif %}
{% if isis_interface_data['hello_padding'] == 'false' %}
no isis hello padding
{% endif %}
{% endif %}
{% if 'network_type' in isis_interface_data %}
{% if isis_interface_data['network_type'] == 'point-to-point' %}
isis network point-to-point
{% endif %}
{% endif %}
{% if 'authentication_key' in isis_interface_data and 'authentication_type' in isis_interface_data and not
(isis_interface_data['authentication_key'] == 'None' or isis_interface_data['authentication_key'].lower() == 'null') %}
{% if isis_interface_data['authentication_type'] == 'clear' %}
isis password clear {{ isis_interface_data['authentication_key'] }}
{% endif %}
{% if isis_interface_data['authentication_type'] == 'md5' %}
isis password md5 {{ isis_interface_data['authentication_key'] }}
{% endif %}
{% endif %}
{% if 'enable_bfd' in isis_interface_data %}
{% if isis_interface_data['enable_bfd'] == 'true' %}
isis bfd
{% endif %}
{% if isis_interface_data['enable_bfd'] == 'false' %}
no isis bfd
{% endif %}
{% endif %}
{% if 'bfd_profile' in isis_interface_data and not (isis_interface_data['bfd_profile'] == 'None' or isis_interface_data['bfd_profile'].lower() == 'null') %}
isis bfd profile {{ isis_interface_data['bfd_profile'] }}
{% endif %}
{% if 'metric' in isis_interface_data %}
isis metric {{ isis_interface_data['metric'] }}
{% endif %}
{% if 'csnp_interval' in isis_interface_data %}
isis csnp-interval {{ isis_interface_data['csnp_interval'] }}
{% endif %}
{% if 'psnp_interval' in isis_interface_data %}
isis psnp-interval {{ isis_interface_data['psnp_interval'] }}
{% endif %}
{% if 'hello_interval' in isis_interface_data %}
isis hello-interval {{ isis_interface_data['hello_interval'] }}
{% endif %}
{% if 'hello_multiplier' in isis_interface_data %}
isis hello-multiplier {{ isis_interface_data['hello_multiplier'] }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
!
! end of template: isisd/isisd.main.conf.j2
!
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ program:zebra
program:staticd
program:bgpd
program:fpmsyncd
program:isisd
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
program:bfdd
program:ospfd
Expand Down
12 changes: 12 additions & 0 deletions dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=zsocket:exited

[program:isisd]
command=/usr/lib/frr/isisd -A 127.0.0.1 -M snmp
priority=5
stopsignal=KILL
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=zsocket:exited

{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
[program:ospfd]
command=/usr/lib/frr/ospfd -A 127.0.0.1 -M snmp
Expand Down
2 changes: 1 addition & 1 deletion files/image_config/copp/copp_cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"COPP_TRAP": {
"bgp": {
"trap_ids": "bgp,bgpv6",
"trap_ids": "bgp,bgpv6,isis",
"trap_group": "queue4_group1"
},
"lacp": {
Expand Down
Loading

0 comments on commit a9ab226

Please sign in to comment.