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 add management of entry without flags in ip-firewall-address-list template #41

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0f021ac
Mikrotik routeros - ip firewall address-list print terse
Jun 14, 2022
b4ee8c8
Zyxel fix sys atsh parsing
Jun 8, 2022
dfb1308
Fix Mikrotik interface ethernet monitor name once when no link partne…
Jun 6, 2022
21ec837
Fix huawei display acl all - port numbers replaced by names
Nov 14, 2022
84eafca
Fix Huawei - display acl (ipv6)? all - if name provided, order in IPv…
Nov 15, 2022
b6b2d0b
Huawei - display acl all - add rule description
Nov 16, 2022
c664960
Huawei - display acl all - separately record ACLs and their rules
Dec 14, 2022
07f498c
Corrected Mikrotik routeros ip route template to manage dynamic route…
k-ribot Dec 5, 2022
c82bf75
Fix Cisco show interfaces speed and duplex
guillaume-mbali Dec 19, 2022
4fc9395
feat(ubiquiti): Add template ubiquiti edgerouter show interfaces
guillaume-mbali Jan 2, 2023
085c6d7
Ubiquiti - add show ip route template (#1275)
guillaume-mbali Jan 20, 2023
09ec1d4
Ubiquiti: Add show ipv6 route template (#1274)
guillaume-mbali Jan 18, 2023
5d6a366
Corrected nexthop_ip regex in ubiquiti ipv6 route template (#1294)
guillaume-mbali Feb 3, 2023
1f3a0cf
Cisco add template ipv6 access-lists
guillaume-mbali Jan 26, 2023
e06f764
Fix Ubiquiti: change the template to allow multiple routes with the s…
guillaume-mbali Feb 7, 2023
383deac
Corrected Huawei display_interface template to add Tunnel and Virtuel…
k-ribot Feb 20, 2023
577b668
Preparing internal release v3.2.0-unyc.1
guillaume-mbali Mar 2, 2023
b6f7341
MikroTik RouterOS add hw-offload management in ip firewall template
k-ribot Mar 10, 2023
d060903
Preparing internal release v3.2.0-unyc.2
k-ribot Mar 14, 2023
80740e2
fix: CI with + character in unyc versions
Mar 21, 2023
6c75678
MikroTik RouterOs add management of entry without flags in ip-firewal…
k-ribot Mar 16, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} | tr '+' '.' >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} | tr '+' '.' >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Get image version"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} >> $GITHUB_ENV"
run: "echo IMAGE_VER=`poetry version -s`-py${{ matrix.python-version }} | tr '+' '.' >> $GITHUB_ENV"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
Expand Down
4 changes: 3 additions & 1 deletion ntc_templates/templates/cisco_ios_show_interfaces.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Value IP_ADDRESS (\d+\.\d+\.\d+\.\d+\/\d+)
Value MTU (\d+)
Value DUPLEX (([Ff]ull|[Aa]uto|[Hh]alf|[Aa]-).*?)
Value SPEED (.*?)
Value MEDIA_TYPE (\S+(\s+\S+)?)
Value MEDIA_TYPE (\S+[\s\S]*)
Value BANDWIDTH (\d+\s+\w+)
Value DELAY (\d+\s+\S+)
Value ENCAPSULATION (.+?)
Expand Down Expand Up @@ -43,6 +43,8 @@ Start
^\s+Last\s+input\s+${LAST_INPUT},\s+output\s+${LAST_OUTPUT},\s+output\s+hang\s+${LAST_OUTPUT_HANG}\s*$$
^\s+Queueing\s+strategy:\s+${QUEUE_STRATEGY}\s*$$
^\s+${DUPLEX},\s+${SPEED},.+media\stype\sis\s${MEDIA_TYPE}$$
^\s+${DUPLEX},\s+${SPEED},.+TX/FX$$
^\s+${DUPLEX},\s+${SPEED}$$
^.*input\s+rate\s+${INPUT_RATE}.+$$
^.*output\s+rate\s+${OUTPUT_RATE}.+$$
^\s+${INPUT_PACKETS}\s+packets\s+input,\s+\d+\s+bytes,\s+\d+\s+no\s+buffer\s*$$
Expand Down
21 changes: 21 additions & 0 deletions ntc_templates/templates/cisco_ios_show_ipv6_access-lists.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Value Required,Filldown ACL_NAME (\S+)
Value ACTION (permit|deny)
Value PROTOCOL (\S+)
Value IPV6_SOURCE ([A-Za-z0-9:]+(\/(?:\d{1,3})|))
Value IPV6_DESTINATION ([A-Za-z0-9:]+(\/(?:\d{1,3})|))
Value SRC_PORT_MATCH (eq|neq|precedence|range|tos|lt|gt|established)
Value SEQUENCE (\d+)
Value PORT_NUMBER (\d+)
Value LOG (log)
Value AUTHENTIFICATION (auth)
Value ROUTING (routing)
Value SRC_PORT_RANGE_START (\S+)
Value SRC_PORT_RANGE_END (\S+)


Start
^IPv6\s+access\s+list\s+${ACL_NAME}\s* -> Continue
^\s+${ACTION}\s+${PROTOCOL}\s+${IPV6_SOURCE}\s+${IPV6_DESTINATION}\s+(${SRC_PORT_MATCH}\s|)sequence\s${SEQUENCE}\s*$$ -> Record
^\s+${ACTION}\s+${PROTOCOL}\s+(host\s+|)${IPV6_SOURCE}\s+(host\s+|)(${IPV6_DESTINATION}\s+|)(${SRC_PORT_MATCH}\s|range\s${SRC_PORT_RANGE_START}\s${SRC_PORT_RANGE_END}\s|)(${LOG}\s+|)(${AUTHENTIFICATION}\s+|)(${ROUTING}\s+|)(${PORT_NUMBER}\s+|)sequence\s${SEQUENCE}\s*$$ -> Record

EOF
18 changes: 12 additions & 6 deletions ntc_templates/templates/huawei_vrp_display_acl_all.textfsm
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
Value Filldown ACL_NAME (.*?)
Value Filldown ACL_NUMBER (\d+)
Value Required SN (\d+)
Value Filldown,Required ACL_NUMBER (\d+)
Value SN (\d+)
Value ACTION (deny|permit)
Value PROTOCOL (\d+|icmp(v6)?|tcp|udp|gre|igmp|ip(v6)?|ipinip|ospf)
Value SOURCE (((\d+.){3}\d+|[0-9a-fA-F]{1,4}([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4})[\/\s]((\d+.){3}\d+|\d+))
Value SOURCE_PORT_MODIFIER (eq|lt|gt|range)
Value SOURCE_PORT_RANGE ((\d+)(\s(\d+))?)
Value SOURCE_PORT_RANGE ((\S+)(\s(\S+))?)
Value DESTINATION (((\d+.){3}\d+|[0-9a-fA-F]{1,4}([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4})[\/\s]((\d+.){3}\d+|\d+))
Value DESTINATION_PORT_MODIFIER (eq|lt|gt|range)
Value DESTINATION_PORT_RANGE ((\d+)(\s(\d+))?)
Value DESTINATION_PORT_RANGE ((\S+)(\s(\S+))?)
Value MATCHES (\d+)
Value DESCRIPTION (.*)

Start
^\s*rule\s\d+\s(deny|permit) -> Continue.Record
^\S+\sIPv6\sACL\s -> Continue.Record
^\S+\sACL\s -> Continue.Record
^\s*Total\squantity\sof\snonempty\sACL\snumber\sis\s\d+\s*$$
^\s*Total\snonempty\sacl6\snumber\sis\s\d+\s*$$
^\S+(\sIPv6)?\sACL\s(${ACL_NAME}\s)?${ACL_NUMBER},\s\d+.*$$
^\S+\sIPv6\sACL\s${ACL_NUMBER}(\sname\s${ACL_NAME})?,\s\d+\srules?.*$$
^\S+\sACL\s(${ACL_NAME}\s)?${ACL_NUMBER},\s\d+\srules?.*$$
^\s*Acl's\sstep\sis\s\d+\s*$$
^\s*rule\s${SN}\s${ACTION}(\s${PROTOCOL})?(\ssource\s${SOURCE})?(\ssource-port\s${SOURCE_PORT_MODIFIER}\s${SOURCE_PORT_RANGE})?(\sdestination\s${DESTINATION})?(\sdestination-port\s${DESTINATION_PORT_MODIFIER}\s${DESTINATION_PORT_RANGE})?(\s\(${MATCHES}\smatch(es)?\))?\s*$$ -> Record
^\s*rule\s${SN}\s${ACTION}(\s${PROTOCOL})?(\ssource\s${SOURCE})?(\ssource-port\s${SOURCE_PORT_MODIFIER}\s${SOURCE_PORT_RANGE})?(\sdestination\s${DESTINATION})?(\sdestination-port\s${DESTINATION_PORT_MODIFIER}\s${DESTINATION_PORT_RANGE})?(\s\(${MATCHES}\smatch(es)?\))?\s*$$
^\s*rule\s\d+\sdescription\s"${DESCRIPTION}"\s*$$
^\s*$$
^. -> Error
16 changes: 10 additions & 6 deletions ntc_templates/templates/huawei_vrp_display_interface.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ Start
^Internet\s+Address\s+is\s+${INTERNET_ADDRESS}\s*$$
^.*,\s+Hardware\s+address\s+is\s+${HARDWARE_ADDRESS}\s*$$
^Internet\s+protocol\s+processing\s+:\s+${INTERNET_PROTOCOL}\s*$$
^Encapsulation\sis\s.+\s*$$
^Tunnel\ssource\s\S+\s\(.+\),\sdestination\s\S+\s*$$
^Tunnel\sprotocol\/transport\sGRE\/IP,\skey\s.+\s*$$
^keepalive\s\S+\s*$$
^Checksumming\sof\spackets\s\S+\s*$$
^Last\s+physical\s+up\s+time\s*:\s+${LAST_PHYSICAL_UP_TIME}\s*
^Last\s+physical\s+down\s+time\s+:\s+${LAST_PHYSICAL_DOWN_TIME}\s*
^IP\sSending\sFrames'\sFormat\sis\s\S+\s*,\sHardware\saddress\sis\s\S+\s*$$
^Current\s+system\s+time:\s+${CURRENT_SYSTEM_TIME}\s*
^Modem\sState:\s+\S+\s*$$
^Model\s=\s+\S+\s*$$
^Current\sNetwork\sConnection\s=\sLTE\(LTE\)\s*$$
^Current\sNetwork\sConnection\s=\sUnknown\s*$$
^Modem\sState:\s+.+\s*$$
^Model\s=\s+.+\s*$$
^Current\sNetwork\sConnection\s=\s.+\s*$$
^Current\sRSSI\s<?=\s+(-)?\d+\sdBm.*$$
^Current\sSINR\s=\s+(-)?\d+\sdB\s\(weak\)\s*$$
^Current\sSINR\s([<>])?=\s+(-)?\d+\sdB\s\(.+\)\s*$$
^\s+Input\sbandwidth\sutilization(\sthreshold)?\s*:.*$$
^\s+Output\sbandwidth\sutilization(\sthreshold)?\s*:.*$$
^Port\s+Mode:\s+${PORT_MODE}\s*$$
Expand All @@ -50,7 +54,7 @@ Start
^LCP\sinitial\s*$$
^Physical\sis.*$$
^Bound\sto.*$$
^\s*LCP\s\S+,\s+IPCP\s\S+,\s+IP6CP\s\S+\s*$$
^\s*LCP\s\S+,\s+IPCP\s\S+(,\s+IP6CP\s\S+)?\s*$$
^Packets\sstatistics:\s*$$
^\s+(Input|Output)\spackets\s*:\s*\d+,\s+\d+\sbytes\s*$$
^\s+FCS\serror\spackets:\s*\d+\s*$$
Expand Down
5 changes: 5 additions & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ cisco_ios_show_interfaces_status.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]]
cisco_ios_show_ip_eigrp_topology.textfsm, .*, cisco_ios, sh[[ow]] ip eigrp top[[ology]]
cisco_ios_show_ip_source_binding.textfsm, .*, cisco_ios, sh[[ow]] ip sou[[rce]] b[[inding]]
cisco_ios_show_ip_vrf_interfaces.textfsm, .*, cisco_ios, sh[[ow]] ip vr[[f]] in[[terfaces]]
cisco_ios_show_ipv6_access-lists.textfsm, .*, cisco_ios, sh[[ow]] ipv6 acce[[ss-lists]]
cisco_ios_show_mac-address-table.textfsm, .*, cisco_ios, sh[[ow]] mac[[-address-table]]
cisco_ios_show_ip_bgp_neighbors.textfsm, .*, cisco_ios, sh[[ow]] ip bgp nei[[ghbors]]
cisco_ios_show_ip_ospf_database.textfsm, .*, cisco_ios, sh[[ow]] ip ospf data[[base]]
Expand Down Expand Up @@ -526,6 +527,7 @@ mikrotik_routeros_ip_firewall_filter_print_all_without-paging.textfsm, .*, mikro
mikrotik_routeros_ip_dhcp-server_lease_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip dhcp-server lease print without-paging
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_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? firewall address-list print terse
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_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging
Expand Down Expand Up @@ -558,6 +560,9 @@ ubiquiti_edgerouter_show_interfaces_ethernet_physical.textfsm, .*, ubiquiti_edge
ubiquiti_edgerouter_show_dhcpv6_server_leases.textfsm, .*, ubiquiti_edgerouter, sh[[ow]] dhcpv6 server leases
ubiquiti_edgerouter_show_ipv6_neighbors.textfsm, .*, ubiquiti_edgerouter, sh[[ow]] ipv6 neighbors
ubiquiti_edgerouter_show_dhcp_leases.textfsm, .*, ubiquiti_edgerouter, sh[[ow]] dhcp leases
ubiquiti_edgerouter_show_interfaces.textfsm, .*, ubiquiti_edgerouter, show interfaces
ubiquiti_edgerouter_show_ipv6_route.textfsm, .*, ubiquiti_edgerouter, show ipv6 route
ubiquiti_edgerouter_show_ip_route.textfsm, .*, ubiquiti_edgerouter, show ip route
ubiquiti_edgerouter_show_version.textfsm, .*, ubiquiti_edgerouter, sh[[ow]] ve[[rsion]]
ubiquiti_edgerouter_show_arp.textfsm, .*, ubiquiti_edgerouter, sh[[ow]] arp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Start
^\s*tx-flow-control:\s${tx_flow_control}
^\s*rx-flow-control:\s${rx_flow_control}
^\s*advertising:\s${advertising}
^\s*link-partner-advertising:\s${link_partner_advertising}
^\s*link-partner-advertising:\s*(${link_partner_advertising})?
^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$ -> Next
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Value Key INDEX (\d+)
Value FLAGS ([XD])
Value LIST (\S+)
Value ADDRESS (\S+)
Value CREATION_TIME (\S+\s\S+)
Value TIMEOUT (\S+)
Value DYNAMIC (yes|no)

Start
^\s*${INDEX}\s+(${FLAGS}\s)?list=${LIST}\saddress=${ADDRESS}(\screation-time=${CREATION_TIME})?(\stimeout=${TIMEOUT})?(\sdynamic=${DYNAMIC})?.*$$ -> Record
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Value flags ([XID]+)
Value comment (\S+[\S ]*\S)
Value chain (input|forward|output)
Value action (accept|add-dst-to-address-list|add-src-to-address-list|drop|fasttrack-connection|jump|log|passthrough|reject|return|tarpit)
Value hw_offload (yes|no)
Value connection_state (\S+)
Value connection_nat_state (\S+)
Value protocol (!?(dccp|egp|etherip|gre|icmp|idpr-cmtp|ipencap|ipsec-ah|ipv6-encap|ipv6-nonxt|ipv6-route|l2tp|pim|rdp|rsvp|st|udp|vmtp|xns-idp|ddp|encap|ggp|hmp|icmpv6|igmp|ipip|ipsec-esp|ipv6-frag|ipv6-opts|iso-tp4|ospf|pup|rspf|sctp|tcp|udp-lite|vrrp|xtp))
Expand All @@ -26,7 +27,7 @@ Start

FirewallTable
^\s?${index}\s+(${flags})?\s+;;;\s${comment}
^\s+chain=${chain}(\saction=${action})?(\sconnection-state=${connection_state})?(\sconnection-nat-state=${connection_nat_state})?\s*(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface-list=${in_interface_list})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\ssrc-mac-address=${src_mac_address})?(\sin-interface=${in_interface})?(\sout-interface=${out_interface})?(\sipsec-policy=${ipsec_policy})?(\slog=${log})?(\slog-prefix="${log_prefix}")?\s*$$ -> Record
^\s?${index}\s+(${flags})?\s+chain=${chain}(\saction=${action})?(\sconnection-state=${connection_state})?(\sconnection-nat-state=${connection_nat_state})?(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface-list=${in_interface_list})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\ssrc-mac-address=${src_mac_address})?(\sin-interface=${in_interface})?(\sout-interface=${out_interface})?(\sipsec-policy=${ipsec_policy})?(\slog=${log})?(\slog-prefix="${log_prefix}")?\s*$$ -> Record
^\s+chain=${chain}(\saction=${action})?(\shw-offload=${hw_offload})?(\sconnection-state=${connection_state})?(\sconnection-nat-state=${connection_nat_state})?\s*(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface-list=${in_interface_list})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\ssrc-mac-address=${src_mac_address})?(\sin-interface=${in_interface})?(\sout-interface=${out_interface})?(\sipsec-policy=${ipsec_policy})?(\slog=${log})?(\slog-prefix="${log_prefix}")?\s*$$ -> Record
^\s?${index}\s+(${flags})?\s+chain=${chain}(\saction=${action})?(\shw-offload=${hw_offload})?(\sconnection-state=${connection_state})?(\sconnection-nat-state=${connection_nat_state})?(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface-list=${in_interface_list})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\ssrc-mac-address=${src_mac_address})?(\sin-interface=${in_interface})?(\sout-interface=${out_interface})?(\sipsec-policy=${ipsec_policy})?(\slog=${log})?(\slog-prefix="${log_prefix}")?\s*$$ -> Record
^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$ -> Next
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Value Key index (\d+)
Value flags ([XADCSrbomBUP ]+)
Value comment (.*)
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+)
Value INDEX (\d+)
Value FLAGS ([XADCSrbvomcBUP\s]+(?<!\s))
Value COMMENT (.*)
Value DST_ADDRESS ([\w.:/\d]+)
Value ROUTING_TABLE (\S+)
Value PREF_SRC (\S*)
Value GATEWAY (\S+)
Value GATEWAY_STATUS (.+)
Value IMMEDIATE_GW (\S+)
Value DISTANCE (\d+)
Value SCOPE (\d+)
Value TARGET_SCOPE (\d+)
Value SUPPRESS_HW_OFFLOAD (\S+)
Value LOCAL_ADDRESS (\S+)

Start
^\s?${index}\s${flags}\s\s(comment=${comment}\s)?dst-address=${dst_address}(\spref-src=${pref_src})?\sgateway=${gateway}\sgateway-status=${gateway_status}\sdistance=${distance}\sscope=${scope}(\starget-scope=${target_scope})?.*$$ -> Record
^(\s?${INDEX}\s*)?${FLAGS}\s+(comment=${COMMENT}\s)?dst-address=${DST_ADDRESS}(\srouting-table=${ROUTING_TABLE})?(\spref-src=${PREF_SRC})?\sgateway=${GATEWAY}(\sgateway-status=${GATEWAY_STATUS})?(\simmediate-gw=${IMMEDIATE_GW})?\sdistance=${DISTANCE}\sscope=${SCOPE}(\starget-scope=${TARGET_SCOPE})?(\ssuppress-hw-offload=${SUPPRESS_HW_OFFLOAD})?(\slocal-address=${LOCAL_ADDRESS})?.*$$ -> Record
^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$ -> Next
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Value Required INTERFACE (\w+)
Value List IP (\S+)
Value STATE (\w)
Value LINK_STATUS (\w)
Value DESCRIPTION ([\w\d\-\s]+)

Start
^[-\s]+ -> Interfaces

Interfaces
^(\w+) -> Continue.Record
^${INTERFACE}\s+${IP}\s+(${STATE}/${LINK_STATUS})(\s+${DESCRIPTION})?
^\s+${IP}
^. -> Error
20 changes: 20 additions & 0 deletions ntc_templates/templates/ubiquiti_edgerouter_show_ip_route.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Value Filldown,Required CODE (\w{1,2})
Value Filldown IP (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})
Value Filldown CIDR (\d{1,2})
Value DISTANCE (\d+)
Value METRIC (\d+)
Value NEXTHOP_IP (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})
Value INTERFACE (\w+)

Start
^.*IP\sRoute\sTable -> IP

IP
^\s+\*>\s+\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}\s\(recursive is directly connected,\s${INTERFACE}\)\s* -> Record
^${CODE}\s+\*>\s${IP}/${CIDR}\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+\*>\s${IP}/${CIDR}\sis\sdirectly\sconnected\s* -> Record
^${CODE}\s+\*>\s${IP}/${CIDR}\s\[${DISTANCE}/${METRIC}\]\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+\*>\s${IP}/${CIDR}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}\s\(recursive is directly connected,\s${INTERFACE}\)\s* -> Record
^. -> Error

EOF
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Value CODE (\w{1,2})
Value IP ([A-Za-z0-9:]+)
Value PREFIX_LENGTH (\d{1,3})
Value DISTANCE (\d+)
Value METRIC (\d+)
Value NEXTHOP_IP ([\w:]+)
Value INTERFACE (\w+)
Value UPTIME (\d[\w:\.]+)

Start
^.*IP\sRoute\sTable -> IP

IP
^${CODE}\s+${IP}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP},\s${INTERFACE},\s${UPTIME}\s* -> Record
^${CODE}\s+${IP}/${PREFIX_LENGTH}\svia\s${NEXTHOP_IP},\s${INTERFACE},\s${UPTIME}\s* -> Record
^\s*$$
^. -> Error
4 changes: 2 additions & 2 deletions ntc_templates/templates/zyxel_os_sys_atsh.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Start
^Romfile\sChecksum\s*:.+
^Main\sFeature\sBits\s*:.+
^Other\sFeature\sBits\s*:.*
^[0-9a-f]{8}:\s[0-9a-f]{8}\s[0-9a-f]{8}\s[0-9a-f]{8}\s[0-9a-f]{8}
^[0-9a-f]{8}:\s[0-9a-f]{8}\s[0-9a-f]{8}\s[0-9a-f]{8}\s[0-9a-f]{4}
^[0-9a-f]{1,8}:\s[0-9a-f]{1,8}\s[0-9a-f]{1,8}\s[0-9a-f]{1,8}\s[0-9a-f]{1,8}
^[0-9a-f]{1,8}:\s[0-9a-f]{1,8}\s[0-9a-f]{1,8}\s[0-9a-f]{1,8}(\s[0-9a-f]{1,8})?
^. -> Error
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ntc_templates"
version = "3.2.0"
version = "3.2.0+unyc.2"
description = "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable."
authors = ["Network to Code <[email protected]>"]
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ parsed_sample:
description: "connection to Provider"
ip_address: ""
mtu: "1500"
duplex: ""
speed: ""
duplex: "Full-duplex"
speed: "100Mb/s"
media_type: ""
bandwidth: "10000 Kbit"
delay: "100 usec"
Expand Down Expand Up @@ -249,8 +249,8 @@ parsed_sample:
description: "NOT IN USE"
ip_address: ""
mtu: "1500"
duplex: ""
speed: ""
duplex: "Auto-duplex"
speed: "Auto Speed"
media_type: ""
bandwidth: "100000 Kbit"
delay: "100 usec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ parsed_sample:
description: ""
ip_address: ""
mtu: "1500"
duplex: ""
speed: ""
duplex: "Half-duplex"
speed: "10Mb/s"
media_type: ""
bandwidth: "10000 Kbit"
delay: "1000 usec"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
IPv6 access list ACL2_IPv6
deny ipv6 2A01:728::/29 any sequence 10
IPv6 access list ACL3_IPv6
permit tcp 2A01:720::/29 any log auth routing sequence 10
IPv6 access list ACL_IPv6
deny ipv6 2A01:728::/29 any sequence 10
IPv6 access list WAN_LOCAL
permit tcp AAAA:BBBB::/64 2A05:C100:53::/64 eq 6543 sequence 11
permit udp AAAA:BBBB::/64 2A05:C100:53::/64 eq 6543 sequence 12
deny udp host 2A05:C100:53::17 host 2A05:C100:53::145 eq 45 sequence 14
deny tcp host 2A05:C100:53::14 host 2A05:C100:53::17 range 46 48 sequence 15
permit tcp any any established sequence 9996
permit icmp any any sequence 9997
permit udp any any sequence 9998
deny ipv6 any any sequence 9999
IPv6 access list WAN_ROUTEUR
permit ipv6 2A05:C100:53::/64 any sequence 10
permit ipv6 2A05:C100:53:1::/64 any sequence 20
permit ipv6 2A05:C100::/48 any sequence 30
permit ipv6 2A00:41E0::/48 any sequence 40
permit ipv6 2A05:C100:43::/64 any sequence 45
deny ipv6 any any sequence 50
permit tcp any any established sequence 9996
Loading