Skip to content

Commit

Permalink
fix: Corrected Ubiquiti EdgeRouter show_ip_route template (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ribot authored Nov 11, 2024
1 parent d9e692b commit e53d649
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ 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_ADDRESS}/${PREFIX_LENGTH}\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+\*>\s${IP_ADDRESS}/${PREFIX_LENGTH}\sis\sdirectly\sconnected\s* -> Record
^${CODE}\s+\*>\s${IP_ADDRESS}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+\*>\s${IP_ADDRESS}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}\s\(recursive is directly connected,\s${INTERFACE}\)\s* -> Record
^\s+(\*>)?\s+\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}\s\(recursive is directly connected,\s${INTERFACE}\)\s* -> Record
^${CODE}\s+(\*>)?\s${IP_ADDRESS}/${PREFIX_LENGTH}\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+(\*>)?\s${IP_ADDRESS}/${PREFIX_LENGTH}\sis\sdirectly\sconnected\s* -> Record
^${CODE}\s+(\*>)?\s${IP_ADDRESS}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\sis\sdirectly\sconnected,\s${INTERFACE}\s* -> Record
^${CODE}\s+(\*>)?\s${IP_ADDRESS}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}\s\(recursive is directly connected,\s${INTERFACE}\)\s* -> Record
^${CODE}\s+(\*>)?\s${IP_ADDRESS}/${PREFIX_LENGTH}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP},\s${INTERFACE}\s* -> Record
^. -> Error

EOF
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
> - selected route, * - FIB route, p - stale info

IP Route Table for VRF "default"
S *> 0.0.0.0/0 [50/0] via 100.100.34.45, eth9
C *> 100.100.34.44/30 is directly connected, eth9
B *> 100.100.34.48/30 [20/0] via 100.100.34.45, eth9, 1d05h38m
C *> 127.0.0.0/8 is directly connected, lo
B *> 192.168.2.0/24 [20/0] via 100.100.34.45, eth9, 01:16:38
C *> 192.168.6.0/24 is directly connected, switch0.1
C 192.168.6.0/24 is directly connected, switch0.1
B *> 100.100.34.32/30 [20/0] via 100.100.34.45, eth9, 03w0d00h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
parsed_sample:
- code: "S"
distance: "50"
interface: "eth9"
ip_address: "0.0.0.0"
metric: "0"
nexthop_ip: "100.100.34.45"
prefix_length: "0"
- code: "C"
distance: ""
interface: "eth9"
ip_address: "100.100.34.44"
metric: ""
nexthop_ip: ""
prefix_length: "30"
- code: "B"
distance: "20"
interface: "eth9"
ip_address: "100.100.34.48"
metric: "0"
nexthop_ip: "100.100.34.45"
prefix_length: "30"
- code: "C"
distance: ""
interface: "lo"
ip_address: "127.0.0.0"
metric: ""
nexthop_ip: ""
prefix_length: "8"
- code: "B"
distance: "20"
interface: "eth9"
ip_address: "192.168.2.0"
metric: "0"
nexthop_ip: "100.100.34.45"
prefix_length: "24"
- code: "C"
distance: ""
interface: "switch0"
ip_address: "192.168.6.0"
metric: ""
nexthop_ip: ""
prefix_length: "24"
- code: "C"
distance: ""
interface: "switch0"
ip_address: "192.168.6.0"
metric: ""
nexthop_ip: ""
prefix_length: "24"
- code: "B"
distance: "20"
interface: "eth9"
ip_address: "100.100.34.32"
metric: "0"
nexthop_ip: "100.100.34.45"
prefix_length: "30"

0 comments on commit e53d649

Please sign in to comment.