diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-07 19:54:09 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-07 19:54:09 +0100 |
commit | 05aa22dcb4ce54e3fb9909eddaa2aca3a6ac206e (patch) | |
tree | b28fa44b19011f23ba54febd26ed78241ac9e7f7 /data/templates/frr | |
parent | 56a966f94b5c5bbe7f57b80316f3ba389534ad5f (diff) | |
download | vyos-1x-05aa22dcb4ce54e3fb9909eddaa2aca3a6ac206e.tar.gz vyos-1x-05aa22dcb4ce54e3fb9909eddaa2aca3a6ac206e.zip |
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.
Diffstat (limited to 'data/templates/frr')
-rw-r--r-- | data/templates/frr/staticd.frr.tmpl | 9 |
1 files changed, 9 insertions, 0 deletions
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() %} |