diff options
| author | Kyrylo Yatsenko <hedrok@gmail.com> | 2025-11-17 10:07:05 +0200 |
|---|---|---|
| committer | Kyrylo Yatsenko <hedrok@gmail.com> | 2026-01-09 11:01:34 +0200 |
| commit | a4b3cd33ca11aba579510456941f404839135af4 (patch) | |
| tree | 282ee8efa47199e2d1c9b5f3441ff79e78cb0514 /python | |
| parent | dffe642fee356b9063a269eb2d244f14d4cc2036 (diff) | |
| download | vyos-1x-a4b3cd33ca11aba579510456941f404839135af4.tar.gz vyos-1x-a4b3cd33ca11aba579510456941f404839135af4.zip | |
T8046: traffic-engineering: support link-params
Add 'traffic-engineering' commands under 'protocols'.
set protocols traffic-engineering admin-group ADMINGROUP bit-position 1
set protocols traffic-engineering interface INTERFACE admin-group ADMINGROUP
set protocols traffic-engineering interface INTERFACE max-bandwidth 1280
set protocols traffic-engineering interface INTERFACE max-reservable-bandwidth 1280
Also add
set protocols isis traffic-engineering export
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/frrender.py | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index f79e6c0f0..1aed31f96 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -51,9 +51,26 @@ ERROR_RELOAD_TEST: str = 'The system encountered an error while rendering the ' 'new routing daemon configuration. To ensure network stability and avoid ' \ 'potential connectivity disruptions, the configuration was not applied!' -frr_protocols = ['babel', 'bfd', 'bgp', 'eigrp', 'isis', 'mpls', 'nhrp', - 'openfabric', 'ospf', 'ospfv3', 'pim', 'pim6', 'rip', - 'ripng', 'rpki', 'segment_routing', 'static'] +frr_protocols = [ + 'babel', + 'bfd', + 'bgp', + 'eigrp', + 'isis', + 'mpls', + 'nhrp', + 'openfabric', + 'ospf', + 'ospfv3', + 'pim', + 'pim6', + 'rip', + 'ripng', + 'rpki', + 'segment_routing', + 'static', + 'traffic_engineering', +] babel_daemon = 'babeld' bfd_daemon = 'bfdd' @@ -426,6 +443,21 @@ def get_frrender_dict(conf: Config, argv=None) -> dict: elif conf.exists_effective(sr_cli_path): dict.update({'segment_routing' : deleted_protocol}) + # We need to check the CLI if the Traffic Engineering node is present and thus load in + # all the default values present on the CLI - that's why we have if conf.exists() + te_cli_path = ['protocols', 'traffic-engineering'] + if conf.exists(te_cli_path): + te = conf.get_config_dict( + te_cli_path, + key_mangling=('-', '_'), + get_first_key=True, + no_tag_node_value_mangle=True, + with_recursive_defaults=True, + ) + dict.update({'traffic_engineering': te}) + elif conf.exists_effective(te_cli_path): + dict.update({'traffic_engineering': deleted_protocol}) + # We need to check the CLI if the static node is present and thus load in # all the default values present on the CLI - that's why we have if conf.exists() static_cli_path = ['protocols', 'static'] @@ -722,6 +754,15 @@ class FRRender: if 'segment_routing' in config_dict and 'deleted' not in config_dict['segment_routing']: output += render_to_string('frr/zebra.segment_routing.frr.j2', config_dict['segment_routing']) output += '\n' + if ( + 'traffic_engineering' in config_dict + and 'deleted' not in config_dict['traffic_engineering'] + ): + output += render_to_string( + 'frr/zebra.traffic_engineering.frr.j2', + config_dict['traffic_engineering'], + ) + output += '\n' if 'static' in config_dict and 'deleted' not in config_dict['static']: output += render_to_string('frr/staticd.frr.j2', config_dict['static']) output += '\n' |
