summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-11 21:07:28 +0100
committerChristian Breunig <christian@breunig.cc>2024-12-16 22:24:50 +0100
commit2e4725cd77a33f91e091d86d94056f43dafd153d (patch)
tree0165c80754a6dea656c915794508ca47fcf1668c /python
parent55683a8406e17408021437cb35b57c48bd8b2ab1 (diff)
downloadvyos-1x-2e4725cd77a33f91e091d86d94056f43dafd153d.tar.gz
vyos-1x-2e4725cd77a33f91e091d86d94056f43dafd153d.zip
frr: T6746: handle "system ip" and "system ipv6" with FRRender class
FRR 10.2 will use "[no] ip forwarding" and "[no] ipv6 forwarding" to enable or disable IP(v6) forwarding. We no longer rely on sysctl as this was overridden by FRR later on. Remove code path for sysctl setting and solely rely on FRR.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py9
-rw-r--r--python/vyos/frrender.py14
2 files changed, 21 insertions, 2 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index f5e84267e..9522d8fcc 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -775,6 +775,15 @@ def get_frrender_dict(conf, argv=None) -> dict:
# At least one participating EVPN interface found, add to result dict
if tmp: dict['interfaces'] = tmp
+ # Zebra prefix exchange for Kernel IP/IPv6 and routing protocols
+ for ip_version in ['ip', 'ipv6']:
+ ip_cli_path = ['system', ip_version]
+ ip_dict = conf.get_config_dict(ip_cli_path, key_mangling=('-', '_'),
+ get_first_key=True, with_recursive_defaults=True)
+ if ip_dict:
+ ip_dict['afi'] = ip_version
+ dict.update({ip_version : ip_dict})
+
# Enable SNMP agentx support
# SNMP AgentX support cannot be disabled once enabled
if conf.exists(['service', 'snmp']):
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py
index f1bb39094..7a0b661a3 100644
--- a/python/vyos/frrender.py
+++ b/python/vyos/frrender.py
@@ -32,12 +32,16 @@ def debug(message):
return
print(message)
-pim_daemon = 'pimd'
-
frr_protocols = ['babel', 'bfd', 'bgp', 'eigrp', 'isis', 'mpls', 'nhrp',
'openfabric', 'ospf', 'ospfv3', 'pim', 'pim6', 'rip',
'ripng', 'rpki', 'segment_routing', 'static']
+bgp_daemon = 'bgpd'
+isis_daemon = 'isisd'
+mgmt_daemon = 'mgmtd'
+pim_daemon = 'pimd'
+zebra_daemon = 'zebra'
+
class FRRender:
def __init__(self):
self._frr_conf = '/run/frr/config/frr.conf'
@@ -100,6 +104,12 @@ class FRRender:
if 'static' in config_dict and 'deleted' not in config_dict['static']:
output += render_to_string('frr/staticd.frr.j2', config_dict['static'])
output += '\n'
+ if 'ip' in config_dict and 'deleted' not in config_dict['ip']:
+ output += render_to_string('frr/zebra.route-map.frr.j2', config_dict['ip'])
+ output += '\n'
+ if 'ipv6' in config_dict and 'deleted' not in config_dict['ipv6']:
+ output += render_to_string('frr/zebra.route-map.frr.j2', config_dict['ipv6'])
+ output += '\n'
return output
debug('======< RENDERING CONFIG >======')