[c-nsp] howto get next-hop information via SNMP

Per Carlson lists at ip4all.net
Tue Mar 14 08:28:22 EST 2006


On Tue Mar 14 15:04:23 2006 +0200, Emanuel Popa wrote:

> We are trying to find out the next-hop for a specified IP address via
> SNMP from a Cisco 7600 router. The information would be used to
> redirect abuse requests automatically to the abuse department from a
> different region.
>
> Has anybody done this in an elegant manner?

if the 7600 supports the IP-FORWARD-MIB, you could just snmpwalk
one instance. for example:

mgmt$ snmpwalk <router> ipCidrRouteNextHop.192.168.1.140
IP-FORWARD-MIB::ipCidrRouteNextHop.192.168.1.140.255.255.255.255.0.172.17.0.1
= IpAddress: 172.17.0.1

the only thing you need to do is append the dotted decimal
IP-address after the ipCidrRouteNextHop object. the netmask is not
needed, but could be useful if you have several prefixes with
different netmasks.

the cotcha is whether the 7600 supports the MIB or not. the one in
our lab doesn't...

mgmt(per)$ snmpwalk <7600> ipCidrRouteNextHop
IP-FORWARD-MIB::ipCidrRouteNextHop = No Such Object available on
this agent at this OID

BTW, our 7600 is currently running:

mgmt$ snmpwalk <7600> sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Cisco Internetwork Operating
System Software
IOS (tm) c6sup2_rp Software (c6sup2_rp-PSV-M), Version 12.1(26)E6,
RELEASE SOFTWARE (fc1)

-- 
Per Carlson, Sr. Network Developer


More information about the cisco-nsp mailing list