[quagga-dev 8368] Expose announced routes through SNMP

Stephane Bagneris sbagneri at yahoo-inc.com
Tue Nov 23 19:31:50 GMT 2010

This is my first post so let me Introduce myself first.

Hello, my name is Stephane and I work at Yahoo! in the operation dept. Yahoo
uses Quagga (mainly bgpd/zebra) for some of its network infrastructure.
Unfortunately I do not believe I am at liberty to reveal exactly what we use
it for exactly, but suffice it to say, the plain unmodified code does a fine
job as far as I can tell.

For monitoring purposes, recently came the need to obtain the list of
announced routes from bgpd. That information is readily available using

> show ip bgp cidr-only
BGP table version is 0, local router ID is 216.xxx.xxx.xxx
Status codes: s suppressed, d damped, h history, * valid, > best, i -
              r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 6x.xxx.xxx.0/24                            32768 i
s> 6x.xxx.xxx.15/32                  1         32768 ?

Total number of prefixes 2

(sorry for the red tape and all the xxx in the IP¹s :P I have honestly no
idea what is NDA material or not)

While the telnet/vtysh method is fine for most purposes we actually need
this information to be exposed through SNMP. Looking at the MIB provided
with the latest version of quagga it seems only the list of ³received² path
attributes is available but not the list of announced or ³sent² path
attributes (I am also not sure about the terminology here).

Now I have actually implemented that feature and I can produce a patch from
the latest version (0.99.17). My code is mainly reusing a lot of the current
code already in place and disturbing as little of the vanilla code as
possible. It¹s probably buggy (I¹m an ops guys with some coding experience,
not a veteran coder) but it works. We would be very thankful if it could be
peer reviewed and eventually merged into the main tree. Perhaps for a future

Snmpwalk output on one of our sandbox looks as follow:

[sbagneri at yf0-2 ~]$ snmpwalk localhost bgp
BGP4-MIB::bgpVersion.0 = Hex-STRING: 10
BGP4-MIB::bgpLocalAs.0 = INTEGER: 7xxx

  ...edited for brevity...

BGP4-MIB::bgp. = IpAddress: 6x.xxx.xxx.0
BGP4-MIB::bgp. = IpAddress: 6x.xxx.xxx.15
BGP4-MIB::bgp. = INTEGER: 24 <--- prefixes (i.e. /24 and
BGP4-MIB::bgp. = INTEGER: 32 <--¹
BGP4-MIB::bgp. = INTEGER: 2 <-- true (i.e. Valid +
BGP4-MIB::bgp. = INTEGER: 1 <-- false (i.e. Anything

Now I am certain the above output may have some pulling their hair out due
to the fact that yes I am using custom OID¹s and that may be a Very Bad
Thing to do. I am not sure how to proceed with that issue however. Comments
are indeed requested. The idea has been thrown out that I ³might² be able to
use Yahoo¹s MIB for this purpose.

Anyhow that about sums it all up. Next I am wondering if posting the patch
to the list would be appropriate. Please let me know.


More information about the Quagga-dev mailing list