Skip to content

Commit

Permalink
Add: Mikrotik interface vlan print detail (#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwood92 authored Oct 15, 2024
1 parent 333cdad commit 76f41e2
Show file tree
Hide file tree
Showing 8 changed files with 215 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 @@ -736,6 +736,7 @@ mikrotik_routeros_ipv6_neighbor_print_without-paging.textfsm, .*, mikrotik_route
mikrotik_routeros_ip_arp_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip a[[rp]] p[[rint]] t[[erse]] wi[[thout-paging]]
mikrotik_routeros_log_print_detail_without-paging.textfsm, .*, mikrotik_routeros, [[/]]log p[[rint]] d[[etail]] wi[[thout-paging]]
mikrotik_routeros_routing_bgp_peer_print_status.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] bg[[p]] p[[eer]] p[[rint]] s[[tatus]]
mikrotik_routeros_interface_vlan_print_detail.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] vlan p[[rint]] d[[etail]]
mikrotik_routeros_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging
mikrotik_routeros_routing_ospf_neighbor_print.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] o[[spf]] nei[[ghbor]] p[[rint]]
mikrotik_routeros_ip_dhcp-server_lease_print.textfsm, .*, mikrotik_routeros, [[/]]ip dh[[cp-server]] l[[ease]] p[[rint]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Value Required ID (\d+)
Value NAME (\S+)
Value PARENT_INTERFACE (\S+)
Value List DESCRIPTION (.+?)
Value STATUS (X|R)
Value VLAN_ID (\d+)
Value SERVICE_TAG (yes|no)

Start
^\s*Flags:\s*X\s*-\s*disabled,\s*R\s*-\s*running\s*$$ -> Vlan
^\s*$$
^. -> Error

Vlan
^\s*(?:\d+)?\s*(?:X|R)?\s*$$ -> Continue.Record
^\s*name="${NAME}"\s*mtu=(?:\d+)\s*l2mtu=(?:\d+)\s*mac-address=(?:[a-zA-Z0-9]{2}(?::[a-zA-Z0-9]{2}){5})\s*arp=(?:\S+)\s*arp-timeout=(?:\S+)\s*loop-protect=(?:\S+)\s*loop-protect-status=(?:\S+)\s*loop-protect-send-interval=(?:\d+\w)\s*loop-protect-disable-time=(?:\d+\w)\s*vlan-id=${VLAN_ID}\s*interface=${PARENT_INTERFACE}\s*use-service-tag=${SERVICE_TAG}\s*$$
^\s*${ID}\s*${STATUS}\s*name="${NAME}"\s*mtu=(?:\d+)\s*l2mtu=(?:\d+)\s*mac-address=(?:[a-zA-Z0-9]{2}(?::[a-zA-Z0-9]{2}){5})\s*arp=(?:\S+)\s*arp-timeout=(?:\S+)\s*loop-protect=(?:\S+)\s*loop-protect-status=(?:\S+)\s*loop-protect-send-interval=(?:\d+\w)\s*loop-protect-disable-time=(?:\d+\w)\s*vlan-id=${VLAN_ID}\s*interface=${PARENT_INTERFACE}\s*use-service-tag=${SERVICE_TAG}\s*$$
^\s*${ID}\s*${STATUS}\s*;{3}\s*${DESCRIPTION}\s*$$
^\s*${DESCRIPTION}\s*$$
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Flags: X - disabled, R - running
0 R ;;; MGMT
name="vlan1@bond1" mtu=1574 l2mtu=9212 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=1 interface=bond1 use-service-tag=no

1 R ;;; INET
name="vlan2@bond1" mtu=1574 l2mtu=9212 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=2 interface=bond1 use-service-tag=no

2 R ;;; MGMT
name="vlan10@vlan975@sfp-sfpplus1" mtu=1574 l2mtu=9208 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=10 interface=vlan975@sfp-sfpplus1 use-service-tag=no

3 R ;;; INET
name="vlan11@vlan975@sfp-sfpplus1" mtu=1500 l2mtu=9208 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=11 interface=vlan975@sfp-sfpplus1 use-service-tag=no

4 R ;;; INET
name="vlan12@vlan975@sfp-sfpplus1" mtu=1500 l2mtu=9208 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=12 interface=vlan975@sfp-sfpplus1 use-service-tag=no

5 R ;;; INET
name="vlan111@sfp-sfpplus1" mtu=1500 l2mtu=9212 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=111 interface=sfp-sfpplus1 use-service-tag=no

6 R ;;; Intercap
name="vlan975@sfp-sfpplus1" mtu=1500 l2mtu=9212 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=975 interface=sfp-sfpplus1 use-service-tag=no

7 R name="vlan4050@sfp-sfpplus11" mtu=9212 l2mtu=9212 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=4050 interface=sfp-sfpplus11 use-service-tag=no
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
parsed_sample:
- description:
- "MGMT"
id: "0"
name: "vlan1@bond1"
parent_interface: "bond1"
service_tag: "no"
status: "R"
vlan_id: "1"
- description:
- "INET"
id: "1"
name: "vlan2@bond1"
parent_interface: "bond1"
service_tag: "no"
status: "R"
vlan_id: "2"
- description:
- "MGMT"
id: "2"
name: "vlan10@vlan975@sfp-sfpplus1"
parent_interface: "vlan975@sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "10"
- description:
- "INET"
id: "3"
name: "vlan11@vlan975@sfp-sfpplus1"
parent_interface: "vlan975@sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "11"
- description:
- "INET"
id: "4"
name: "vlan12@vlan975@sfp-sfpplus1"
parent_interface: "vlan975@sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "12"
- description:
- "INET"
id: "5"
name: "vlan111@sfp-sfpplus1"
parent_interface: "sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "111"
- description:
- "Intercap"
id: "6"
name: "vlan975@sfp-sfpplus1"
parent_interface: "sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "975"
- description: []
id: "7"
name: "vlan4050@sfp-sfpplus11"
parent_interface: "sfp-sfpplus11"
service_tag: "no"
status: "R"
vlan_id: "4050"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Flags: X - disabled, R - running
0 R ;;; CUST
name="vlan1@vlan602@interface" mtu=1574 l2mtu=8992 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=1 interface=vlan602@interface use-service-tag=no

1 R ;;; PPPoE Termination on BNGs
name="vlan6@bond1" mtu=1508 l2mtu=8996 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=6 interface=bond1 use-service-tag=no

2 R ;;; Cust
name="vlan10@vlan975@interface" mtu=1574 l2mtu=8992 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=10 interface=vlan975@interface use-service-tag=no

3 R ;;; test pppoe
name="vlan11@bond1" mtu=1500 l2mtu=8996 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=11 interface=bond1 use-service-tag=no

4 R ;;; Intercap
name="vlan11@vlan975@interface" mtu=1574 l2mtu=8992 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=11 interface=vlan975@interface use-service-tag=no

5 R ;;; Intercap
name="vlan12@vlan975@interface" mtu=1574 l2mtu=8992 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=12 interface=vlan975@interface use-service-tag=no

6 R ;;; Carrier
name="vlan60@interface" mtu=1600 l2mtu=8996 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=60 interface=sfp-sfpplus1 use-service-tag=no

7 R ;;; Carrier
name="vlan60@bond1" mtu=1600 l2mtu=8996 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=60 interface=bond1 use-service-tag=no
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
parsed_sample:
- description:
- "CUST"
id: "0"
name: "vlan1@vlan602@interface"
parent_interface: "vlan602@interface"
service_tag: "no"
status: "R"
vlan_id: "1"
- description:
- "PPPoE Termination on BNGs"
id: "1"
name: "vlan6@bond1"
parent_interface: "bond1"
service_tag: "no"
status: "R"
vlan_id: "6"
- description:
- "Cust"
id: "2"
name: "vlan10@vlan975@interface"
parent_interface: "vlan975@interface"
service_tag: "no"
status: "R"
vlan_id: "10"
- description:
- "test pppoe"
id: "3"
name: "vlan11@bond1"
parent_interface: "bond1"
service_tag: "no"
status: "R"
vlan_id: "11"
- description:
- "Intercap"
id: "4"
name: "vlan11@vlan975@interface"
parent_interface: "vlan975@interface"
service_tag: "no"
status: "R"
vlan_id: "11"
- description:
- "Intercap"
id: "5"
name: "vlan12@vlan975@interface"
parent_interface: "vlan975@interface"
service_tag: "no"
status: "R"
vlan_id: "12"
- description:
- "Carrier"
id: "6"
name: "vlan60@interface"
parent_interface: "sfp-sfpplus1"
service_tag: "no"
status: "R"
vlan_id: "60"
- description:
- "Carrier"
id: "7"
name: "vlan60@bond1"
parent_interface: "bond1"
service_tag: "no"
status: "R"
vlan_id: "60"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Flags: X - disabled, R - running
0 R ;;; CUST
who has a multiline comment
name="vlan1@vlan602@interface" mtu=1574 l2mtu=8992 mac-address=AA:BB:CC:11:22:33 arp=enabled arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s loop-protect-disable-time=5m vlan-id=1 interface=vlan602@interface use-service-tag=no
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
parsed_sample:
- description:
- "CUST"
- "who has a multiline comment"
id: "0"
name: "vlan1@vlan602@interface"
parent_interface: "vlan602@interface"
service_tag: "no"
status: "R"
vlan_id: "1"

0 comments on commit 76f41e2

Please sign in to comment.