From 8f5c16c082489110afb35d6e6e5e457c5aebdadf Mon Sep 17 00:00:00 2001 From: Edouard Lavaud Date: Tue, 14 Jun 2022 10:49:03 +0200 Subject: [PATCH] Mikrotik routeros - ip firewall address-list print terse --- ntc_templates/templates/index | 1 + ..._firewall_address-list_print_terse.textfsm | 11 ++ ..._firewall_address-list_print_terseIPv4.raw | 16 +++ ..._firewall_address-list_print_terseIPv4.yml | 114 ++++++++++++++++++ ..._firewall_address-list_print_terseIPv6.raw | 8 ++ ..._firewall_address-list_print_terseIPv6.yml | 58 +++++++++ 6 files changed, 208 insertions(+) create mode 100644 ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm create mode 100644 tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw create mode 100644 tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml create mode 100644 tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw create mode 100644 tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 848d148360..19f0ac8bf8 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -527,6 +527,7 @@ mikrotik_routeros_ip_firewall_filter_print_all_without-paging.textfsm, .*, mikro mikrotik_routeros_ip_dhcp-server_lease_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip dhcp-server lease print without-paging mikrotik_routeros_ip_firewall_nat_print_all_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? firewall nat print all without-paging mikrotik_routeros_interface_ethernet_monitor_name_once.textfsm, .*, mikrotik_routeros, [[/]]interface ethernet monitor (\S+) once +mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? firewall address-list print terse mikrotik_routeros_snmp_community_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]snmp community print without-paging mikrotik_routeros_ipv6_neighbor_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ipv6 neighbor print without-paging mikrotik_routeros_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging diff --git a/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm b/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm new file mode 100644 index 0000000000..8b9d6f354d --- /dev/null +++ b/ntc_templates/templates/mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm @@ -0,0 +1,11 @@ +Value Key INDEX (\d+) +Value FLAGS ([XD]) +Value LIST (\S+) +Value ADDRESS (\S+) +Value CREATION_TIME (\S+\s\S+) +Value TIMEOUT (\S+) +Value DYNAMIC (yes|no) + +Start + ^\s*${INDEX}\s+(${FLAGS}\s)?list=${LIST}\saddress=${ADDRESS}(\screation-time=${CREATION_TIME})?(\stimeout=${TIMEOUT})?(\sdynamic=${DYNAMIC})?.*$$ -> Record + ^. -> Error diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw new file mode 100644 index 0000000000..f7ae7e87e2 --- /dev/null +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.raw @@ -0,0 +1,16 @@ + 0 list=Eqinoxe address=185.48.253.0/27 creation-time=jan/01/2002 01:00:25 + 1 list=Eqinoxe address=185.48.254.0/28 creation-time=jan/01/2002 01:00:25 + 2 list=Eqinoxe address=185.163.212.64/28 creation-time=jan/01/2002 01:00:25 + 3 list=Eqinoxe address=185.163.212.48/28 creation-time=jan/01/2002 01:00:25 + 4 list=Eqinoxe address=185.197.109.16/28 creation-time=jan/01/2002 01:00:25 + 5 list=Supervision address=185.132.66.240 creation-time=jan/01/2002 01:00:25 + 6 list=Supervision address=85.14.167.232/29 creation-time=jan/01/2002 01:00:25 + 7 list=Supervision address=185.48.254.16/29 creation-time=jan/01/2002 01:00:25 + 8 list=Supervision address=5.10.130.152/30 creation-time=jan/01/2002 01:00:25 + 9 list=Supervision address=85.14.167.193 creation-time=jan/01/2002 01:00:25 +10 list=azeazeaze address=192.168.1.1 creation-time=jun/14/2022 06:34:30 +11 list=azeazeaze address=192.168.1.2 creation-time=jun/14/2022 06:44:09 +12 list=azeazeaze address=192.168.1.3 creation-time=jun/14/2022 06:44:51 +13 X list=azeazeaze address=192.168.3.0/24 creation-time=jun/14/2022 07:53:30 +14 D list=azeazeaze address=192.168.3.0/24 creation-time=jun/14/2022 07:53:49 timeout=4m52s +15 list=snmp-monitoring-address-list address=85.14.167.234 creation-time=mar/01/2023 13:59:33 diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml new file mode 100644 index 0000000000..c2b9476013 --- /dev/null +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv4.yml @@ -0,0 +1,114 @@ +--- +parsed_sample: + - index: "0" + flags: "" + list: "Eqinoxe" + address: "185.48.253.0/27" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "1" + flags: "" + list: "Eqinoxe" + address: "185.48.254.0/28" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "2" + flags: "" + list: "Eqinoxe" + address: "185.163.212.64/28" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "3" + flags: "" + list: "Eqinoxe" + address: "185.163.212.48/28" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "4" + flags: "" + list: "Eqinoxe" + address: "185.197.109.16/28" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "5" + flags: "" + list: "Supervision" + address: "185.132.66.240" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "6" + flags: "" + list: "Supervision" + address: "85.14.167.232/29" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "7" + flags: "" + list: "Supervision" + address: "185.48.254.16/29" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "8" + flags: "" + list: "Supervision" + address: "5.10.130.152/30" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "9" + flags: "" + list: "Supervision" + address: "85.14.167.193" + creation_time: "jan/01/2002 01:00:25" + timeout: "" + dynamic: "" + - index: "10" + flags: "" + list: "azeazeaze" + address: "192.168.1.1" + creation_time: "jun/14/2022 06:34:30" + timeout: "" + dynamic: "" + - index: "11" + flags: "" + list: "azeazeaze" + address: "192.168.1.2" + creation_time: "jun/14/2022 06:44:09" + timeout: "" + dynamic: "" + - index: "12" + flags: "" + list: "azeazeaze" + address: "192.168.1.3" + creation_time: "jun/14/2022 06:44:51" + timeout: "" + dynamic: "" + - index: "13" + flags: "X" + list: "azeazeaze" + address: "192.168.3.0/24" + creation_time: "jun/14/2022 07:53:30" + timeout: "" + dynamic: "" + - index: "14" + flags: "D" + list: "azeazeaze" + address: "192.168.3.0/24" + creation_time: "jun/14/2022 07:53:49" + timeout: "4m52s" + dynamic: "" + - index: "15" + flags: "" + list: "snmp-monitoring-address-list" + address: "85.14.167.234" + creation_time: "mar/01/2023 13:59:33" + timeout: "" + dynamic: "" diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw new file mode 100644 index 0000000000..2de0040c86 --- /dev/null +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.raw @@ -0,0 +1,8 @@ + 0 list=Supervision address=2a05:c100::/48 dynamic=no + 1 list=Supervision address=2a00:41e0::/48 dynamic=no + 2 list=azeazeaze address=b620::/11 dynamic=no + 3 D list=azeazeaze address=63b6:67c3:da8b:2848:4a5c:851b:96a5:6b40/124 dynamic=yes + 4 D list=azeazeaze address=d4de:e2c0::/26 timeout=7m49s dynamic=yes + 5 list=azeazeaze address=e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:ad62/128 dynamic=no + 6 X list=azeazeaze address=e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:0/128 dynamic=no + 7 list=ertyhgfgf address=e7bb:6ba4:5eb9:4014:37f:d1ab:6d74:0/128 dynamic=no diff --git a/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml new file mode 100644 index 0000000000..8698be3678 --- /dev/null +++ b/tests/mikrotik_routeros/ip_firewall_address-list_print_terse/mikrotik_routeros_ip_firewall_address-list_print_terseIPv6.yml @@ -0,0 +1,58 @@ +--- +parsed_sample: + - index: "0" + flags: "" + list: "Supervision" + address: "2a05:c100::/48" + creation_time: "" + timeout: "" + dynamic: "no" + - index: "1" + flags: "" + list: "Supervision" + address: "2a00:41e0::/48" + creation_time: "" + timeout: "" + dynamic: "no" + - index: "2" + flags: "" + list: "azeazeaze" + address: "b620::/11" + creation_time: "" + timeout: "" + dynamic: "no" + - index: "3" + flags: "D" + list: "azeazeaze" + address: "63b6:67c3:da8b:2848:4a5c:851b:96a5:6b40/124" + creation_time: "" + timeout: "" + dynamic: "yes" + - index: "4" + flags: "D" + list: "azeazeaze" + address: "d4de:e2c0::/26" + creation_time: "" + timeout: "7m49s" + dynamic: "yes" + - index: "5" + flags: "" + list: "azeazeaze" + address: "e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:ad62/128" + creation_time: "" + timeout: "" + dynamic: "no" + - index: "6" + flags: "X" + list: "azeazeaze" + address: "e7ba:6ba4:5eb9:4014:37f:d1ab:6d74:0/128" + creation_time: "" + timeout: "" + dynamic: "no" + - index: "7" + flags: "" + list: "ertyhgfgf" + address: "e7bb:6ba4:5eb9:4014:37f:d1ab:6d74:0/128" + creation_time: "" + timeout: "" + dynamic: "no"