BGP prefix count in ROS 7.1 stable

hello guys,

i cannot see the prefix count received on bgp peer as before, maybe there is a way to see them, but i haven’t found info, i see only in peer cache prefix count “0”.

thanks a lot
Giulio

Hi, i have the same problem, i see “0” in “prefix count” column.
Screenshot_8.png

This is still an issue for me on version 7.1.2.

Please fix :slight_smile:

Still an issue in 7.1.3 :frowning:

This sucks :slight_smile:

It is a “known problem”… apparently in the “new BGP” there is no counter of the number of received prefixes anymore in a peer connection, and it is only possible to retrieve this information using a search on the routing table.
This can be done using a script.
But I agree it is not convenient… I always have a “BGP Peers” window open in winbox on my central routers and the “prefix count” is a nice quick indicator to know if everything is OK further down the network.
Unfortunately, the “BGP Sessions” window in v7 is by far not as useful for this purpose, not only because it does not show the prefix count, but also because it does not show the peer name and it does not auto-update, you need to refresh it using F5 to see the current status.

Hopefully something will be done about it, but personally I fear that after some revisions the “prefix count” field will just disappear.

I think it is also related to the fact the BGP service was re-written by Mikrotik for version 7 and there was an oversight or they ran out of time?

I know of no other BGP service that does not report on prefixes sent, received, rejected, etc. I had hoped V7 BGP would be a big jump forward in both performance but also get us closer to more mainstream BGP implementations…

Yes of course it is because they started their own BGP service… and it isn’t finished.
But also I think they now clearly split the function of the BGP service and the route filtering/FIB.
In the new RouterOS, filtered routes still appear in the routing table, but with the status “filtered” and never becoming active.
So the BGP service does not really know how many prefixes it has accepted, that is handled further down the line.
Therefore it is not so easy to show a counter without asking back to the routing engine how many of the received prefixes it really has accepted, which of course is an “expensive” operation.

I like that - ran out of time… I started in the industry just after v6 came out - and they have been promising v7 since then… they have had plenty of time.
Besides - why not just continue to push out the release if things don’t work - and then make them work…

Am really not trying to deminish what has been achieved. v7 has been fantastic to build with and learn - but if still so many bugs - should not be in release as far as I am concerned.

I stupidly presumed that since it was release - i’d be able to bring my production up to it. I am over a month in now - and just about ready for production but keep popping up with problems like this. Our current stack is dying - so need something to happen, but not sure if i should push on, or drop back.

At this stage - less a couple of annoyances, everything seems to be running well enough. I also have been building with v6 SxS for half the stack - so can easily keep that - or re adapt the setting from there to revert if need be - but for the mo - won’t be going full v7… just in case.

you’re not alone mate.

Be aware that the default action of the routing filter chain is “reject”

further reading = https://help.mikrotik.com/docs/pages/viewpage.action?pageId=74678285

need update, ros 7.6

This seems like an easy to fix bug and though is still here from v7.1 through 7.6 ?!?

:confused:

It is not. See reply #6 and #8.

It would be relay nice to see the number of received prefixes. Even if it does not consider if they get filtered further down the line. Just how many are received by that peer.

Yes that would at least be a start… in our network, the filters usually do not really remove routes, they are only a safeguard. And so the count would be fine.
Also, the “you can use a script to retrieve the count” is not easy at all due to another bug:
/routing/route/print count-only correctly prints the total number of routes
/routing/route/print where belongs-to=“bgp-IP-xx.xx.xx.xx” and !filtered prints routes from specific neighbors
however the combination /routing/route/print count-only where belongs-to=“bgp-IP-xx.xx.xx.xx” and !filtered always prints 0.

It has been admitted by support and noted as something to be fixed in the future, but hey there are many such small and larger issues in BGP and they are present and promised to be fixed for well over a year now… so I don’t hold my breath.

Try the following:

/routing/route/print where bgp and belongs-to~"10.1.254.2" and !filtered
Flags: A - ACTIVE; b, a - SLAAC
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE, IMMEDIATE-GW
   DST-ADDRESS        GATEWAY     AFI  DISTANCE  SCOPE  TARGET-SCOPE  IMMEDIATE-GW               
 b 10.1.254.0/30      10.1.254.2  ip4        20     40            10  10.1.254.2%ether2
Ab 10.100.0.0/24      10.1.254.2  ip4        20     40            10  10.1.254.2%ether2
Ab 10.100.1.0/24      10.1.254.2  ip4        20     40            10  10.1.254.2%ether2

And to get just the count:

/routing/route/print count-only where bgp and belongs-to~"10.1.254.2" and !filtered
3

The postings above reflect the situation as it existed at that time. By now, the bug with count-only has been fixed so they are not all relevant anymore.
However, there still exist several bugs/problems. For example, I created this script to print the number of received routes for each neighbor:

/system script
add dont-require-permissions=no name=bgp-prefixes owner=admin policy=read \
    source="/routing/bgp/session {\r\
    \n   :global prefixes ({});\r\
    \n   :local maxlen 0;\r\
    \n   :foreach ses in=[find] do={\r\
    \n      :set \$remote [get \$ses \"remote.address\"]\r\
    \n      :set \$name [get \$ses name]\r\
    \n      :if ([:len \$name] > \$maxlen) do={\r\
    \n         :set \$maxlen [:len \$name]\r\
    \n      }\r\
    \n      :set (\$prefixes->\$name) [/routing/route/print count-only  where belongs-to=\"bgp-IP-\$remote\"]\r\
    \n   }\r\
    \n   :set \$name \"Session                         \"\r\
    \n   :set \$name [:pick \$name 0 \$maxlen]\r\
    \n   :put \"\"\r\
    \n   :put \"\$name : Prefixes\"\r\
    \n   :put \"---------------------------\"\r\
    \n   :foreach name,prefix in=\$prefixes do={\r\
    \n      :set \$name (\$name.\"                              \")\r\
    \n      :set \$name [:pick \$name 0 \$maxlen]\r\
    \n      :put \"\$name : \$prefix\"\r\
    \n   }\r\
    \n}\r\
    \n"

However, it does not work very nicely because the [/routing/route/print count-only where belongs-to=“bgp-IP-$remote”] construct, which now correctly retrieves the number of routes, also outputs to the terminal instead of setting only the variable. This is a generic scripting bug, not specific to this situation. Of course when […] is used to get a value and then assign it to a variable, it should not be printed. Support says they will be reworking the scripting to resolve this, and it appears that part of that is now being done in 7.9beta.

Does anyone know if Mikrotik has plans to fix this? I’m in v7.8 and still appears 0 prefix as received. How can you see all the prefixes being received by one BGP session?

Thanks,

+1 for fixing the prefix counter!