summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-31 13:46:50 +0100
committerChristian Breunig <christian@breunig.cc>2024-12-31 14:22:19 +0100
commit6452754673a935d223e252db616e859253a581c0 (patch)
treea031024051354d787a07a68cd96ddc353dabaea0 /python
parentf7a67d792afe603116e3ecae33257bba6801546d (diff)
downloadvyos-1x-6452754673a935d223e252db616e859253a581c0.tar.gz
vyos-1x-6452754673a935d223e252db616e859253a581c0.zip
frrender: T6991: do not loose DHCP default route when no static route is defined
The reason is that DHCP routes are not re-generated during FRRrender as long as there is no protocols static entry in the configuration at all. Move out the DHCP configuration read-in from the static section.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/frrender.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py
index 776e893d9..544983b2c 100644
--- a/python/vyos/frrender.py
+++ b/python/vyos/frrender.py
@@ -360,17 +360,24 @@ def get_frrender_dict(conf, argv=None) -> dict:
static = conf.get_config_dict(static_cli_path, key_mangling=('-', '_'),
get_first_key=True,
no_tag_node_value_mangle=True)
-
- # T3680 - get a list of all interfaces currently configured to use DHCP
- tmp = get_dhcp_interfaces(conf)
- if tmp: static.update({'dhcp' : tmp})
- tmp = get_pppoe_interfaces(conf)
- if tmp: static.update({'pppoe' : tmp})
-
dict.update({'static' : static})
elif conf.exists_effective(static_cli_path):
dict.update({'static' : {'deleted' : ''}})
+ # T3680 - get a list of all interfaces currently configured to use DHCP
+ tmp = get_dhcp_interfaces(conf)
+ if tmp:
+ if 'static' in dict:
+ dict['static'].update({'dhcp' : tmp})
+ else:
+ dict.update({'static' : {'dhcp' : tmp}})
+ tmp = get_pppoe_interfaces(conf)
+ if tmp:
+ if 'static' in dict:
+ dict['static'].update({'pppoe' : tmp})
+ else:
+ dict.update({'static' : {'pppoe' : tmp}})
+
# keep a re-usable list of dependent VRFs
dependent_vrfs_default = {}
if 'bgp' in dict:
@@ -534,6 +541,10 @@ def get_frrender_dict(conf, argv=None) -> dict:
dict.update({'vrf' : vrf})
+ if os.path.exists(frr_debug_enable):
+ import pprint
+ pprint.pprint(dict)
+
return dict
class FRRender: