diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-31 13:46:50 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-12-31 14:22:19 +0100 |
commit | 6452754673a935d223e252db616e859253a581c0 (patch) | |
tree | a031024051354d787a07a68cd96ddc353dabaea0 /python | |
parent | f7a67d792afe603116e3ecae33257bba6801546d (diff) | |
download | vyos-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.py | 25 |
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: |