From 09ec1d4f2c643323ebe3850d9040c5e610569933 Mon Sep 17 00:00:00 2001 From: Guillaume M'Bali <77588596+guillaume-mbali@users.noreply.github.com> Date: Wed, 18 Jan 2023 15:26:55 +0100 Subject: [PATCH] Ubiquiti: Add show ipv6 route template (#1274) --- ...biquiti_edgerouter_show_ipv6_route.textfsm | 17 +++++++ .../ubiquiti_edgerouter_show_ipv6_route.raw | 15 ++++++ .../ubiquiti_edgerouter_show_ipv6_route.yml | 50 +++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 ntc_templates/templates/ubiquiti_edgerouter_show_ipv6_route.textfsm create mode 100644 tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.raw create mode 100644 tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.yml diff --git a/ntc_templates/templates/ubiquiti_edgerouter_show_ipv6_route.textfsm b/ntc_templates/templates/ubiquiti_edgerouter_show_ipv6_route.textfsm new file mode 100644 index 0000000000..bef85b0b21 --- /dev/null +++ b/ntc_templates/templates/ubiquiti_edgerouter_show_ipv6_route.textfsm @@ -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 diff --git a/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.raw b/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.raw new file mode 100644 index 0000000000..f2cf2596ce --- /dev/null +++ b/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.raw @@ -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 + diff --git a/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.yml b/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.yml new file mode 100644 index 0000000000..04e072285f --- /dev/null +++ b/tests/ubiquiti_edgerouter/show_ipv6_route/ubiquiti_edgerouter_show_ipv6_route.yml @@ -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"