From 05aa22dcb4ce54e3fb9909eddaa2aca3a6ac206e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Nov 2021 19:54:09 +0100 Subject: protocols: static: T3680: do not delete DHCP received routes An ISC DHCP hook script is used to install the received default route into FRR by simple calls to vtysh. By moving to frr-reload.py the DHCP default route was deleted as it was not found in the running config. This commit checks all interfaces if DHCP is enabled and if so - will dynamically add the route to the generated FRR configuration. --- data/templates/frr/staticd.frr.tmpl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'data/templates') diff --git a/data/templates/frr/staticd.frr.tmpl b/data/templates/frr/staticd.frr.tmpl index db59a44c2..bfe959c1d 100644 --- a/data/templates/frr/staticd.frr.tmpl +++ b/data/templates/frr/staticd.frr.tmpl @@ -15,6 +15,15 @@ vrf {{ vrf }} {{ static_routes(ip_prefix, prefix, prefix_config) }} {%- endfor -%} {% endif %} +{# IPv4 default routes from DHCP interfaces #} +{% if dhcp is defined and dhcp is not none %} +{% for interface in dhcp %} +{% set next_hop = interface | get_dhcp_router %} +{% if next_hop is defined and next_hop is not none %} +{{ ip_prefix }} route 0.0.0.0/0 {{ next_hop }} {{ interface }} tag 210 210 +{% endif %} +{% endfor %} +{% endif %} {# IPv6 routing #} {% if route6 is defined and route6 is not none %} {% for prefix, prefix_config in route6.items() %} -- cgit v1.2.3