Skip to content

Commit

Permalink
Ad MikroTik ip route print terse without-paging template (#1499)
Browse files Browse the repository at this point in the history
Co-authored-by: pskliarenko <“[email protected]”>
  • Loading branch information
PavloSkliarenko and pskliarenko authored Jul 22, 2024
1 parent 605fa01 commit 5888b12
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 0 deletions.
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ mikrotik_routeros_ip_firewall_nat_print_all_without-paging.textfsm, .*, mikrotik
mikrotik_routeros_interface_ethernet_monitor_name_once.textfsm, .*, mikrotik_routeros, [[/]]interface ethernet monitor (\S+) once
mikrotik_routeros_interface_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] p[[rint]] t[[erse]] wi[[thout-paging]]
mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? firewall address-list print terse
mikrotik_routeros_ip_route_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip r[[oute]] p[[rint]] t[[erse]] wi[[thout-paging]]
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_log_print_detail_without-paging.textfsm, .*, mikrotik_routeros, [[/]]log p[[rint]] d[[etail]] wi[[thout-paging]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Value INDEX (\d+)
Value FLAGS ([XADCSrbomBUP ]{4})
Value COMMENT (.*?(?=(?:[^=]\S+=)|\s*$))
Value DESTINATION_ADDRESS (\S+)
Value DESTINATION_ADDRESS_SUBNET (\d+)
Value TYPE (.+?(?=(?:[^=]\S+=)|\s*$))
Value ROUTING_TABLE (.+?(?=(?:[^=]\S+=)|\s*$))
Value PREF_SRC (\S+?)
Value GATEWAY (.+?(?=(?:[^=]\S+=)|\s*$))
Value GATEWAY_STATUS (.+?(?=(?:[^=]\S+=)|\s*$))
Value IMMEDIATE_GW (.+?(?=(?:[^=]\S+=)|\s*$))
Value CHECK_GATEWAY (.+?(?=(?:[^=]\S+=)|\s*$))
Value DISTANCE (\d+)
Value SCOPE (\d+)
Value TARGET_SCOPE (\d+)
Value VRF_INTERFACE (.+?(?=(?:[^=]\S+=)|\s*$))
Value SUPPRESS_HW_OFFLOAD (yes|no)
Value LOCAL_ADDRESS (.+?(?=(?:[^=]\S+=)|\s*$))
Value ROUTING_MARK (.*?(?=(?:[^=]\S+=)|\s*$))

Start
^\s*${INDEX}\s+${FLAGS}(?:\s+comment=${COMMENT})?\s+dst-address=${DESTINATION_ADDRESS}/${DESTINATION_ADDRESS_SUBNET}(?:\s+type=${TYPE})?(?:\s+routing-table=${ROUTING_TABLE})?(?:\s+pref-src=${PREF_SRC})?(?:\s+gateway=${GATEWAY})?(?:\s+gateway-status=${GATEWAY_STATUS})?(?:\s+immediate-gw=${IMMEDIATE_GW})?(?:\s+check-gateway=${CHECK_GATEWAY})?(?:\s+distance=${DISTANCE})?(?:\s+scope=${SCOPE})?(?:\s+target-scope=${TARGET_SCOPE})?(?:\s+vrf-interface=${VRF_INTERFACE})?(?:\s+suppress-hw-offload=${SUPPRESS_HW_OFFLOAD})?(?:\s+local-address=${LOCAL_ADDRESS})?(?:\s+routing-mark=${ROUTING_MARK})?\s*$$ -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0 A S dst-address=0.0.0.0/0 gateway=192.168.8.1 gateway-status=192.168.8.1 reachable via lte1 distance=2 scope=30 target-scope=10 vrf-interface=lte1
1 ADC dst-address=10.160.1.228/30 pref-src=10.160.1.230 gateway=ether1 gateway-status=ether1 reachable distance=0 scope=10
2 A S comment=to Internet dst-address=134.0.0.0/8 gateway=10.160.1.230 gateway-status=10.160.1.230 reachable via ether2 distance=1 scope=30 target-scope=10 routing-mark=reserve
3 A S dst-address=172.0.0.0/8 gateway=1.2.3.4 gateway-status=1.2.3.4 recursive via 10.152.1.230 ether5 distance=1 scope=30 target-scope=10 routing-mark=Free_Wi-Fi
4 A SB dst-address=10.0.0.0/8 type=blackhole distance=100 routing-mark=Free_Wi-Fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
parsed_sample:
- check_gateway: ""
comment: ""
distance: "2"
destination_address: "0.0.0.0"
destination_address_subnet: "0"
flags: "A S "
gateway: "192.168.8.1"
gateway_status: "192.168.8.1 reachable via lte1"
immediate_gw: ""
index: "0"
local_address: ""
pref_src: ""
routing_mark: ""
routing_table: ""
scope: "30"
suppress_hw_offload: ""
target_scope: "10"
type: ""
vrf_interface: "lte1"
- check_gateway: ""
comment: ""
distance: "0"
destination_address: "10.160.1.228"
destination_address_subnet: "30"
flags: "ADC "
gateway: "ether1"
gateway_status: "ether1 reachable"
immediate_gw: ""
index: "1"
local_address: ""
pref_src: "10.160.1.230"
routing_mark: ""
routing_table: ""
scope: "10"
suppress_hw_offload: ""
target_scope: ""
type: ""
vrf_interface: ""
- check_gateway: ""
comment: "to Internet"
distance: "1"
destination_address: "134.0.0.0"
destination_address_subnet: "8"
flags: "A S "
gateway: "10.160.1.230"
gateway_status: "10.160.1.230 reachable via ether2"
immediate_gw: ""
index: "2"
local_address: ""
pref_src: ""
routing_mark: "reserve"
routing_table: ""
scope: "30"
suppress_hw_offload: ""
target_scope: "10"
type: ""
vrf_interface: ""
- check_gateway: ""
comment: ""
distance: "1"
destination_address: "172.0.0.0"
destination_address_subnet: "8"
flags: "A S "
gateway: "1.2.3.4"
gateway_status: "1.2.3.4 recursive via 10.152.1.230 ether5"
immediate_gw: ""
index: "3"
local_address: ""
pref_src: ""
routing_mark: "Free_Wi-Fi"
routing_table: ""
scope: "30"
suppress_hw_offload: ""
target_scope: "10"
type: ""
vrf_interface: ""
- check_gateway: ""
comment: ""
distance: "100"
destination_address: "10.0.0.0"
destination_address_subnet: "8"
flags: "A SB"
gateway: ""
gateway_status: ""
immediate_gw: ""
index: "4"
local_address: ""
pref_src: ""
routing_mark: "Free_Wi-Fi"
routing_table: ""
scope: ""
suppress_hw_offload: ""
target_scope: ""
type: "blackhole"
vrf_interface: ""

0 comments on commit 5888b12

Please sign in to comment.