Skip to content

Commit

Permalink
Ubiquiti: Add show ipv6 route template (networktocode#1274)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-mbali authored and sjhloco committed Feb 2, 2023
1 parent d2ac6de commit 8314a38
Show file tree
Hide file tree
Showing 4 changed files with 83 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 @@ -571,6 +571,7 @@ 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_ipv6_route.textfsm, .*, ubiquiti_edgerouter, show ipv6 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
@@ -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 ([A-F0-9:]+)
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
IPv6 Routing Table
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type 2, B - BGP
Timers: Uptime

IP Route Table for VRF "default"
S ::/0 [50/0] via ::, pppoe4, 01w0d05h
C ::1/128 via ::, lo, 01w0d05h
C 2a05:b780:0:1d::/64 via ::, pppoe4, 01w0d05h
C 2a05:c100:1d::/64 via ::, eth1, 01:11:26
C fe80::/10 via ::, pppoe4, 01w0d05h
C fe80::/64 via ::, eth1, 01:11:25

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
parsed_sample:
- code: "S"
ip: "::"
prefix_length: "0"
distance: "50"
metric: "0"
nexthop_ip: "::"
interface: "pppoe4"
uptime: "01w0d05h"
- code: "C"
ip: "::1"
prefix_length: "128"
distance: ""
metric: ""
nexthop_ip: "::"
interface: "lo"
uptime: "01w0d05h"
- code: "C"
ip: "2a05:b780:0:1d::"
prefix_length: "64"
distance: ""
metric: ""
nexthop_ip: "::"
interface: "pppoe4"
uptime: "01w0d05h"
- code: "C"
ip: "2a05:c100:1d::"
prefix_length: "64"
distance: ""
metric: ""
nexthop_ip: "::"
interface: "eth1"
uptime: "01:11:26"
- code: "C"
ip: "fe80::"
prefix_length: "10"
distance: ""
metric: ""
nexthop_ip: "::"
interface: "pppoe4"
uptime: "01w0d05h"
- code: "C"
ip: "fe80::"
prefix_length: "64"
distance: ""
metric: ""
nexthop_ip: "::"
interface: "eth1"
uptime: "01:11:25"

0 comments on commit 8314a38

Please sign in to comment.