From f0fb71366bcfb72de4a5ee280d35e28016d6a3c5 Mon Sep 17 00:00:00 2001 From: sever-sever Date: Tue, 19 May 2020 21:00:32 +0300 Subject: eigrp: T2473: add XML definitions --- interface-definitions/protocols-eigrp.xml.in | 143 +++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 interface-definitions/protocols-eigrp.xml.in diff --git a/interface-definitions/protocols-eigrp.xml.in b/interface-definitions/protocols-eigrp.xml.in new file mode 100644 index 000000000..15ebc162a --- /dev/null +++ b/interface-definitions/protocols-eigrp.xml.in @@ -0,0 +1,143 @@ + + + + + + + + Enhanced Interior Gateway Routing Protocol (EIGRP) parameters + + <1-65535> + AS number + + + + + + + + + Forward packets over multiple paths + + <1-32> + Number of paths + + + + + + + + + Modify metrics and parameters for advertisement + + + + + Modify metric coefficients + + <0-255> + K1 + + + + + + + + + + + Enable routing on an IP network + + ipv4net + EIGRP network prefix + + + + + + + + + + Suppress routing updates on an interface + + + + + + + + Redistribute information from another routing protocol + + bgp + Border Gateway Protocol (BGP) + + + connected + Connected routes + + + nhrp + Next Hop Resolution Protocol (NHRP) + + + ospf + Open Shortest Path First (OSPFv2) + + + rip + Routing Information Protocol (RIP) + + + static + Statically configured routes + + + vnc + Virtual Network Control (VNC) + + + bgp connected nhrp ospf rip static vnc + + + (bgp|connected|nhrp|ospf|rip|static|vnc) + + + + + + Router ID for this EIGRP process + + ipv4 + EIGRP Router-ID in IP address format + + + + + + + + + + Control load balancing variance + + <1-128> + Metric variance multiplier + + + + + + + + + + -- cgit v1.2.3 From 98895f5b31d20bbdc86680c9f73679b7905d7eb6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 May 2022 10:14:27 +0200 Subject: eigrp: vrf: T2773: prepare XML definitions for VRF instance --- .../include/eigrp/protocol-common-config.xml.i | 107 ++++++++++++++++ interface-definitions/protocols-eigrp.xml.in | 136 +-------------------- interface-definitions/vrf.xml.in | 9 ++ 3 files changed, 121 insertions(+), 131 deletions(-) create mode 100644 interface-definitions/include/eigrp/protocol-common-config.xml.i diff --git a/interface-definitions/include/eigrp/protocol-common-config.xml.i b/interface-definitions/include/eigrp/protocol-common-config.xml.i new file mode 100644 index 000000000..c8faa0492 --- /dev/null +++ b/interface-definitions/include/eigrp/protocol-common-config.xml.i @@ -0,0 +1,107 @@ + + + + Forward packets over multiple paths + + u32:1-32 + Number of paths + + + + + + + + + Modify metrics and parameters for advertisement + + + + + Modify metric coefficients + + u32:0-255 + K1 + + + + + + + + + + + Enable routing on an IP network + + ipv4net + EIGRP network prefix + + + + + + + + + + Suppress routing updates on an interface + + + + + + + + Redistribute information from another routing protocol + + bgp + Border Gateway Protocol (BGP) + + + connected + Connected routes + + + nhrp + Next Hop Resolution Protocol (NHRP) + + + ospf + Open Shortest Path First (OSPFv2) + + + rip + Routing Information Protocol (RIP) + + + static + Statically configured routes + + + vnc + Virtual Network Control (VNC) + + + bgp connected nhrp ospf rip static vnc + + + (bgp|connected|nhrp|ospf|rip|static|vnc) + + + +#include + + + + Control load balancing variance + + u32:1-128 + Metric variance multiplier + + + + + + + diff --git a/interface-definitions/protocols-eigrp.xml.in b/interface-definitions/protocols-eigrp.xml.in index 15ebc162a..88a881a1e 100644 --- a/interface-definitions/protocols-eigrp.xml.in +++ b/interface-definitions/protocols-eigrp.xml.in @@ -3,141 +3,15 @@ - + - Enhanced Interior Gateway Routing Protocol (EIGRP) parameters - - <1-65535> - AS number - - - - + Enhanced Interior Gateway Routing Protocol (EIGRP) + 820 - - - Forward packets over multiple paths - - <1-32> - Number of paths - - - - - - - - - Modify metrics and parameters for advertisement - - - - - Modify metric coefficients - - <0-255> - K1 - - - - - - - - - - - Enable routing on an IP network - - ipv4net - EIGRP network prefix - - - - - - - - - - Suppress routing updates on an interface - - - - - - - - Redistribute information from another routing protocol - - bgp - Border Gateway Protocol (BGP) - - - connected - Connected routes - - - nhrp - Next Hop Resolution Protocol (NHRP) - - - ospf - Open Shortest Path First (OSPFv2) - - - rip - Routing Information Protocol (RIP) - - - static - Statically configured routes - - - vnc - Virtual Network Control (VNC) - - - bgp connected nhrp ospf rip static vnc - - - (bgp|connected|nhrp|ospf|rip|static|vnc) - - - - - - Router ID for this EIGRP process - - ipv4 - EIGRP Router-ID in IP address format - - - - - - - - - - Control load balancing variance - - <1-128> - Metric variance multiplier - - - - - + #include - + diff --git a/interface-definitions/vrf.xml.in b/interface-definitions/vrf.xml.in index 25a573887..b63d60415 100644 --- a/interface-definitions/vrf.xml.in +++ b/interface-definitions/vrf.xml.in @@ -58,6 +58,15 @@ #include + + + Enhanced Interior Gateway Routing Protocol (EIGRP) + 821 + + + #include + + Intermediate System to Intermediate System (IS-IS) -- cgit v1.2.3 From 651984e7e57502769975a88226eda8adf73a9faf Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 May 2022 10:15:13 +0200 Subject: eigrp: T2472: add initial python helper --- src/conf_mode/protocols_eigrp.py | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 src/conf_mode/protocols_eigrp.py diff --git a/src/conf_mode/protocols_eigrp.py b/src/conf_mode/protocols_eigrp.py new file mode 100755 index 000000000..21ec51337 --- /dev/null +++ b/src/conf_mode/protocols_eigrp.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2022 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +def get_config(config=None): + if config: + conf = config + else: + conf = Config() + + vrf = None + if len(argv) > 1: + vrf = argv[1] + + base_path = ['protocols', 'eigrp'] + + # eqivalent of the C foo ? 'a' : 'b' statement + base = vrf and ['vrf', 'name', vrf, 'protocols', 'eigrp'] or base_path + eigrp = conf.get_config_dict(base, key_mangling=('-', '_'), + get_first_key=True, no_tag_node_value_mangle=True) + + # Assign the name of our VRF context. This MUST be done before the return + # statement below, else on deletion we will delete the default instance + # instead of the VRF instance. + if vrf: eigrp.update({'vrf' : vrf}) + + if not conf.exists(base): + eigrp.update({'deleted' : ''}) + if not vrf: + # We are running in the default VRF context, thus we can not delete + # our main EIGRP instance if there are dependent EIGRP VRF instances. + eigrp['dependent_vrfs'] = conf.get_config_dict(['vrf', 'name'], + key_mangling=('-', '_'), + get_first_key=True, + no_tag_node_value_mangle=True) + + return eigrp + + # We also need some additional information from the config, prefix-lists + # and route-maps for instance. They will be used in verify(). + # + # XXX: one MUST always call this without the key_mangling() option! See + # vyos.configverify.verify_common_route_maps() for more information. + tmp = conf.get_config_dict(['policy']) + # Merge policy dict into "regular" config dict + eigrp = dict_merge(tmp, eigrp) + + import pprint + pprint.pprint(eigrp) + return eigrp + +def verify(eigrp): + pass + +def generate(eigrp): + pass + +def apply(eigrp): + pass + +if __name__ == '__main__': + try: + c = get_config() + verify(c) + generate(c) + apply(c) + except ConfigError as e: + print(e) + exit(1) -- cgit v1.2.3 From 19e460288a9950becb2fb510f6582d1c62b36079 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 29 May 2022 10:15:38 +0200 Subject: eigrp: T2472: disable protocol by default --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 2333eebed..63d23495d 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,11 @@ interface_definitions: $(config_xml_obj) rm -rf $(TMPL_DIR)/qos rm -rf $(TMPL_DIR)/interfaces/input + # T2472 - EIGRP support + rm -rf $(TMPL_DIR)/protocols/eigrp + # T2773 - EIGRP support for VRF + rm -rf $(TMPL_DIR)/vrf/name/node.tag/protocols + # XXX: test if there are empty node.def files - this is not allowed as these # could mask help strings or mandatory priority statements find $(TMPL_DIR) -name node.def -type f -empty -exec false {} + || sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1' -- cgit v1.2.3