Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Bridge OID's indexed by different ifIndex values?

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

1 ACCEPTED SOLUTION

Accepted Solutions
New Member

Re: Bridge OID's indexed by different ifIndex values?

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.

4 REPLIES
Bronze

Re: Bridge OID's indexed by different ifIndex values?

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.

New Member

Re: Bridge OID's indexed by different ifIndex values?

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.

New Member

Re: Bridge OID's indexed by different ifIndex values?

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.

Blue

Re: Bridge OID's indexed by different ifIndex values?

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

493
Views
4
Helpful
4
Replies
CreatePlease to create content