cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
981
Views
0
Helpful
1
Replies

How to ask the next-hop of a route?

albertbc79
Level 1
Level 1

Hi,

I'm trying to get via snmp the next-hop address of the default route or the interface via it's known.

Before It got deprecated, I used .1.3.6.1.2.1.4.21.1.7.0.0.0.0 (ipRouteNextHop). It returned the next-hop address of the 0.0.0.0, in this case.

Now, I use the new MIB (ipCidrRouteNextHop or inetCidrRouteNextHop). The issue is that I muss attach to the snmp string the mask and the next-hop address of the default route to the snmp string:

.1.3.6.1.2.1.4.24.4.1.4.0.0.0.0.0.0.0.0.0.10.128.250.12

And the fact it that I don't previously know the next-hop address. So, is there any way to ask the router which is the protocol next-hop or the next-hop address only attaching the 0.0.0.0 to the snmp string?

Thanks in advance,

Albert.

1 Reply 1

albertbc79
Level 1
Level 1

Well, I answer myself.

Instead of using snmpget, use snmpgetnext like following:

.1.3.6.1.2.1.4.24.4.1.4.0.0.0.0