Juniper MX snmp oid for static route

juniperjuniper-mx

Hoping someone has an oid to poll (get/walk) an MX router to retrieve configured static route information and next-hop? Searched MIBs and mib walks on router to no avail.

Thanks!

Best Answer

The best you'll be able to get is inetCidrRouteTable from IP-FORWARD-MIB - this will give you all routes, regardless of protocol.

The OID is .1.3.6.1.2.1.4.24.7 and if you walk it, you'll see a table of entries.

The format of entries is:

IP-MIB::ip.24.7.1.7.1.4.0.0.0.0.0.2.0.0.1.4.10.0.0.254 = INTEGER: 13
                        |     | |           |        |
                Prefix (0.0.0.0)| Next Hop (10.0.0.254)
                 CIDR Mask (/0)-+

If you're specifically after static routes, I would recommend ditching SNMP, and instead use the Junos REST API (available from Junos 15.1 onwards), or NETCONF calls via PyEZ.