diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 5261f1a7f8..cc6dfeb589 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -577,6 +577,7 @@ mikrotik_routeros_system_routerboard_print.textfsm, .*, mikrotik_routeros, [[/]] mikrotik_routeros_ip_route_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? route print terse mikrotik_routeros_system_clock_print.textfsm, .*, mikrotik_routeros, [[/]]sy[[stem]] cl[[ock]] p[[rint]] mikrotik_routeros_user_active_print.textfsm, .*, mikrotik_routeros, [[/]]us[[er]] ac[[tive]] p[[rint]] +mikrotik_routeros_ip_address_print.textfsm, .*, mikrotik_routeros, [[/]]ip ad[[dress]] p[[rint]] paloalto_panos_show_running_security-policy.textfsm, .*, paloalto_panos, sh[[ow]] runn[[ing]] security[[-policy]] paloalto_panos_show_high-availability_all.textfsm, .*, paloalto_panos, sh[[ow]] high[[-availability]] all diff --git a/ntc_templates/templates/mikrotik_routeros_ip_address_print.textfsm b/ntc_templates/templates/mikrotik_routeros_ip_address_print.textfsm new file mode 100644 index 0000000000..2a56a8424d --- /dev/null +++ b/ntc_templates/templates/mikrotik_routeros_ip_address_print.textfsm @@ -0,0 +1,20 @@ +Value NUM (\d+) +Value FLAGS (X|I|D) +Value COMMENT (.*) +Value IP (\S+) +Value SUBNET (\d+) +Value NETWORK (\S+) +Value INTERFACE (.*) + +Start + ^\s*Flags:\s+X\s+-\s+disabled,\s+I\s+-\s+invalid,\s+D\s+-\s+dynamic\s*$$ + ^\s*#\s+ADDRESS\s+NETWORK\s+INTERFACE\s*$$ -> IPsTable + ^\s*$$ + ^. -> Error + +IPsTable + ^\s*${NUM}\s+(?:${FLAGS}\s+)?${IP}/${SUBNET}\s+${NETWORK}\s+${INTERFACE}\s*$$ -> Record + ^\s*${NUM}\s+(?:${FLAGS}\s+)?;;;\s+${COMMENT}\s*$$ + ^\s*${IP}/${SUBNET}\s+${NETWORK}\s+${INTERFACE}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.raw b/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.raw new file mode 100644 index 0000000000..9985d9f4dd --- /dev/null +++ b/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.raw @@ -0,0 +1,8 @@ +Flags: X - disabled, I - invalid, D - dynamic + # ADDRESS NETWORK INTERFACE + 0 1.2.3.6/30 1.2.3.4 ether1 + 1 ;;; test ip1 + 192.167.1.5/27 192.167.1.0 eth2_vlan1 + 2 D 192.168.1.53/24 192.168.1.0 lte1 + 3 X ;;; test ip2 + 192.167.1.99/27 192.167.1.0 eth2_vlan2 diff --git a/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.yml b/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.yml new file mode 100644 index 0000000000..9db49d151d --- /dev/null +++ b/tests/mikrotik_routeros/ip_address_print/mikrotik_routeros_ip_address_print.yml @@ -0,0 +1,30 @@ +--- +parsed_sample: + - num: "0" + flags: "" + comment: "" + ip: "1.2.3.6" + subnet: "30" + network: "1.2.3.4" + interface: "ether1" + - num: "1" + flags: "" + comment: "test ip1" + ip: "192.167.1.5" + subnet: "27" + network: "192.167.1.0" + interface: "eth2_vlan1" + - num: "2" + flags: "D" + comment: "" + ip: "192.168.1.53" + subnet: "24" + network: "192.168.1.0" + interface: "lte1" + - num: "3" + flags: "X" + comment: "test ip2" + ip: "192.167.1.99" + subnet: "27" + network: "192.167.1.0" + interface: "eth2_vlan2"