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

Add new template for Fsas Si-R show ip route #1973

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions ntc_templates/templates/fsas_sir_show_ip_route.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Value FLAG (\S)
Value PROTOCOL (\w+)
Value NETWORK (\S+)
Value PREFIX_LENGTH (\d+)
Value GATEWAY (\S+)
Value DISTANCE (\d+)
Value UPTIME (\S+)
Value INTERFACE (\w+)

Start
^FP\s+Destination\/Mask
^---\s+
^(\s+|${FLAG})${PROTOCOL}\s+${NETWORK}\/${PREFIX_LENGTH}\s+${GATEWAY}\s+${DISTANCE}\s+${UPTIME}\s+${INTERFACE}\s*$$ -> Record
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ fortinet_execute_ping.textfsm, .*, fortinet, exec[[ute]] ping
fortinet_execute_time.textfsm, .*, fortinet, exec[[ute]] ti[[me]]

fsas_sir_show_system_information.textfsm, .*, fsas_sir, sh[[ow]] sys[[tem]] i[[nformation]]
fsas_sir_show_ip_route.textfsm, .*, fsas_sir, sh[[ow]] ip ro[[ute]]
fsas_sir_show_ether.textfsm, .*, fsas_sir, sh[[ow]] eth[[er]]

hp_comware_display_lldp_neighbor-information_verbose.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] v[[erbose]]
Expand Down
26 changes: 26 additions & 0 deletions tests/fsas_sir/show_ip_route/fsas_sir_show_ip_route.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FP Destination/Mask Gateway Distance UpTime Interface
--- ------------------ --------------- -------- --------- ------------------
*S 0.0.0.0/0 192.168.50.1 1 04:56:03 lan1
*O 1.1.1.1/32 192.168.50.231 110 01:58:56 lan1
*A 2.2.2.2/32 192.168.50.231 110 01:58:56 lan1
*O 4.4.4.4/32 192.168.50.234 110 01:26:24 lan1
*Bi 5.5.5.5/32 192.168.50.235 200 00:48:30 lan1
E2 10.1.12.0/24 192.168.50.231 110 00:00:00 lan1
*S 10.1.12.0/24 192.168.50.231 1 04:06:01 lan1
*E2 10.1.13.0/29 192.168.50.231 110 6d23h45m lan1
*E1 10.2.100.0/24 192.168.50.231 110 01:58:55 lan1
*O 10.3.3.0/28 172.21.120.2 110 01:59:06 rmt1
*C 10.3.120.1/32 10.3.120.1 0 04:36:48 lo0
R 10.4.1.0/24 192.168.50.234 120 00:00:00 lan1
*O 10.4.1.0/24 192.168.50.231 110 01:26:24 lan1
*R 10.4.99.0/24 192.168.50.234 120 01:06:38 lan1
*Be 10.6.13.0/24 192.168.50.236 20 00:16:09 lan1
*Be 10.6.99.0/24 192.168.50.236 20 00:31:14 lan1
*S 10.120.9.9/32 rmt2 1 3w6d23h rmt2
*C 10.255.255.0/24 10.255.255.1 0 01:01:38 lan7
*A 172.16.1.0/28 192.168.50.231 110 01:58:56 lan1
*O 172.21.1.0/31 172.21.120.2 110 01:17:14 rmt1
XO 172.21.120.0/30 172.21.120.2 110 01:59:06 rmt1
Copy link
Contributor

@mjbear mjbear Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the X stand for in XO on line 23?
(Certainly the O is most likely OSPF.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st character :

  • * : vaild route
  • : not use route
  • X : not use route

2nd and 3rd character :

  • O : OSPF
  • Bi : iBGO
  • Be : eBGP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st character :

* `*` : valid route

* ` ` :  not use route

* `X` : not use route

2nd and 3rd character :

* `O` : OSPF

* `Bi` : iBGP

* `Be` : eBGP

Got it, I suspected X might mean a route that isn't valid.
Slightly different syntax and I figured I'd ask rather than assume. 🫣
Thank you.

*L 172.21.120.1/32 172.21.120.1 0 03:54:11 rmt1
*C 172.21.120.2/32 172.21.120.1 0 03:54:11 rmt1
*C 192.168.50.0/24 192.168.50.21 0 04:56:03 lan1
194 changes: 194 additions & 0 deletions tests/fsas_sir/show_ip_route/fsas_sir_show_ip_route.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
---
parsed_sample:
- distance: "1"
flag: "*"
gateway: "192.168.50.1"
interface: "lan1"
network: "0.0.0.0"
prefix_length: "0"
protocol: "S"
uptime: "04:56:03"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "1.1.1.1"
prefix_length: "32"
protocol: "O"
uptime: "01:58:56"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "2.2.2.2"
prefix_length: "32"
protocol: "A"
uptime: "01:58:56"
- distance: "110"
flag: "*"
gateway: "192.168.50.234"
interface: "lan1"
network: "4.4.4.4"
prefix_length: "32"
protocol: "O"
uptime: "01:26:24"
- distance: "200"
flag: "*"
gateway: "192.168.50.235"
interface: "lan1"
network: "5.5.5.5"
prefix_length: "32"
protocol: "Bi"
uptime: "00:48:30"
- distance: "110"
flag: ""
gateway: "192.168.50.231"
interface: "lan1"
network: "10.1.12.0"
prefix_length: "24"
protocol: "E2"
uptime: "00:00:00"
- distance: "1"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "10.1.12.0"
prefix_length: "24"
protocol: "S"
uptime: "04:06:01"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "10.1.13.0"
prefix_length: "29"
protocol: "E2"
uptime: "6d23h45m"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "10.2.100.0"
prefix_length: "24"
protocol: "E1"
uptime: "01:58:55"
- distance: "110"
flag: "*"
gateway: "172.21.120.2"
interface: "rmt1"
network: "10.3.3.0"
prefix_length: "28"
protocol: "O"
uptime: "01:59:06"
- distance: "0"
flag: "*"
gateway: "10.3.120.1"
interface: "lo0"
network: "10.3.120.1"
prefix_length: "32"
protocol: "C"
uptime: "04:36:48"
- distance: "120"
flag: ""
gateway: "192.168.50.234"
interface: "lan1"
network: "10.4.1.0"
prefix_length: "24"
protocol: "R"
uptime: "00:00:00"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "10.4.1.0"
prefix_length: "24"
protocol: "O"
uptime: "01:26:24"
- distance: "120"
flag: "*"
gateway: "192.168.50.234"
interface: "lan1"
network: "10.4.99.0"
prefix_length: "24"
protocol: "R"
uptime: "01:06:38"
- distance: "20"
flag: "*"
gateway: "192.168.50.236"
interface: "lan1"
network: "10.6.13.0"
prefix_length: "24"
protocol: "Be"
uptime: "00:16:09"
- distance: "20"
flag: "*"
gateway: "192.168.50.236"
interface: "lan1"
network: "10.6.99.0"
prefix_length: "24"
protocol: "Be"
uptime: "00:31:14"
- distance: "1"
flag: "*"
gateway: "rmt2"
interface: "rmt2"
network: "10.120.9.9"
prefix_length: "32"
protocol: "S"
uptime: "3w6d23h"
- distance: "0"
flag: "*"
gateway: "10.255.255.1"
interface: "lan7"
network: "10.255.255.0"
prefix_length: "24"
protocol: "C"
uptime: "01:01:38"
- distance: "110"
flag: "*"
gateway: "192.168.50.231"
interface: "lan1"
network: "172.16.1.0"
prefix_length: "28"
protocol: "A"
uptime: "01:58:56"
- distance: "110"
flag: "*"
gateway: "172.21.120.2"
interface: "rmt1"
network: "172.21.1.0"
prefix_length: "31"
protocol: "O"
uptime: "01:17:14"
- distance: "110"
flag: "X"
gateway: "172.21.120.2"
interface: "rmt1"
network: "172.21.120.0"
prefix_length: "30"
protocol: "O"
uptime: "01:59:06"
- distance: "0"
flag: "*"
gateway: "172.21.120.1"
interface: "rmt1"
network: "172.21.120.1"
prefix_length: "32"
protocol: "L"
uptime: "03:54:11"
- distance: "0"
flag: "*"
gateway: "172.21.120.1"
interface: "rmt1"
network: "172.21.120.2"
prefix_length: "32"
protocol: "C"
uptime: "03:54:11"
- distance: "0"
flag: "*"
gateway: "192.168.50.21"
interface: "lan1"
network: "192.168.50.0"
prefix_length: "24"
protocol: "C"
uptime: "04:56:03"