Skip to content

Commit

Permalink
Mirkotik: Fix issue with flags on IP route print and truncated long I…
Browse files Browse the repository at this point in the history
…Pv6 (networktocode#1152)

Fix flags on ip route print mikrotik
  • Loading branch information
elavaud authored and cppmonkey committed Oct 25, 2023
1 parent c1273c9 commit 26228db
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 55 deletions.
2 changes: 1 addition & 1 deletion ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ mikrotik_routeros_ip_dhcp-server_lease_print_without-paging.textfsm, .*, mikroti
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_snmp_community_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]snmp community print without-paging
mikrotik_routeros_ip_route_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? route print without-paging
mikrotik_routeros_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging
mikrotik_routeros_system_routerboard_print.textfsm, .*, mikrotik_routeros, [[/]]system routerboard print
mikrotik_routeros_ip_route_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? route print terse

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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Value Key index (\d+)
Value flags ([XADCSrbomBUP ]+)
Value dst_address ([\w.:/\d]+)
Value pref_src (\S+?)
Value gateway (\S+)
Value gateway_status (.+)
Value distance (\d+)
Value scope (\d+)
Value target_scope (\d+)

Start
^\s?${index}\s${flags}\s\sdst-address=${dst_address}(\spref-src=${pref_src})?\sgateway=${gateway}\sgateway-status=${gateway_status}\sdistance=${distance}\sscope=${scope}(\starget-scope=${target_scope})?.*$$ -> Record
^. -> Error

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
0 A S dst-address=0.0.0.0/0 gateway=23.90.232.243 gateway-status=23.90.232.243 reachable via pppoe-out1 distance=10 scope=30 target-scope=10
1 Db dst-address=0.0.0.0/0 gateway=23.90.232.243 gateway-status=23.90.232.243 reachable via pppoe-out1 distance=20 scope=40 target-scope=10 bgp-as-path=57809 bgp-local-pref=300 bgp-origin=incomplete received-from=23.90.232.243-peer
2 DS dst-address=0.0.0.0/0 gateway=pppoe-out1 gateway-status=pppoe-out1 reachable distance=100 scope=30 target-scope=10
3 ADC dst-address=23.90.232.243/32 pref-src=100.95.1.127 gateway=pppoe-out1 gateway-status=pppoe-out1 reachable distance=0 scope=10
4 ADC dst-address=185.163.212.156/30 pref-src=185.163.212.157 gateway=dmz-1-vlan gateway-status=dmz-1-vlan reachable distance=0 scope=10
5 ADC dst-address=192.168.1.0/24 pref-src=192.168.1.1 gateway=bridge-lan gateway-status=bridge-lan reachable distance=0 scope=10
6 A S dst-address=0.0.0.0/0 gateway=185.138.116.222,185.138.116.223 gateway-status=185.138.116.222 unreachable,185.138.116.223 reachable via pppoe-out1 distance=10 scope=30 target-scope=10
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
parsed_sample:
- index: "0"
flags: "A S"
dst_address: "0.0.0.0/0"
pref_src: ""
gateway: "23.90.232.243"
gateway_status: "23.90.232.243 reachable via pppoe-out1"
distance: "10"
scope: "30"
target_scope: "10"
- index: "1"
flags: " Db"
dst_address: "0.0.0.0/0"
pref_src: ""
gateway: "23.90.232.243"
gateway_status: "23.90.232.243 reachable via pppoe-out1"
distance: "20"
scope: "40"
target_scope: "10"
- index: "2"
flags: " DS"
dst_address: "0.0.0.0/0"
pref_src: ""
gateway: "pppoe-out1"
gateway_status: "pppoe-out1 reachable"
distance: "100"
scope: "30"
target_scope: "10"
- index: "3"
flags: "ADC"
dst_address: "23.90.232.243/32"
pref_src: "100.95.1.127"
gateway: "pppoe-out1"
gateway_status: "pppoe-out1 reachable"
distance: "0"
scope: "10"
target_scope: ""
- index: "4"
flags: "ADC"
dst_address: "185.163.212.156/30"
pref_src: "185.163.212.157"
gateway: "dmz-1-vlan"
gateway_status: "dmz-1-vlan reachable"
distance: "0"
scope: "10"
target_scope: ""
- index: "5"
flags: "ADC"
dst_address: "192.168.1.0/24"
pref_src: "192.168.1.1"
gateway: "bridge-lan"
gateway_status: "bridge-lan reachable"
distance: "0"
scope: "10"
target_scope: ""
- index: "6"
flags: "A S"
dst_address: "0.0.0.0/0"
pref_src: ""
gateway: "185.138.116.222,185.138.116.223"
gateway_status: "185.138.116.222 unreachable,185.138.116.223 reachable via pppoe-out1"
distance: "10"
scope: "30"
target_scope: "10"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0 ADS dst-address=::/0 gateway=pppoe-out1 gateway-status=pppoe-out1 reachable distance=100 scope=30 target-scope=10
1 ADC dst-address=2a05:c100:7::/64 gateway=bridge-lan gateway-status=bridge-lan reachable distance=0 scope=10
2 S dst-address=9bb8:baac:d400::/38 gateway=ether4 gateway-status=ether4 unreachable distance=44 scope=30 target-scope=10
3 X S dst-address=ec64:a7fd:bc1c:14c:7960:5000::/84 gateway=ether2 gateway-status=ether2 inactive distance=7 scope=30 target-scope=10
4 S dst-address=fd79:f1d4:a400::/39 gateway=ether5 gateway-status=ether5 unreachable distance=24 scope=30 target-scope=10
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
parsed_sample:
- index: "0"
flags: "ADS"
dst_address: "::/0"
pref_src: ""
gateway: "pppoe-out1"
gateway_status: "pppoe-out1 reachable"
distance: "100"
scope: "30"
target_scope: "10"
- index: "1"
flags: "ADC"
dst_address: "2a05:c100:7::/64"
pref_src: ""
gateway: "bridge-lan"
gateway_status: "bridge-lan reachable"
distance: "0"
scope: "10"
target_scope: ""
- index: "2"
flags: " S"
dst_address: "9bb8:baac:d400::/38"
pref_src: ""
gateway: "ether4"
gateway_status: "ether4 unreachable"
distance: "44"
scope: "30"
target_scope: "10"
- index: "3"
flags: "X S"
dst_address: "ec64:a7fd:bc1c:14c:7960:5000::/84"
pref_src: ""
gateway: "ether2"
gateway_status: "ether2 inactive"
distance: "7"
scope: "30"
target_scope: "10"
- index: "4"
flags: " S"
dst_address: "fd79:f1d4:a400::/39"
pref_src: ""
gateway: "ether5"
gateway_status: "ether5 unreachable"
distance: "24"
scope: "30"
target_scope: "10"

This file was deleted.

This file was deleted.

0 comments on commit 26228db

Please sign in to comment.