5

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 1.1.1.1 255.255.255.255
!
interface Loopback1
 ip vrf forwarding RED
 ip address 2.2.2.2 255.255.255.255
!
interface Loopback2
 ip vrf forwarding BLUE
 ip address 1.1.1.1 255.255.255.255

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 10.100.70.159 .1.3.6.1.2.1.4.20.1
IP-MIB::ipAdEntAddr.1.1.1.1 = IpAddress: 1.1.1.1
IP-MIB::ipAdEntAddr.2.2.2.2 = IpAddress: 2.2.2.2
IP-MIB::ipAdEntAddr.10.100.5.159 = IpAddress: 10.100.5.159
IP-MIB::ipAdEntAddr.10.111.5.45 = IpAddress: 10.111.5.45
IP-MIB::ipAdEntAddr.50.50.50.50 = IpAddress: 50.50.50.50
IP-MIB::ipAdEntIfIndex.1.1.1.1 = INTEGER: 8
IP-MIB::ipAdEntIfIndex.2.2.2.2 = INTEGER: 7
IP-MIB::ipAdEntIfIndex.10.100.5.159 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.10.111.5.45 = INTEGER: 5
IP-MIB::ipAdEntIfIndex.50.50.50.50 = INTEGER: 10

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

2
  • 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
2

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.

3
  • 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.