Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

MIB for "show ifindex" on Catalyst 6500

Which MIB do I have to use to obtain the information displayed by the

"show ifindex" command on a Catalyst 6500?

1 REPLY
Blue

Re: MIB for "show ifindex" on Catalyst 6500

The portIfIndex (.1.3.6.1.4.1.9.5.1.4.1.1.11) from CISCO-STACK-MIB will give you the same information as the CLI command sh port ifindex on the switch.

% snmpwalk .1.3.6.1.4.1.9.5.1.4.1.1.11

enterprises.9.5.1.4.1.1.11.2.1 = 3

enterprises.9.5.1.4.1.1.11.2.2 = 4

enterprises.9.5.1.4.1.1.11.3.1 = 11

enterprises.9.5.1.4.1.1.11.3.2 = 12

enterprises.9.5.1.4.1.1.11.3.3 = 13

...

...

In the above example 2.1 = port 2/1 and 3 = ifIndex

For the CLI command sh ifindex on the switch, it's a two step process. First you need to poll the ifName (.1.3.6.1.2.1.31.1.1.1.1) from the IF-MIB to get the name on the switch:

% snmpwalk .1.3.6.1.2.1.31.1.1.1.1

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.1 = sc0

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.2 = sl0

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.3 = 2/1

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.4 = 2/2

ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.5 = VLAN-1

....

....

and then poll the ifIndex (.1.3.6.1.2.1.2.2.1.1) to get the corresponding ifIndex values:

% snmpwalk .1.3.6.1.2.1.2.2.1.1

interfaces.ifTable.ifEntry.ifIndex.1 = 1

interfaces.ifTable.ifEntry.ifIndex.2 = 2

interfaces.ifTable.ifEntry.ifIndex.3 = 3

interfaces.ifTable.ifEntry.ifIndex.4 = 4

interfaces.ifTable.ifEntry.ifIndex.5 = 5

....

....

So, in the above example, port 2/1 has ifIndex of 3 etc.

865
Views
0
Helpful
1
Replies