cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2154
Views
4
Helpful
2
Replies

ifindex question

toyinsekoni
Level 1
Level 1

Can some please tell me if there is a command on catalyst 2950 to determine the ifindex of a particular port when the system boots (i need to know the index before i "persist" it). Using ios 12.1(22)EAS.

Thanks

D.

2 Replies 2

smothuku
Level 7
Level 7

Hi ,

In order to find out the ifIndex on IOS based 2950 or other devices, you need to poll the MIB Object

ifIndex itself. Here are the steps in the following example below:

1) Poll the MIB Object ifDescr (.1.3.6.1.2.1.2.2.1.2) on your switch using any of the SNMP polling tools/apps that you have. In this example, the UCD-SNMP Free Ware CLI based tool is used.

% snmpwalk 172.16.99.90 public .1.3.6.1.2.1.2.2.1.2

interfaces.ifTable.ifEntry.ifDescr.1 = VLAN1

interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet0/1

interfaces.ifTable.ifEntry.ifDescr.3 = FastEthernet0/2

interfaces.ifTable.ifEntry.ifDescr.4 = FastEthernet0/3

interfaces.ifTable.ifEntry.ifDescr.5 = FastEthernet0/4

interfaces.ifTable.ifEntry.ifDescr.6 = FastEthernet0/5

interfaces.ifTable.ifEntry.ifDescr.7 = FastEthernet0/6

interfaces.ifTable.ifEntry.ifDescr.8 = FastEthernet0/7

interfaces.ifTable.ifEntry.ifDescr.9 = FastEthernet0/8

interfaces.ifTable.ifEntry.ifDescr.10 = FastEthernet0/9

interfaces.ifTable.ifEntry.ifDescr.11 = FastEthernet0/10

interfaces.ifTable.ifEntry.ifDescr.12 = FastEthernet0/11

interfaces.ifTable.ifEntry.ifDescr.13 = FastEthernet0/12

interfaces.ifTable.ifEntry.ifDescr.14 = FastEthernet0/13

interfaces.ifTable.ifEntry.ifDescr.15 = FastEthernet0/14

interfaces.ifTable.ifEntry.ifDescr.16 = FastEthernet0/15

interfaces.ifTable.ifEntry.ifDescr.17 = FastEthernet0/16

interfaces.ifTable.ifEntry.ifDescr.18 = FastEthernet0/17

interfaces.ifTable.ifEntry.ifDescr.19 = FastEthernet0/18

interfaces.ifTable.ifEntry.ifDescr.20 = FastEthernet0/19

interfaces.ifTable.ifEntry.ifDescr.21 = FastEthernet0/20

interfaces.ifTable.ifEntry.ifDescr.22 = FastEthernet0/21

interfaces.ifTable.ifEntry.ifDescr.23 = FastEthernet0/22

interfaces.ifTable.ifEntry.ifDescr.24 = FastEthernet0/23

interfaces.ifTable.ifEntry.ifDescr.25 = FastEthernet0/24

interfaces.ifTable.ifEntry.ifDescr.26 = Null0

interfaces.ifTable.ifEntry.ifDescr.27 = VLAN2

2) Then poll the ifIndex (.1.3.6.1.2.1.2.2.1.1) on the above switch and then correlate the result

with that of the above to see which ifIndex corresponds to which port/interface on the device:

% snmpwalk 172.16.99.90 public .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

interfaces.ifTable.ifEntry.ifIndex.6 = 6

interfaces.ifTable.ifEntry.ifIndex.7 = 7

interfaces.ifTable.ifEntry.ifIndex.8 = 8

interfaces.ifTable.ifEntry.ifIndex.9 = 9

interfaces.ifTable.ifEntry.ifIndex.10 = 10

interfaces.ifTable.ifEntry.ifIndex.11 = 11

interfaces.ifTable.ifEntry.ifIndex.12 = 12

interfaces.ifTable.ifEntry.ifIndex.13 = 13

interfaces.ifTable.ifEntry.ifIndex.14 = 14

interfaces.ifTable.ifEntry.ifIndex.15 = 15

interfaces.ifTable.ifEntry.ifIndex.16 = 16

interfaces.ifTable.ifEntry.ifIndex.17 = 17

interfaces.ifTable.ifEntry.ifIndex.18 = 18

interfaces.ifTable.ifEntry.ifIndex.19 = 19

interfaces.ifTable.ifEntry.ifIndex.20 = 20

interfaces.ifTable.ifEntry.ifIndex.21 = 21

interfaces.ifTable.ifEntry.ifIndex.22 = 22

interfaces.ifTable.ifEntry.ifIndex.23 = 23

interfaces.ifTable.ifEntry.ifIndex.24 = 24

interfaces.ifTable.ifEntry.ifIndex.25 = 25

interfaces.ifTable.ifEntry.ifIndex.26 = 26

interfaces.ifTable.ifEntry.ifIndex.27 = 27

Comparing the two, I see that ifIndex.1= 1 is that for FastEthernet0/1

Check the below link.

http://www.cisco.com/warp/customer/477/SNMP/mactoport44800.html

I found some commands that will reveal the ifindex on the cat 2950.

Please see the link below.

http://www.cisco.com/en/US/partner/products/hw/switches/ps4916/products_command_reference_chapter09186a008013135c.html

***** The CLI commands 'show port ifindex' is only available on Cat switches running CatOS

Hope it helps you.

Thanks,

satish

Hi Satish,

Thanks a lot, but unfortunately, i do not have a username and password for the links you provided. I supplied the one i used in registration but wasn't authrnticated. How do i get register for this particular level anyway? Where can i get the UCD-SNMP Free Ware CLI based tool (online or in the switch).

Thanks

NB.

from your polling, i actually think fa0/1 is ifindex 2 while ifindex 1 is VLAN 1, right?

D.