From d1345fe688546082a1d8283ccb0c3b05bcd0a1d3 Mon Sep 17 00:00:00 2001 From: fett0 Date: Thu, 30 Mar 2023 22:54:16 +0000 Subject: T5131: fix op-mode show isis segment-routing prefix-sids --- op-mode-definitions/include/isis-common.xml.i | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index 95a171515..4a2f1e503 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -122,6 +122,12 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + Show Prefix-SID information + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + vtysh -c "show isis route" @@ -136,12 +142,6 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - Show prefix segment IDs - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - -- cgit v1.2.3 From 15922541cef35956107e0b32ee952fee05928dbd Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 1 Apr 2023 12:33:21 +0200 Subject: isis: op-mode: T5132: bugfix VRF commands for route and neighbor show isis vrf neighbor|route did not call the vtysh wrapper but instead always called the commands for the default routing table. --- op-mode-definitions/include/isis-common.xml.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index 4a2f1e503..0e20861c7 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -94,7 +94,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - vtysh -c "show isis neighbor" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -129,7 +129,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - vtysh -c "show isis route" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ -- cgit v1.2.3 From 3ffb5ff16543576e73f23125e4590fa57b02f0b7 Mon Sep 17 00:00:00 2001 From: Cheeze_It Date: Sun, 19 Mar 2023 19:24:50 -0600 Subject: T5081: ISIS and OSPF syncronization with IGP-LDP sync --- data/templates/frr/isisd.frr.j2 | 11 ++++++ data/templates/frr/ospfd.frr.j2 | 11 ++++++ .../include/isis/protocol-common-config.xml.i | 4 +- .../include/ldp-sync-interface.xml.i | 22 +++++++++++ .../include/ldp-sync-protocol.xml.i | 21 +++++++++++ .../include/ospf/protocol-common-config.xml.i | 4 +- op-mode-definitions/include/isis-common.xml.i | 26 ++++++++++++- op-mode-definitions/include/ospf-common.xml.i | 26 ++++++++++++- smoketest/scripts/cli/test_protocols_isis.py | 43 ++++++++++++++++++++++ smoketest/scripts/cli/test_protocols_ospf.py | 41 +++++++++++++++++++++ 10 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 interface-definitions/include/ldp-sync-interface.xml.i create mode 100644 interface-definitions/include/ldp-sync-protocol.xml.i (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/data/templates/frr/isisd.frr.j2 b/data/templates/frr/isisd.frr.j2 index 8df1e9513..3c37e28b9 100644 --- a/data/templates/frr/isisd.frr.j2 +++ b/data/templates/frr/isisd.frr.j2 @@ -25,6 +25,12 @@ interface {{ iface }} {% if iface_config.hello_padding is vyos_defined %} isis hello padding {% endif %} +{% if iface_config.ldp_sync.disable is vyos_defined %} + no isis mpls ldp-sync +{% elif iface_config.ldp_sync.holddown is vyos_defined %} + isis mpls ldp-sync + isis mpls ldp-sync holddown {{ iface_config.ldp_sync.holddown }} +{% endif %} {% if iface_config.metric is vyos_defined %} isis metric {{ iface_config.metric }} {% endif %} @@ -84,6 +90,11 @@ router isis VyOS {{ 'vrf ' + vrf if vrf is vyos_defined }} {% if max_lsp_lifetime is vyos_defined %} max-lsp-lifetime {{ max_lsp_lifetime }} {% endif %} +{% if ldp_sync.holddown is vyos_defined %} + mpls ldp-sync holddown {{ ldp_sync.holddown }} +{% elif ldp_sync is vyos_defined %} + mpls ldp-sync +{% endif %} {% if spf_interval is vyos_defined %} spf-interval {{ spf_interval }} {% endif %} diff --git a/data/templates/frr/ospfd.frr.j2 b/data/templates/frr/ospfd.frr.j2 index 8c4a81c57..3f97b7325 100644 --- a/data/templates/frr/ospfd.frr.j2 +++ b/data/templates/frr/ospfd.frr.j2 @@ -44,6 +44,12 @@ interface {{ iface }} {% if iface_config.bfd.profile is vyos_defined %} ip ospf bfd profile {{ iface_config.bfd.profile }} {% endif %} +{% if iface_config.ldp_sync.disable is vyos_defined %} + no ip ospf mpls ldp-sync +{% elif iface_config.ldp_sync.holddown is vyos_defined %} + ip ospf mpls ldp-sync + ip ospf mpls ldp-sync holddown {{ iface_config.ldp_sync.holddown }} +{% endif %} {% if iface_config.mtu_ignore is vyos_defined %} ip ospf mtu-ignore {% endif %} @@ -133,6 +139,11 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {% if maximum_paths is vyos_defined %} maximum-paths {{ maximum_paths }} {% endif %} +{% if ldp_sync.holddown is vyos_defined %} + mpls ldp-sync holddown {{ ldp_sync.holddown }} +{% elif ldp_sync is vyos_defined %} + mpls ldp-sync +{% endif %} {% if distance.global is vyos_defined %} distance {{ distance.global }} {% endif %} diff --git a/interface-definitions/include/isis/protocol-common-config.xml.i b/interface-definitions/include/isis/protocol-common-config.xml.i index 0e6f19480..983a085ec 100644 --- a/interface-definitions/include/isis/protocol-common-config.xml.i +++ b/interface-definitions/include/isis/protocol-common-config.xml.i @@ -152,6 +152,7 @@ +#include A Network Entity Title for this process (ISO only) @@ -172,7 +173,7 @@ - Show IS-IS neighbor adjacencies + IS-IS traffic engineering extensions @@ -631,6 +632,7 @@ #include + #include Set network type diff --git a/interface-definitions/include/ldp-sync-interface.xml.i b/interface-definitions/include/ldp-sync-interface.xml.i new file mode 100644 index 000000000..b24831bbe --- /dev/null +++ b/interface-definitions/include/ldp-sync-interface.xml.i @@ -0,0 +1,22 @@ + + + + LDP-IGP synchronization configuration for interface + + + #include + + + Hold down timer for LDP-IGP cost restoration + + u32:0-10000 + Time to wait in seconds for LDP-IGP synchronization to occur before restoring interface cost + + + + + + + + + diff --git a/interface-definitions/include/ldp-sync-protocol.xml.i b/interface-definitions/include/ldp-sync-protocol.xml.i new file mode 100644 index 000000000..c82c811f6 --- /dev/null +++ b/interface-definitions/include/ldp-sync-protocol.xml.i @@ -0,0 +1,21 @@ + + + + Protocol wide LDP-IGP synchronization configuration + + + + + Protocol wide hold down timer for LDP-IGP cost restoration + + u32:0-10000 + Time to wait in seconds for LDP-IGP synchronization to occur before restoring interface cost + + + + + + + + + diff --git a/interface-definitions/include/ospf/protocol-common-config.xml.i b/interface-definitions/include/ospf/protocol-common-config.xml.i index f39b9c5e3..425d3b01c 100644 --- a/interface-definitions/include/ospf/protocol-common-config.xml.i +++ b/interface-definitions/include/ospf/protocol-common-config.xml.i @@ -331,6 +331,7 @@ +#include Administrative distance @@ -385,6 +386,7 @@ #include #include #include + #include Interface bandwidth (Mbit/s) @@ -875,4 +877,4 @@ - + \ No newline at end of file diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index 0e20861c7..53e85a7ef 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -54,6 +54,30 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + Show IS-IS MPLS specific information + + + + + Show IS-IS LDP-IGP synchronization information + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + Show specific IS-IS LDP-IGP synchronization for an interface + + + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + + Show IS-IS MPLS traffic engineering information @@ -176,4 +200,4 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + \ No newline at end of file diff --git a/op-mode-definitions/include/ospf-common.xml.i b/op-mode-definitions/include/ospf-common.xml.i index 098254f4e..7d9e541cf 100644 --- a/op-mode-definitions/include/ospf-common.xml.i +++ b/op-mode-definitions/include/ospf-common.xml.i @@ -517,6 +517,30 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + Show OSPF MPLS specific information + + + + + Show OSPF LDP-IGP synchronization information + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + Show specific OSPF LDP-IGP synchronization for an interface + + + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + + Show IPv4 OSPF neighbor information @@ -547,4 +571,4 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + \ No newline at end of file diff --git a/smoketest/scripts/cli/test_protocols_isis.py b/smoketest/scripts/cli/test_protocols_isis.py index d11d80a1f..61e29c449 100755 --- a/smoketest/scripts/cli/test_protocols_isis.py +++ b/smoketest/scripts/cli/test_protocols_isis.py @@ -308,5 +308,48 @@ class TestProtocolsISIS(VyOSUnitTestSHIM.TestCase): self.assertIn(f' segment-routing prefix {prefix_three} absolute {prefix_three_value} explicit-null', tmp) self.assertIn(f' segment-routing prefix {prefix_four} absolute {prefix_four_value} no-php-flag', tmp) + def test_isis_08_ldp_sync(self): + holddown = "500" + interface = 'lo' + + self.cli_set(base_path + ['net', net]) + self.cli_set(base_path + ['interface', interface]) + self.cli_set(base_path + ['ldp-sync', 'holddown', holddown]) + + # Commit main ISIS changes + self.cli_commit() + + # Verify main ISIS changes + tmp = self.getFRRconfig(f'router isis {domain}', daemon='isisd') + self.assertIn(f' net {net}', tmp) + self.assertIn(f' mpls ldp-sync', tmp) + self.assertIn(f' mpls ldp-sync holddown {holddown}', tmp) + + for interface in self._interfaces: + self.cli_set(base_path + ['interface', interface, 'ldp-sync', 'holddown', holddown]) + + # Commit interface changes for holddown + self.cli_commit() + + # Verify interface changes for holddown + tmp = self.getFRRconfig(f'interface {interface}', daemon='isisd') + self.assertIn(f'interface {interface}', tmp) + self.assertIn(f' ip router isis {domain}', tmp) + self.assertIn(f' ipv6 router isis {domain}', tmp) + self.assertIn(f' isis mpls ldp-sync holddown {holddown}', tmp) + + for interface in self._interfaces: + self.cli_set(base_path + ['interface', interface, 'ldp-sync', 'disable']) + + # Commit interface changes for disable + self.cli_commit() + + # Verify interface changes for disable + tmp = self.getFRRconfig(f'interface {interface}', daemon='isisd') + self.assertIn(f'interface {interface}', tmp) + self.assertIn(f' ip router isis {domain}', tmp) + self.assertIn(f' ipv6 router isis {domain}', tmp) + self.assertIn(f' no isis mpls ldp-sync', tmp) + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 581959b15..d4c85f2b2 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -434,6 +434,47 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): self.assertIn(f' segment-routing prefix {prefix_one} index {prefix_one_value} explicit-null', frrconfig) self.assertIn(f' segment-routing prefix {prefix_two} index {prefix_two_value} no-php-flag', frrconfig) + def test_ospf_15_ldp_sync(self): + holddown = "500" + interface = 'lo' + interfaces = Section.interfaces('ethernet') + + self.cli_set(base_path + ['interface', interface]) + self.cli_set(base_path + ['ldp-sync', 'holddown', holddown]) + + # Commit main OSPF changes + self.cli_commit() + + # Verify main OSPF changes + frrconfig = self.getFRRconfig('router ospf') + self.assertIn(f'router ospf', frrconfig) + self.assertIn(f' timers throttle spf 200 1000 10000', frrconfig) + self.assertIn(f' mpls ldp-sync holddown {holddown}', frrconfig) + + for interface in interfaces: + self.cli_set(base_path + ['interface', interface, 'ldp-sync', 'holddown', holddown]) + + # Commit interface changes for holddown + self.cli_commit() + + # Verify interface changes for holddown + config = self.getFRRconfig(f'interface {interface}') + self.assertIn(f'interface {interface}', config) + self.assertIn(f' ip ospf dead-interval 40', config) + self.assertIn(f' ip ospf mpls ldp-sync', config) + self.assertIn(f' ip ospf mpls ldp-sync holddown {holddown}', config) + + for interface in interfaces: + self.cli_set(base_path + ['interface', interface, 'ldp-sync', 'disable']) + + # Commit interface changes for disable + self.cli_commit() + + # Verify interface changes for disable + config = self.getFRRconfig(f'interface {interface}') + self.assertIn(f'interface {interface}', config) + self.assertIn(f' ip ospf dead-interval 40', config) + self.assertIn(f' no ip ospf mpls ldp-sync', config) if __name__ == '__main__': unittest.main(verbosity=2) -- cgit v1.2.3 From 9347bfa209626167f7f04856a81fc4ccab1aaccd Mon Sep 17 00:00:00 2001 From: Cheeze_It Date: Sun, 9 Apr 2023 17:38:36 -0600 Subject: T5081: ISIS and OSPF syncronization with IGP-LDP sync --- op-mode-definitions/include/isis-common.xml.i | 22 +++------------------- op-mode-definitions/include/ldp-sync.xml.i | 19 +++++++++++++++++++ op-mode-definitions/include/ospf-common.xml.i | 20 ++------------------ 3 files changed, 24 insertions(+), 37 deletions(-) create mode 100644 op-mode-definitions/include/ldp-sync.xml.i (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index 53e85a7ef..b5b4f9b5d 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -56,31 +56,15 @@ - Show IS-IS MPLS specific information + Show MPLS information - - - Show IS-IS LDP-IGP synchronization information - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - - Show specific IS-IS LDP-IGP synchronization for an interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - + #include - Show IS-IS MPLS traffic engineering information + Show MPLS traffic engineering information diff --git a/op-mode-definitions/include/ldp-sync.xml.i b/op-mode-definitions/include/ldp-sync.xml.i new file mode 100644 index 000000000..b3be8f503 --- /dev/null +++ b/op-mode-definitions/include/ldp-sync.xml.i @@ -0,0 +1,19 @@ + + + + Show LDP-IGP synchronization information + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + Show specific LDP-IGP synchronization for an interface + + + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + + + \ No newline at end of file diff --git a/op-mode-definitions/include/ospf-common.xml.i b/op-mode-definitions/include/ospf-common.xml.i index 7d9e541cf..d1a62b690 100644 --- a/op-mode-definitions/include/ospf-common.xml.i +++ b/op-mode-definitions/include/ospf-common.xml.i @@ -519,26 +519,10 @@ - Show OSPF MPLS specific information + Show MPLS information - - - Show OSPF LDP-IGP synchronization information - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - - Show specific OSPF LDP-IGP synchronization for an interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - + #include -- cgit v1.2.3 From 47bd0d8ab940bd8bb9b7c852ac80e0d9a3728a82 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 12 Apr 2023 21:46:07 +0200 Subject: xml: op-mode: T5081: re-use vtysh-generic-detail building block --- op-mode-definitions/include/isis-common.xml.i | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index b5b4f9b5d..53be33b68 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -4,12 +4,7 @@ Show IS-IS link state database - - - Show detailed information - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + #include ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -36,12 +31,7 @@ - - - Show detailed information - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + #include ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ @@ -95,12 +85,7 @@ Show IS-IS neighbor adjacencies - - - Show detailed information - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + #include ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ -- cgit v1.2.3 From 23c757dae9b164cdaeba334b509b4def9c71f9b3 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 12 Apr 2023 21:47:31 +0200 Subject: xml: op-mode: T5081: introduce new FRR tagNode interface building block --- op-mode-definitions/include/isis-common.xml.i | 20 ++------------------ op-mode-definitions/include/ldp-sync.xml.i | 10 +--------- op-mode-definitions/include/ospf-common.xml.i | 10 +--------- .../include/vtysh-generic-interface-tagNode.xml.i | 11 +++++++++++ 4 files changed, 15 insertions(+), 36 deletions(-) create mode 100644 op-mode-definitions/include/vtysh-generic-interface-tagNode.xml.i (limited to 'op-mode-definitions/include/isis-common.xml.i') diff --git a/op-mode-definitions/include/isis-common.xml.i b/op-mode-definitions/include/isis-common.xml.i index 53be33b68..e94d868e8 100644 --- a/op-mode-definitions/include/isis-common.xml.i +++ b/op-mode-definitions/include/isis-common.xml.i @@ -35,15 +35,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - Show specific IS-IS interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - +#include Show MPLS information @@ -69,15 +61,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - Show specific IS-IS interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + #include diff --git a/op-mode-definitions/include/ldp-sync.xml.i b/op-mode-definitions/include/ldp-sync.xml.i index b3be8f503..b7b04e7e5 100644 --- a/op-mode-definitions/include/ldp-sync.xml.i +++ b/op-mode-definitions/include/ldp-sync.xml.i @@ -5,15 +5,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - Show specific LDP-IGP synchronization for an interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - + #include \ No newline at end of file diff --git a/op-mode-definitions/include/ospf-common.xml.i b/op-mode-definitions/include/ospf-common.xml.i index d1a62b690..aebbae5ff 100644 --- a/op-mode-definitions/include/ospf-common.xml.i +++ b/op-mode-definitions/include/ospf-common.xml.i @@ -508,15 +508,7 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - - - Show IPv4 OSPF information for specified interface - - - - - ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ - +#include Show MPLS information diff --git a/op-mode-definitions/include/vtysh-generic-interface-tagNode.xml.i b/op-mode-definitions/include/vtysh-generic-interface-tagNode.xml.i new file mode 100644 index 000000000..e95961177 --- /dev/null +++ b/op-mode-definitions/include/vtysh-generic-interface-tagNode.xml.i @@ -0,0 +1,11 @@ + + + + Show information about specific interface + + + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + -- cgit v1.2.3