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

Fortinet 'get router info bgp neighbors' template #1489

Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Value NEIGHBOR (\S+)
Value BGP_VERSION (\d+)
Value REMOTE_ASN (\d+)
Value LOCAL_ASN (\d+)
Value REMOTE_ROUTER_ID (\S+)
Value BGP_STATE ([\w\s\(\)]+)
Value UPTIME (\S+)
Value List ADDR_FAMILY (\w+(?:\s+\w+)?)
Value List TABLE_VERSION (\d+)
Value List NEI_TABLE_VERSION (\d+)
Value List INBOUND_ROUTEMAP (\S+)
Value List OUTBOUND_ROUTEMAP (\S+)
Value List ACCEPTED_PREFIXES (\d+)
Value List ACCEPTED_PREFIXES_RIB (\d+)
Value List ANNOUNCED_PREFIXES (\d+)
Value LOCALHOST_IP (\S+)
Value LOCALHOST_PORT (\d+)
Value REMOTE_IP (\S+)
Value REMOTE_PORT (\d+)
Value NEXTHOP_IP (\S+)
Value NEXTHOP_INTERFACE (\S+)

Start
^VRF\s+\d+\s+neighbor\s+table:\s*$$
^BGP\s+neighbor\s+is -> Continue.Record
^BGP\s+neighbor\s+is\s+${NEIGHBOR},\s+remote\s+AS\s+${REMOTE_ASN},\s+local\s+AS\s+${LOCAL_ASN},.*$$
^\s+BGP\s+version\s+${BGP_VERSION},\s+remote\s+router\s+ID\s+${REMOTE_ROUTER_ID}\s*$$
^\s+BGP\s+state\s+=\s+${BGP_STATE},\s+\w+\s+for\s+${UPTIME}\s*$$
^\s+Last\s+read\s+\d{2}:\d{2}:\d{2},\s+hold\s+time\s+is\s+\d+,\s+keepalive\s+interval\s+is\s+\d+\s+seconds\s*$$
^\s+Configured\s+hold\s+time\s+is\s+\d+,\s+keepalive\s+interval\s+is\s+\d+\s+seconds\s*$$
^\s+Neighbor\s+capabilities:\s*$$
^\s+Route\s+refresh:\s+.*$$
^\s+Address\s+family\s+IPv4\s+Unicast:\s+.*$$
^\s+Address\s+family\s+IPv6\s+Unicast:\s+.*$$
^\s+Received\s+\d+\s+messages,\s+\d+\s+notifications,\s+\d+\s+in\s+queue\s*$$
^\s+Sent\s+\d+\s+messages,\s+\d+\s+notifications,\s+\d+\s+in\s+queue\s*$$
^\s+Route\s+refresh\s+request:\s+received\s+\d+,\s+sent\s+\d+\s*$$
^\s+Minimum\s+time\s+between\s+advertisement\s+runs\s+is\s+\d+\s+seconds\s*$$
^\s+For\s+address\s+family:\s+${ADDR_FAMILY}\s*$$ -> AddrFamState
^\s+Connections\s+established\s+\d+;\s+dropped\s+\d+\s*$$
^Local\s+host:\s+${LOCALHOST_IP},\s+Local port:\s+${LOCALHOST_PORT}\s*$$
^Foreign\s+host:\s+${REMOTE_IP},\s+Foreign port:\s+${REMOTE_PORT}\s*$$
^Nexthop:\s+${NEXTHOP_IP}\s*$$
^Nexthop\s+interface:\s+${NEXTHOP_INTERFACE}\s*$$
^Nexthop\s+global:\s+.*$$
^Nexthop\s+local:\s+.*$$
^BGP\s+connection:\s+.*$$
^Last\s+Reset:\s+\S+,\s+.*$$
^Notification\s+Error\s+Message:\s+.*$$
^\s*\%\s+No\s+neighbor\s+exist\s*$$
^\s*$$
^. -> Error

AddrFamState
^\s+BGP\s+table\s+version\s+${TABLE_VERSION},\s+neighbor\s+version\s+${NEI_TABLE_VERSION}\s*$$
^\s+Index\s+\d+,\s+Offset\s+\d+,\s+Mask\s+\w+\s*$$
^\s+Additional\s+Path:\s*$$
^\s+Send-mode:\s+.*$$
^\s+Receive-mode:\s+.*$$
^\s+NEXT_HOP\s+is\s+always\s+this\s+router\s*$$
^\s+Community\s+attribute\s+sent\s+to\s+this\s+neighbor.*$$
^\s+Inbound\s+path\s+policy\s+configured\s*$$
^\s+Route\s+map\s+for\s+incoming\s+advertisements\s+is\s+${INBOUND_ROUTEMAP}\s*$$
^\s+Route\s+map\s+for\s+outgoing\s+advertisements\s+is\s+${OUTBOUND_ROUTEMAP}\s*$$
^\s+${ACCEPTED_PREFIXES}\saccepted\sprefixes,\s${ACCEPTED_PREFIXES_RIB}\sprefixes\sin\srib\s*$$
^\s+${ANNOUNCED_PREFIXES}\sannounced\sprefixes\s*$$ -> Start
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ extreme_exos_show_sharing.textfsm, .*, extreme_exos, show sharing
extreme_exos_show_iparp.textfsm, .*, extreme_exos, show iparp

fortinet_get_router_info_routing-table_all.textfsm, .*, fortinet, g[[et]] r[[outer]] info ro[[uting-table]] a[[ll]]
fortinet_get_router_info_bgp_neighbors.textfsm, .*, fortinet, g[[et]] r[[outer]] info bg[[p]] nei[[ghbors]]
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_router_info_ospf_status.textfsm, .*, fortinet, g[[et]] r[[outer]] info o[[spf]] s[[tatus]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
VRF 0 neighbor table:
BGP neighbor is 10.105.1.254, remote AS 65400, local AS 65400, internal link
BGP version 4, remote router ID 10.105.3.254
BGP state = Established, up for 4d14h28m
Last read 00:00:00, hold time is 3, keepalive interval is 1 seconds
Configured hold time is 3, keepalive interval is 1 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Address family IPv6 Unicast: advertised and received
Received 1517339 messages, 2 notifications, 0 in queue
Sent 1482858 messages, 6 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 1 seconds

For address family: IPv4 Unicast
BGP table version 31, neighbor version 25
Index 1, Offset 0, Mask 0x2
Additional Path:
Send-mode: received
Receive-mode: advertised
NEXT_HOP is always this router
Community attribute sent to this neighbor (both)
Inbound path policy configured
Route map for incoming advertisements is *prefer_vpn1root
423 accepted prefixes, 423 prefixes in rib
3 announced prefixes

For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0 accepted prefixes, 0 prefixes in rib
0 announced prefixes

Connections established 9; dropped 8
Local host: 10.105.1.2, Local port: 3777
Foreign host: 10.105.1.254, Foreign port: 179
Nexthop: 10.105.1.2
Nexthop interface: VPN1_0
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 4d14h38m, due to BGP Notification sent
Notification Error Message: (Hold Timer Expired/Unspecified Error Subcode)

BGP neighbor is 10.105.2.254, remote AS 65400, local AS 65400, internal link
BGP version 4, remote router ID 10.105.3.254
BGP state = Established, up for 12:41:52
Last read 00:00:00, hold time is 3, keepalive interval is 1 seconds
Configured hold time is 3, keepalive interval is 1 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Address family IPv6 Unicast: advertised and received
Received 1517182 messages, 4 notifications, 0 in queue
Sent 1481876 messages, 16 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 1 seconds

For address family: IPv4 Unicast
BGP table version 31, neighbor version 30
Index 2, Offset 0, Mask 0x4
Additional Path:
Send-mode: received
Receive-mode: advertised
NEXT_HOP is always this router
Community attribute sent to this neighbor (both)
Inbound path policy configured
Route map for incoming advertisements is *prefer_vpn2root
423 accepted prefixes, 423 prefixes in rib
3 announced prefixes

For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes, 0 prefixes in rib
0 announced prefixes

Connections established 21; dropped 20
Local host: 10.105.2.2, Local port: 21489
Foreign host: 10.105.2.254, Foreign port: 179
Nexthop: 10.105.2.2
Nexthop interface: VPN2_0
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 12:55:18, due to BGP Notification sent
Notification Error Message: (Hold Timer Expired/Unspecified Error Subcode)


Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
parsed_sample:
- accepted_prefixes:
- "423"
- "0"
accepted_prefixes_rib:
- "423"
- "0"
addr_family:
- "IPv4 Unicast"
- "IPv6 Unicast"
announced_prefixes:
- "3"
- "0"
bgp_state: "Established"
bgp_version: "4"
inbound_routemap:
- "*prefer_vpn1root"
local_asn: "65400"
localhost_ip: "10.105.1.2"
localhost_port: "3777"
nei_table_version:
- "25"
- "1"
neighbor: "10.105.1.254"
nexthop_interface: "VPN1_0"
nexthop_ip: "10.105.1.2"
outbound_routemap: []
remote_asn: "65400"
remote_ip: "10.105.1.254"
remote_port: "179"
remote_router_id: "10.105.3.254"
table_version:
- "31"
- "1"
uptime: "4d14h28m"
- accepted_prefixes:
- "423"
- "0"
accepted_prefixes_rib:
- "423"
- "0"
addr_family:
- "IPv4 Unicast"
- "IPv6 Unicast"
announced_prefixes:
- "3"
- "0"
bgp_state: "Established"
bgp_version: "4"
inbound_routemap:
- "*prefer_vpn2root"
local_asn: "65400"
localhost_ip: "10.105.2.2"
localhost_port: "21489"
nei_table_version:
- "30"
- "1"
neighbor: "10.105.2.254"
nexthop_interface: "VPN2_0"
nexthop_ip: "10.105.2.2"
outbound_routemap: []
remote_asn: "65400"
remote_ip: "10.105.2.254"
remote_port: "179"
remote_router_id: "10.105.3.254"
table_version:
- "31"
- "1"
uptime: "12:41:52"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
parsed_sample: []
Loading