summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_static.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-07 19:54:09 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-07 19:54:09 +0100
commit05aa22dcb4ce54e3fb9909eddaa2aca3a6ac206e (patch)
treeb28fa44b19011f23ba54febd26ed78241ac9e7f7 /src/conf_mode/protocols_static.py
parent56a966f94b5c5bbe7f57b80316f3ba389534ad5f (diff)
downloadvyos-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 'src/conf_mode/protocols_static.py')
-rwxr-xr-xsrc/conf_mode/protocols_static.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_static.py b/src/conf_mode/protocols_static.py
index 597fcc443..f010141e9 100755
--- a/src/conf_mode/protocols_static.py
+++ b/src/conf_mode/protocols_static.py
@@ -21,6 +21,7 @@ from sys import argv
from vyos.config import Config
from vyos.configdict import dict_merge
+from vyos.configdict import get_dhcp_interfaces
from vyos.configverify import verify_common_route_maps
from vyos.configverify import verify_vrf
from vyos.template import render_to_string
@@ -56,6 +57,10 @@ def get_config(config=None):
# Merge policy dict into "regular" config dict
static = dict_merge(tmp, static)
+ # T3680 - get a list of all interfaces currently configured to use DHCP
+ tmp = get_dhcp_interfaces(conf, vrf)
+ if tmp: static['dhcp'] = tmp
+
return static
def verify(static):