Question

BGP advertised and received routes for Arista EOS and NXOS devices

  • 14 November 2023
  • 1 reply
  • 82 views

I am trying to get the BGP advertised and received prefixes for Arista EOS and Cisco NXOA devices. I tried the below two queries and they only work for IOS and IOS-XE. devices

BGP Received routes -

---------------------------------------------------------

foreach device in network.devices
// where device.name == "jcdwans01"
where isPresent(device.bgpRib)
let bgpRib = device.bgpRib
foreach afiSafi in bgpRib.afiSafis
foreach neighbor in afiSafi.neighbors
where isPresent(neighbor.adjRibInPost)
let adjRibInPost = neighbor.adjRibInPost
select {
  deviceName: device.name,
  platform: device.platform.os,
  afiSafiAfiSafiName: afiSafi.afiSafiName,
  neighborNeighborAddress: neighbor.neighborAddress,
  routesCount: length(adjRibInPost.routes)
}


BGP advertised routes -


foreach device in network.devices
where isPresent(device.bgpRib)
let bgpRib = device.bgpRib
foreach afiSafi in bgpRib.afiSafis
foreach neighbor in afiSafi.neighbors
where isPresent(neighbor.adjRibOutPost)
let adjRibOutPost = neighbor.adjRibOutPost
foreach route in adjRibOutPost.routes
select {
  deviceName: device.name,
  platform: device.platform.os,
  afiSafiAfiSafiName: afiSafi.afiSafiName,
  neighborNeighborAddress: neighbor.neighborAddress,
  routesCount: length(adjRibOutPost.routes)

}


1 reply

Userlevel 3
Badge

The data model says that it should work for NX-OS.  Recall that it requires that you have the extra BGP collection enabled.  Forward does not collect the adjRibInPost and adjRibOutPost by default.  If you have an NX-OS device that is enabled for this extra BGP collection, and you can see the data files for the “ebgp receive routes” and “ebgp advertised routes”.  Then please open a trouble ticket with that device name.

As for EOS.  That is currently not supported.  That will require a new feature request.  I’ll submit that. I filed a new feature request for handling large data files like that in NQE, but that will take longer for that to be handled.

Reply