Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MikroTik RouterOS 'ip route print detail' template #1492

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ mikrotik_routeros_snmp_community_print_without-paging.textfsm, .*, mikrotik_rout
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
mikrotik_routeros_system_routerboard_print.textfsm, .*, mikrotik_routeros, [[/]]system routerboard print
mikrotik_routeros_ip_route_print_detail.textfsm, .*, mikrotik_routeros, [[/]]ip r[[oute]] p[[rint]] d[[etail]]
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]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Value NUMBER (\d+)
Value COMMENT (.*?)
Value ACTIVE (.)
Value DYNAMIC (.)
Value PROTOCOL (.)
Value DISCARD_PACKET (.)
Value Required NETWORK (\S+)
Value MASK (\d{1,2})
Value PREF_SRC (\S+)
Value GATEWAY (\S+)
Value GATEWAY_STATUS (.+?(?=[^\=]\S+\=))
Value CHECK_GATEWAY (\S+)
Value DISTANCE (\d+)
Value TYPE (\S+)

Start
^\s*Flags:\s+X\s+-\s+disabled,\s+A\s+-\s+active,\s+D\s+-\s+dynamic,\s+C\s+-\s+connect,\s+S\s+-\s+static,\s+r\s+-\s+rip,\s+b\s+-\s+bgp,\s+o\s+-\s+ospf,\s+m\s+-\s+mme,\s+B\s+-\s+blackhole,\s+U\s+-\s+unreachable,\s+P\s+-\s+prohibit\s*$$
^\s*${NUMBER}\s+${ACTIVE}${DYNAMIC}${PROTOCOL}${DISCARD_PACKET}\s+dst-address=${NETWORK}/${MASK}(?:\s+pref-src=${PREF_SRC})?(?:\s+gateway\=${GATEWAY})?(?:\s+gateway-status=${GATEWAY_STATUS})?.*?(?:\s+check-gateway=${CHECK_GATEWAY})?\s+distance=${DISTANCE}.*?(\s+ospf-type=${TYPE})?.*$$ -> Record
^\s*${NUMBER}\s+${ACTIVE}${DYNAMIC}${PROTOCOL}${DISCARD_PACKET}\s+;{3}\s*${COMMENT}\s*$$
^\s*dst-address=${NETWORK}/${MASK}(?:\s+pref-src=${PREF_SRC})?(?:\s+gateway\=${GATEWAY})?(?:\s+gateway-status=${GATEWAY_STATUS})?.*?(?:\s+check-gateway=${CHECK_GATEWAY})?\s+distance=${DISTANCE}.*?(\s+ospf-type=${TYPE})?.*$$ -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
0 ADS 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 dst-address=10.213.20.64/32 gateway=10.160.1.229 gateway-status=10.160.1.229 reachable via ether1 distance=1 scope=30 target-scope=10

3 A S ;;; to Internet
dst-address=0.0.0.0/0 gateway=10.160.1.230 gateway-status=10.160.1.230 reachable via ether2 distance=1 scope=30 target-scope=10 routing-mark=to-reserve

4 A S dst-address=0.0.0.0/0 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

5 A SB dst-address=10.0.0.0/8 type=blackhole distance=100 routing-mark=Free_Wi-Fi

6 A S dst-address=0.0.0.0/0 gateway=1.2.3.4 gateway-status=1.2.3.4 recursive via 10.152.1.230 ether5 check-gateway=ping distance=1 scope=30 target-scope=10
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
parsed_sample:
- active: "A"
check_gateway: ""
comment: ""
discard_packet: " "
distance: "2"
dynamic: "D"
gateway: "192.168.8.1"
gateway_status: "192.168.8.1 reachable via lte1"
mask: "0"
network: "0.0.0.0"
number: "0"
pref_src: ""
protocol: "S"
type: ""
- active: "A"
check_gateway: ""
comment: ""
discard_packet: " "
distance: "0"
dynamic: "D"
gateway: "ether1"
gateway_status: "ether1 reachable"
mask: "30"
network: "10.160.1.228"
number: "1"
pref_src: "10.160.1.230"
protocol: "C"
type: ""
- active: "A"
check_gateway: ""
comment: ""
discard_packet: " "
distance: "1"
dynamic: " "
gateway: "10.160.1.229"
gateway_status: "10.160.1.229 reachable via ether1"
mask: "32"
network: "10.213.20.64"
number: "2"
pref_src: ""
protocol: "S"
type: ""
- active: "A"
check_gateway: ""
comment: "to Internet"
discard_packet: " "
distance: "1"
dynamic: " "
gateway: "10.160.1.230"
gateway_status: "10.160.1.230 reachable via ether2"
mask: "0"
network: "0.0.0.0"
number: "3"
pref_src: ""
protocol: "S"
type: ""
- active: "A"
check_gateway: ""
comment: ""
discard_packet: " "
distance: "1"
dynamic: " "
gateway: "1.2.3.4"
gateway_status: "1.2.3.4 recursive via 10.152.1.230 ether5"
mask: "0"
network: "0.0.0.0"
number: "4"
pref_src: ""
protocol: "S"
type: ""
- active: "A"
check_gateway: ""
comment: ""
discard_packet: "B"
distance: "100"
dynamic: " "
gateway: ""
gateway_status: ""
mask: "8"
network: "10.0.0.0"
number: "5"
pref_src: ""
protocol: "S"
type: ""
- active: "A"
check_gateway: "ping"
comment: ""
discard_packet: " "
distance: "1"
dynamic: " "
gateway: "1.2.3.4"
gateway_status: "1.2.3.4 recursive via 10.152.1.230 ether5"
mask: "0"
network: "0.0.0.0"
number: "6"
pref_src: ""
protocol: "S"
type: ""
Loading