diff options
author | Christian Breunig <christian@breunig.cc> | 2023-03-14 12:50:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 12:50:15 +0100 |
commit | c5ee06af8cb0b4485d08a2cf1d1e338c74b3fd85 (patch) | |
tree | e60c5a9392060a9e9cb92bd365d7f0303233b2a5 | |
parent | c614e8cfd5c204d2568f25ffe7482f4feb2b9187 (diff) | |
parent | add5eaeecacb579a61f5cd5ef892fbf4655110d7 (diff) | |
download | vyos-1x-c5ee06af8cb0b4485d08a2cf1d1e338c74b3fd85.tar.gz vyos-1x-c5ee06af8cb0b4485d08a2cf1d1e338c74b3fd85.zip |
Merge pull request #1888 from sever-sever/T5085
T5085: Fix ipv6 route-map for ospfv3
-rw-r--r-- | data/templates/frr/vrf.route-map.v6.frr.j2 | 10 | ||||
-rwxr-xr-x | src/conf_mode/protocols_ospfv3.py | 12 |
2 files changed, 21 insertions, 1 deletions
diff --git a/data/templates/frr/vrf.route-map.v6.frr.j2 b/data/templates/frr/vrf.route-map.v6.frr.j2 new file mode 100644 index 000000000..7dc59a046 --- /dev/null +++ b/data/templates/frr/vrf.route-map.v6.frr.j2 @@ -0,0 +1,10 @@ +! +{% if vrf is vyos_defined and route_map is vyos_defined %} +vrf {{ vrf }} + ipv6 protocol {{ protocol }} route-map {{ route_map }} + exit-vrf +! +{% elif route_map is vyos_defined %} +ipv6 protocol {{ protocol }} route-map {{ route_map }} +{% endif %} +! diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py index ed0a8fba2..1e2c02d03 100755 --- a/src/conf_mode/protocols_ospfv3.py +++ b/src/conf_mode/protocols_ospfv3.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2021 VyOS maintainers and contributors +# Copyright (C) 2021-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -146,15 +146,25 @@ def generate(ospfv3): if not ospfv3 or 'deleted' in ospfv3: return None + ospfv3['protocol'] = 'ospf6' # required for frr/vrf.route-map.v6.frr.j2 + ospfv3['frr_zebra_config'] = render_to_string('frr/vrf.route-map.v6.frr.j2', ospfv3) ospfv3['new_frr_config'] = render_to_string('frr/ospf6d.frr.j2', ospfv3) return None def apply(ospfv3): ospf6_daemon = 'ospf6d' + zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions frr_cfg = frr.FRRConfig() + # The route-map used for the FIB (zebra) is part of the zebra daemon + frr_cfg.load_configuration(zebra_daemon) + frr_cfg.modify_section('(\s+)?ipv6 protocol ospf6 route-map [-a-zA-Z0-9.]+', stop_pattern='(\s|!)') + if 'frr_zebra_config' in ospfv3: + frr_cfg.add_before(frr.default_add_before, ospfv3['frr_zebra_config']) + frr_cfg.commit_configuration(zebra_daemon) + # Generate empty helper string which can be ammended to FRR commands, it # will be either empty (default VRF) or contain the "vrf <name" statement vrf = '' |