diff --git a/napalm/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl b/napalm/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl index 8e6e57f86..996ac0035 100644 --- a/napalm/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl +++ b/napalm/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl @@ -9,7 +9,7 @@ Value MSG_SENT (\d+) Value TBL_VER (\d+) Value IN_Q (\d+) Value OUT_Q (\d+) -Value UP (\w+) +Value UP (\S+) Value PREFIX_RECV (.*) Start @@ -18,7 +18,9 @@ Start ^Neighbor\s+V -> Table Table + ^${NEIGHBOR} -> Continue + ^\s+${BGP_VER}\s+${REMOTE_AS}\s+${MSG_RECV}\s+${MSG_SENT}\s+${TBL_VER}\s+${IN_Q}\s+${OUT_Q}\s+${UP}\s+${PREFIX_RECV} -> Record Table ^${NEIGHBOR}\s+${BGP_VER}\s+${REMOTE_AS}\s+${MSG_RECV}\s+${MSG_SENT}\s+${TBL_VER}\s+${IN_Q}\s+${OUT_Q}\s+${UP}\s+${PREFIX_RECV} -> Record Table - ^\s* -> Clearall Start + ^$$ -> Clearall Start EOF diff --git a/napalm/ios/utils/textfsm_templates/ip_bgp_neigh.tpl b/napalm/ios/utils/textfsm_templates/ip_bgp_neigh.tpl index b811c00a8..bacbd5ba7 100644 --- a/napalm/ios/utils/textfsm_templates/ip_bgp_neigh.tpl +++ b/napalm/ios/utils/textfsm_templates/ip_bgp_neigh.tpl @@ -6,7 +6,7 @@ Value DESCRIPTION (.*) Value ROUTER_ID (\S+) Value BGP_STATE (\w+) Value UP (\w+) -Value UPTIME (\w+) +Value UPTIME (\S+) Value LAST_READ (.*) Value LAST_WRITE (.*) Value HOLDTIME (\d+) diff --git a/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/expected_result.json b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/expected_result.json index d631dedb5..aa3a4f98b 100644 --- a/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/expected_result.json +++ b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/expected_result.json @@ -115,6 +115,43 @@ "output_updates": 2480, "received_prefix_count": 45717, "holdtime": 180 + }, + { + "suppress_4byte_as": false, + "local_as_prepend": false, + "connection_state": "Established", + "multihop": false, + "input_messages": 6974686, + "output_messages": 138790, + "previous_connection_state": "", + "remove_private_as": false, + "multipath": false, + "messages_queued_out": 0, + "keepalive": 60, + "remote_as": 7922, + "local_port": 21958, + "active_prefix_count": 45715, + "configured_holdtime": 0, + "routing_table": "global", + "flap_count": 0, + "suppressed_prefix_count": 0, + "local_address": "2001:559::2", + "remote_port": 179, + "input_updates": 6974616, + "configured_keepalive": 0, + "router_id": "68.86.1.1", + "export_policy": "BGP-TRANSIT-IPv6-OUT", + "local_as": 1, + "remote_address": "2001:559::3", + "advertised_prefix_count": 2, + "local_address_configured": true, + "import_policy": "BGP-COMCAST-IPv6-IN", + "last_event": "", + "accepted_prefix_count": 45717, + "up": true, + "output_updates": 2480, + "received_prefix_count": 45717, + "holdtime": 180 } ] }, @@ -159,4 +196,4 @@ } ] } -} \ No newline at end of file +} diff --git a/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_all_sum.txt b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_all_sum.txt index 5e881ba9f..d09eed1f6 100644 --- a/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_all_sum.txt +++ b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_all_sum.txt @@ -35,6 +35,8 @@ BGP activity 3436532/2710503 prefixes, 19215241/17575537 paths, scan interval 60 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2001:559::1 4 7922 6944479 138054 116434201 0 0 12w2d 45646 +2001:559::3 + 4 7922 6944479 138054 116434201 0 0 12:22:20 45646 For address family: VPNv4 Unicast BGP router identifier 1.1.1.1, local AS number 1 @@ -53,4 +55,4 @@ BGP using 10206888 total bytes of memory BGP activity 3436532/2710503 prefixes, 19215241/17575537 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd -169.255.22.1 4 1 101841 100528 6668 0 0 9w0d 440 \ No newline at end of file +169.255.22.1 4 1 101841 100528 6668 0 0 9w0d 440 diff --git a/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_ipv6_unicast_neigh_2001_559__3.txt b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_ipv6_unicast_neigh_2001_559__3.txt new file mode 100644 index 000000000..1c544bad2 --- /dev/null +++ b/test/ios/mocked_data/test_get_bgp_neighbors_detail/normal/show_ip_bgp_ipv6_unicast_neigh_2001_559__3.txt @@ -0,0 +1,128 @@ + +BGP neighbor is 2001:559::3, remote AS 7922, external link + Description: Comcast IPv6 Transit + Inherits from template PEER-SESSION-AS7922 for session parameters + BGP version 4, remote router ID 68.86.1.1 + BGP state = Established, up for 12w2d + Last read 00:00:01, last write 00:00:35, hold time is 180, keepalive interval is 60 seconds + Neighbor sessions: + 1 active, is not multisession capable (disabled) + Neighbor capabilities: + Route refresh: advertised and received(new) + Four-octets ASN Capability: advertised and received + Address family IPv6 Unicast: advertised and received + Graceful Restart Capability: advertised and received + Remote Restart timer is 120 seconds + Address families advertised by peer: + IPv6 Unicast (was preserved + Enhanced Refresh Capability: advertised + Multisession Capability: + Stateful switchover support enabled: NO for session 1 + Message statistics: + InQ depth is 0 + OutQ depth is 0 + + Sent Rcvd + Opens: 1 1 + Notifications: 0 0 + Updates: 2480 6974616 + Keepalives: 136309 69 + Route Refresh: 0 0 + Total: 138790 6974686 + Do log neighbor state changes (via global configuration) + Default minimum time between advertisement runs is 30 seconds + + For address family: IPv6 Unicast + Session: 2001:559::3 + BGP table version 117061141, neighbor version 117061129/117061141 + Output queue size : 0 + Index 1, Advertise bit 0 + 1 update-group member + Inherits from template PEER-POLICY-COMCAST-IPv6 + My AS number is allowed for 10 number of times + NEXT_HOP is always this router for eBGP paths + Inbound path policy configured + Outbound path policy configured + Incoming update prefix filter list is BGP-BOGONS-IPv6-IN + Outgoing update prefix filter list is BGP-TRANSIT-IPv6-OUT + Route map for incoming advertisements is BGP-COMCAST-IPv6-IN + Route map for outgoing advertisements is BGP-TRANSIT-IPv6-OUT + Slow-peer detection is disabled + Slow-peer split-update-group dynamic is disabled + Sent Rcvd + Prefix activity: ---- ---- + Prefixes Current: 2 45717 (Consumes 6948984 bytes) + Prefixes Total: 4958 8328487 + Implicit Withdraw: 4956 7470835 + Explicit Withdraw: 0 811935 + Used as bestpath: n/a 45715 + Used as multipath: n/a 0 + Used as secondary: n/a 0 + + Outbound Inbound + Local Policy Denied Prefixes: -------- ------- + Other Policies: 112415977 n/a + Total: 112415977 0 + Number of NLRIs in the update sent: max 2, min 0 + Last detected as dynamic slow peer: never + Dynamic slow peer recovered: never + Refresh Epoch: 1 + Last Sent Refresh Start-of-rib: never + Last Sent Refresh End-of-rib: never + Last Received Refresh Start-of-rib: never + Last Received Refresh End-of-rib: never + Sent Rcvd + Refresh activity: ---- ---- + Refresh Start-of-RIB 0 0 + Refresh End-of-RIB 0 0 + + Address tracking is enabled, the RIB does have a route to 2001:559::3 + Connections established 1; dropped 0 + Last reset never + External BGP neighbor configured for connected checks (single-hop no-disable-connected-check) + Interface associated: GigabitEthernet0/0/4 (peering address in same link) + Transport(tcp) path-mtu-discovery is enabled + Graceful-Restart is enabled, restart-time 120 seconds, stalepath-time 360 seconds + SSO is disabled +Connection state is ESTAB, I/O status: 1, unread input bytes: 0 +Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 +Local host: 2001:559::2, Local port: 21958 +Foreign host: 2001:559::3, Foreign port: 179 +Connection tableid (VRF): 0 +Maximum output segment queue size: 50 + +Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes) + +Event Timers (current time is 0x1BED85262): +Timer Starts Wakeups Next +Retrans 138767 0 0x0 +TimeWait 0 0 0x0 +AckHold 2425311 1956394 0x0 +SendWnd 0 0 0x0 +KeepAlive 0 0 0x0 +GiveUp 0 0 0x0 +PmtuAger 7470660 7470659 0x1BED853C2 +DeadWait 0 0 0x0 +Linger 0 0 0x0 +ProcessQ 0 0 0x0 + +iss: 3500006922 snduna: 3502837353 sndnxt: 3502837353 +irs: 2409182929 rcvnxt: 3188305548 + +sndwnd: 65022 scale: 0 maxrcvwnd: 16384 +rcvwnd: 16164 scale: 0 delrcvwnd: 220 + +SRTT: 1000 ms, RTTO: 1003 ms, RTV: 3 ms, KRTT: 0 ms +minRTT: 1 ms, maxRTT: 1000 ms, ACK hold: 200 ms +uptime: -1 ms, Sent idletime: 1099 ms, Receive idletime: 1299 ms +Status Flags: active open +Option Flags: nagle, path mtu capable +IP Precedence value : 6 + +Datagrams (max data segment is 1440 bytes): +Rcvd: 2561857 (out of order: 0), with data: 2431970, total data bytes: 779122618 +Sent: 2570215 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 2570215, total data bytes: 105639038 + + Packets received in fast path: 0, fast processed: 0, slow path: 0 + fast lock acquisition failures: 0, slow path: 0 +TCP Semaphore 0x7F2543BB2160 FREE