Bridge OID's indexed by different ifIndex values?

Answered Question
Jan 31st, 2008
User Badges:

Hello,

To check the status of spanning-tree on the ports of my switches (on vlan1), I do an snmpwalk on object dot1dStpPortState (1.3.6.1.2.1.17.2.15.1.3) of BRIDGE-MIB


snmpwalk -v 2c -c public myhost 1.3.6.1.2.1.17.2.15.1.3

SNMPv2-SMI::mib-2.17.2.15.1.3.40 = INTEGER: 5

SNMPv2-SMI::mib-2.17.2.15.1.3.48 = INTEGER: 5


I get what I want (even if I have to specify the OID numerically and not symbolically: why?).

Both ports are forwarding (status = 5). Good! But what are the two ports 40 and 48 of spanning-tree?

simple:


c3524p41>show spanning-tree


Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol

------ cut -----

Interface Gi0/1 (port 40) in Spanning tree 1 is FORWARDING

------ cut -----


Interface Gi0/2 (port 48) in Spanning tree 1 is FORWARDING

------ cut -----


I thought that 40 and 48 were the ifIndex value of the interfaces. But if I do a check of ifDescr via snmp, I get the following values that say that my GigabitEthernets are interfaces number 26 and 27:


snmpwalk -v 2c -c public myhost ifDescr

IF-MIB::ifDescr.1 = STRING: VLAN1

IF-MIB::ifDescr.2 = STRING: FastEthernet0/1

------ cut -----

IF-MIB::ifDescr.25 = STRING: FastEthernet0/24

IF-MIB::ifDescr.26 = STRING: GigabitEthernet0/1

IF-MIB::ifDescr.27 = STRING: GigabitEthernet0/2

IF-MIB::ifDescr.28 = STRING: Null0

IF-MIB::ifDescr.29 = STRING: VLAN1

IF-MIB::ifDescr.30 = STRING: VLAN1


Can someone explain me what are 40 and 48 numbers? And above all, how can I relate 40 and 48 with ifDescr (26 and 27) and find which are the ports in forwarding (or blocking)?

Thanks in advance.

piero



Correct Answer by bilousand about 9 years 3 months ago

Sometimes it's puzzling what index do they use. Wild guess - dot1dStpPort will match with dot1dBasePort from the table dot1dBasePortTable and this table contains dot1dBasePortIfIndex which will match ifIndex from IF-MIB.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
cpubob Thu, 01/31/2008 - 08:56
User Badges:
  • Bronze, 100 points or more

Easy question, "I have to specify the OID numerically and not symbolically: why?" - The mib that references that OID is not loaded.

See the attached screen capture for my example, I am using netsnmp.


As to why your ifindex doesn't match, I cannot say. On my 2950, both numbers match. It could be any number of things, so I would suggest opening a tac case to get an official answer or to get a fix.



Correct Answer
bilousand Thu, 01/31/2008 - 09:46
User Badges:

Sometimes it's puzzling what index do they use. Wild guess - dot1dStpPort will match with dot1dBasePort from the table dot1dBasePortTable and this table contains dot1dBasePortIfIndex which will match ifIndex from IF-MIB.

sisal Mon, 02/04/2008 - 03:27
User Badges:

You are correct. Getting dot1dBasePortIfIndex for the PORT-ID (in my previous example 40 and 48), I retrieve the ifIndex and as a consequence ifDescr.

Thank you.

yjdabear Thu, 01/31/2008 - 10:35
User Badges:
  • Gold, 750 points or more

The numbers in parentheses from "show spanning-tree detail" are Port IDs, not SNMP ifIndex numbers.


Actions

This Discussion