I have a few interfaces on my Cisco 2801 router, the interfaces are configured in different VRFs and all have the same IP address:

interface Loopback0
 ip address
interface Loopback1
 ip vrf forwarding RED
 ip address
interface Loopback2
 ip vrf forwarding BLUE
 ip address

When i use snmpbulkget on my linux machine to try and get the interface information, I only get the IP of one of the interfaces. This happens with loopbacks as well as physical interfaces. Any ideas on how I can get the rest of the interfaces in this case? Here is the the output from the snmpbulkget:

snmpbulkget -v 2c -c cisco123 .
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntAddr. = IpAddress:
IP-MIB::ipAdEntIfIndex. = INTEGER: 8
IP-MIB::ipAdEntIfIndex. = INTEGER: 7
IP-MIB::ipAdEntIfIndex. = INTEGER: 1
IP-MIB::ipAdEntIfIndex. = INTEGER: 5
IP-MIB::ipAdEntIfIndex. = INTEGER: 10

Notice that the address only returns once. All advice is appreciated, thanks!

  • 4
    That table is indexed by IP, so it can't have duplicate entries for the same address. Probably there is a more suitable MIB for your purposes somewhere. – richardb Aug 28 '14 at 10:41
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer. – Ron Maupin Jan 5 at 19:32

Essentially, you need to associate an SNMP context with a particular VRF.

The Cisco configuration guide - http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/snmp/configuration/12-4t/snmp-12-4t-book/nm-snmp-vpn-context.html

An example:

Router(config)# snmp-server context context1 // create a context named context1
Router(config)# ip vrf BLUE // enters VRF configuration mode
Router(config-vrf)#context context1 //Associates an SNMP context with a particular VRF
Router(config-vrf)# end

Note: In Cisco IOS Release 15.0(1)M and later releases, the context command is replaced by the snmp context command. See the Network Management Command Reference for more information.

Router(config)# snmp-server user customer1 group1 v3 // Configures a new user to an SNMP group
Router(config)# snmp-server group group1 v3 context context1 // associate a group with a context

Note: Users and groups only exist in SNMPv3 and groups should exist prior to adding users to them.

  • Link only answers are discouraged on all stack exchange sites. Please consider adding more details so this answer is useful even when the link isn't available (anymore) – Teun Vink Aug 27 '16 at 21:27
  • I have tried to comply with your request. I am not familiar with the markup used, feel free to edit. – alib_15 Aug 28 '16 at 6:00
  • 1
    For configurations, just highlight the text and press the Preformatted Text button: {}. – Ron Maupin Aug 28 '16 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.