diff --git a/ntc_templates/templates/fortinet_get_router_info_routing-table_all.textfsm b/ntc_templates/templates/fortinet_get_router_info_routing-table_all.textfsm new file mode 100644 index 0000000000..887eb0b66f --- /dev/null +++ b/ntc_templates/templates/fortinet_get_router_info_routing-table_all.textfsm @@ -0,0 +1,20 @@ +Value Filldown TYPE ((?:K|C|S|R|B|O|IA|N1|N2|E1|E2|i|L1|L2|ia|\*|\s)+?) +Value Filldown DESTINATION (\S+) +Value DISTANCE (\d+) +Value METRIC (\d+) +Value Required GATEWAY (\S+|is\s+directly\s+connected) +Value Required INTERFACE (\S+) +Value LAST_TIME_UPDATE (\S+) + +Start + ^\s*Codes:\s+K\s+-\s+kernel,\s+C\s+-\s+connected,\s+S\s+-\s+static,\s+R\s+-\s+RIP,\s+B\s+-\s+BGP\s*$$ + ^\s*O\s+-\s+OSPF,\s+IA\s+-\s+OSPF\s+inter\s+area\s*$$ + ^\s*N1\s+-\s+OSPF\s+NSSA\s+external\s+type\s+1,\s+N2\s+-\s+OSPF\s+NSSA\s+external\s+type\s+2\s*$$ + ^\s*E1\s+-\s+OSPF\s+external\s+type\s+1,\s+E2\s+-\s+OSPF\s+external\s+type\s+2\s*$$ + ^\s*i\s+-\s+IS-IS,\s+L1\s+-\s+IS-IS\s+level-1,\s+L2\s+-\s+IS-IS\s+level-2,\s+ia\s+-\s+IS-IS\s+inter\s+area\s*$$ + ^\s*\*\s+-\s+candidate\s+default\s*$$ + ^\s*Routing\s+table\s+for\s+VRF=\d+\s*$$ + ^\s*${TYPE}\s+${DESTINATION}(?:\s+\[${DISTANCE}/${METRIC}\]\s+via)?\s+${GATEWAY},\s*${INTERFACE}(?:\s*,\s*${LAST_TIME_UPDATE})?\s*$$ -> Record + ^\s*(?:\[${DISTANCE}/${METRIC}\]\s+via\s+)?${GATEWAY},\s*${INTERFACE}(?:\s*,\s*${LAST_TIME_UPDATE})?\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index da1bfd6461..e86d404518 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -492,6 +492,7 @@ extreme_show_vlan_description.textfsm, .*, extreme, show vlan description extreme_show_ipconfig.textfsm, .*, extreme, show ipconfig extreme_show_sharing.textfsm, .*, extreme, show sharing +fortinet_get_router_info_routing-table_all.textfsm, .*, fortinet, g[[et]] r[[outer]] info ro[[uting-table]] a[[ll]] fortinet_get_system_interface_physical.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] p[[hysical]] fortinet_get_router_info_bgp_summary.textfsm, .*, fortinet, g[[et]] r[[outer]] info bg[[p]] su[[mmary]] fortinet_get_system_ha_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] ha s[[tatus]] diff --git a/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.raw b/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.raw new file mode 100644 index 0000000000..ffbfff4ab6 --- /dev/null +++ b/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.raw @@ -0,0 +1,18 @@ +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 + i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area + * - candidate default + +Routing table for VRF=0 +O*E2 0.0.0.0/0 [110/10] via 10.149.127.253, Tu-Hub01-Main, 03w2d20h +S 8.8.8.8/32 [200/0] via 4.3.2.1, wan +O 10.80.58.224/27 [110/201] via 10.149.127.253, Tu-Hub01-Main, 3d13h31m +O E2 10.80.130.0/24 [110/20] via 10.149.127.253, Tu-Hub01-Main, 22:00:53 +C 10.100.105.224/27 is directly connected, Vlan40 +C 10.149.0.0/16 is directly connected, Tu-Hub01-Main + is directly connected, Tu-Hub02-Main +B 10.160.0.0/23 [20/0] via 10.142.0.74, port3, 2d18h02m +S 1.2.3.4/32 [10/0] via 10.152.1.229, lan + [10/0] via 4.3.2.1, wan diff --git a/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.yml b/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.yml new file mode 100644 index 0000000000..813885eabc --- /dev/null +++ b/tests/fortinet/get_router_info_routing-table_all/fortinet_get_router_info_routing-table_all.yml @@ -0,0 +1,72 @@ +--- +parsed_sample: + - destination: "0.0.0.0/0" + distance: "110" + gateway: "10.149.127.253" + interface: "Tu-Hub01-Main" + last_time_update: "03w2d20h" + metric: "10" + type: "O*E2" + - destination: "8.8.8.8/32" + distance: "200" + gateway: "4.3.2.1" + interface: "wan" + last_time_update: "" + metric: "0" + type: "S" + - destination: "10.80.58.224/27" + distance: "110" + gateway: "10.149.127.253" + interface: "Tu-Hub01-Main" + last_time_update: "3d13h31m" + metric: "201" + type: "O" + - destination: "10.80.130.0/24" + distance: "110" + gateway: "10.149.127.253" + interface: "Tu-Hub01-Main" + last_time_update: "22:00:53" + metric: "20" + type: "O E2" + - destination: "10.100.105.224/27" + distance: "" + gateway: "is directly connected" + interface: "Vlan40" + last_time_update: "" + metric: "" + type: "C" + - destination: "10.149.0.0/16" + distance: "" + gateway: "is directly connected" + interface: "Tu-Hub01-Main" + last_time_update: "" + metric: "" + type: "C" + - destination: "10.149.0.0/16" + distance: "" + gateway: "is directly connected" + interface: "Tu-Hub02-Main" + last_time_update: "" + metric: "" + type: "C" + - destination: "10.160.0.0/23" + distance: "20" + gateway: "10.142.0.74" + interface: "port3" + last_time_update: "2d18h02m" + metric: "0" + type: "B" + - destination: "1.2.3.4/32" + distance: "10" + gateway: "10.152.1.229" + interface: "lan" + last_time_update: "" + metric: "0" + type: "S" + - destination: "1.2.3.4/32" + distance: "10" + gateway: "4.3.2.1" + interface: "wan" + last_time_update: "" + metric: "0" + type: "S"