RouterOS 7.8 - How to see how many routes are received by a BGP peer?

Hi guys,
I hope you’re doing well. I have upgraded some dozens of CCRs from v6 to v7, they are running fine, but it looks like the prefix count information has been lost (or it changed location).

Prefix count is dead on ROS v7.8 at least. You cannot verify how many routes a peer sent to you, but you can check how many routes you sent to a remote peer via /routing bgp ad print

Anyone from Mikrotik support team?

Best regards,

Thank you @DarkNate, I hope Mikrotik solves this bug soon

received routes can be seen in /routing route menu, with appropriate params and count-only you can see the number.

Hi,
What would be the appropriate parameter? I would like to see all the prefixes being received from the IXP interface, they share the same BGP session (since it points to the route servers), but gateway addresses are different for certain prefixes.

Best regards

Just look at available parameters, bgp.peer-cache-id or belongs-to is the easiest to get all routes from the peer.

/routing
:foreach item in=[bgp session find] do={
:local rnam “unknown”
:local radd [bgp session get $item remote.address]
:local prfix “32”
:if ([:typeof $radd] = “ip6”) do={:set prfix “128”}
:local srch [bgp connection find where remote.address=“$radd/$prfix”]
:if ([:len $srch] = 1) do={:set rnam [bgp connection get $srch name]}
:local cnt4 [:len [route find where belongs-to=“bgp-IP-$radd”]]
:local cnt6 [:len [route find where belongs-to=“bgp-IP6-$radd”]]
:put “BGP $radd ($rnam) IPv4 $cnt4 IPv6 $cnt6”
}

I suppose the number is available from SNMP? because I doubt you can run through ~4M routes every 5 minutes, for every peer, by script, without performance impact.

To expand on my former question, in the past 25 or so years I have been using SNMP monitoring on the number of routes received from peers in order to update prefix limits before they are hit, particularly on IXPs, and generate alarms from NMSs when upper and lower threshold were broken. This is a functionality every device I dealt with before Mikrotik has offered in the same time frame (Cisco, Juniper, Enterasys, Extreme, Foundry, Brocade), and to my understanding, that also existed in previous Mikrotik software versions.

For which version in V7 is this? It produces all peers with 0 as output for me on 7.9 (maybe because all my BGP sessions are in a separate VRF to isolate Control- and Data plane?)

BGP stats over SNMP was never available on MikroTik.
We just got some SNMP support in 7.10rc.

This gives me the information on IPv4 I’ve sent to peers, but doesn’t seem to show IPv6 sent to peers. Either that or I’m not sending any routes to my IPv6 peers. I was just recently assigned an ASN, IPv4, and IPv6 from ARIN and I’m attempting to make sure I have it configured correctly. Is this supposed to show them all?

This is what I’m getting:

/routing bgp ad print
0 peer=bgp-securebit-ipv4-1 dst=23.163.120.0 afi=ip
nexthop=85.202.203.130 origin=0 as-path=sequence 11913

0 peer=bgp-route64-ipv4-1 dst=23.163.120.0 afi=ip
nexthop=100.64.111.186 origin=0 as-path=sequence 11913

[Update].
I got it working. The key was to add a static blackholed route to my /44 and then bam it worked.