Community discussions

MikroTik App
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

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

Tue Apr 25, 2023 8:37 pm

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).

Image
 
DarkNate
Forum Veteran
Forum Veteran
Posts: 997
Joined: Fri Jun 26, 2020 4:37 pm

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

Tue Apr 25, 2023 10:04 pm

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
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

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

Tue Apr 25, 2023 10:10 pm

Anyone from Mikrotik support team?

Best regards,
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

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

Tue Apr 25, 2023 10:11 pm

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
Thank you @DarkNate, I hope Mikrotik solves this bug soon
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

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

Tue Apr 25, 2023 11:13 pm

received routes can be seen in /routing route menu, with appropriate params and count-only you can see the number.
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

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

Wed Apr 26, 2023 8:53 am

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
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

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

Wed Apr 26, 2023 8:58 am

Just look at available parameters, bgp.peer-cache-id or belongs-to is the easiest to get all routes from the peer.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

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

Wed Apr 26, 2023 12:42 pm

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

v7 only code

/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"
}
 
CharlieB
just joined
Posts: 3
Joined: Tue May 30, 2023 11:15 pm

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

Tue May 30, 2023 11:42 pm

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.
 
CharlieB
just joined
Posts: 3
Joined: Tue May 30, 2023 11:15 pm

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

Sat Jun 10, 2023 6:56 pm

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.
 
CharlieB
just joined
Posts: 3
Joined: Tue May 30, 2023 11:15 pm

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

Sat Jun 10, 2023 6:58 pm

v7 only code

/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"
}
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?)
 
User avatar
Cha0s
Forum Guru
Forum Guru
Posts: 1135
Joined: Tue Oct 11, 2005 4:53 pm

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

Sun Jun 11, 2023 9:39 pm

and to my understanding, that also existed in previous Mikrotik software versions.
BGP stats over SNMP was never available on MikroTik.
We just got some SNMP support in 7.10rc.
 
scotth
just joined
Posts: 2
Joined: Mon Oct 09, 2023 2:56 am

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

Thu Oct 12, 2023 4:26 am

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
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.

Who is online

Users browsing this forum: No registered users and 14 guests