diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-12-16 11:43:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-16 11:43:25 +0000 |
commit | 4e5c65dd40fb34e501b9345f98a4541d12e70b16 (patch) | |
tree | 94c1d466c029584461146d92db71331c9314064b | |
parent | d08a51ab1011f926f897e288d6d8946a8ff72674 (diff) | |
parent | b490dd420138bae3701a945787335beb3974a8bf (diff) | |
download | vyos-1x-4e5c65dd40fb34e501b9345f98a4541d12e70b16.tar.gz vyos-1x-4e5c65dd40fb34e501b9345f98a4541d12e70b16.zip |
Merge pull request #4211 from natali-rs1985/T4214
static: T4214: Allow several dhcp-interfaces to the same static rote
-rw-r--r-- | data/templates/frr/static_routes_macro.j2 | 10 | ||||
-rw-r--r-- | interface-definitions/include/static/static-route.xml.i | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/data/templates/frr/static_routes_macro.j2 b/data/templates/frr/static_routes_macro.j2 index cf8046968..db31700c5 100644 --- a/data/templates/frr/static_routes_macro.j2 +++ b/data/templates/frr/static_routes_macro.j2 @@ -6,10 +6,12 @@ {{ ip_ipv6 }} route {{ prefix }} reject {{ prefix_config.reject.distance if prefix_config.reject.distance is vyos_defined }} {{ 'tag ' ~ prefix_config.reject.tag if prefix_config.reject.tag is vyos_defined }} {{ 'table ' ~ table if table is vyos_defined }} {% endif %} {% if prefix_config.dhcp_interface is vyos_defined %} -{% set next_hop = prefix_config.dhcp_interface | get_dhcp_router %} -{% if next_hop is vyos_defined %} -{{ ip_ipv6 }} route {{ prefix }} {{ next_hop }} {{ prefix_config.dhcp_interface }} {{ 'table ' ~ table if table is vyos_defined }} -{% endif %} +{% for dhcp_interface in prefix_config.dhcp_interface %} +{% set next_hop = dhcp_interface | get_dhcp_router %} +{% if next_hop is vyos_defined %} +{{ ip_ipv6 }} route {{ prefix }} {{ next_hop }} {{ dhcp_interface }} {{ 'table ' ~ table if table is vyos_defined }} +{% endif %} +{% endfor %} {% endif %} {% if prefix_config.interface is vyos_defined %} {% for interface, interface_config in prefix_config.interface.items() if interface_config.disable is not defined %} diff --git a/interface-definitions/include/static/static-route.xml.i b/interface-definitions/include/static/static-route.xml.i index 29921a731..51e45c6f7 100644 --- a/interface-definitions/include/static/static-route.xml.i +++ b/interface-definitions/include/static/static-route.xml.i @@ -13,7 +13,7 @@ <children> #include <include/static/static-route-blackhole.xml.i> #include <include/static/static-route-reject.xml.i> - #include <include/dhcp-interface.xml.i> + #include <include/dhcp-interface-multi.xml.i> #include <include/generic-description.xml.i> <tagNode name="interface"> <properties> |