how to check a ifindex of the interface in router

Unanswered Question
Aug 28th, 2007
User Badges:

Dear All,


i am looking for a command which can tell me all the ifindex assigned to interface in router. i know that there is one command in catos show ifindex but i couldn't find the similar command in router.


please help.


thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (6 ratings)
Loading.
jreekers Wed, 08/29/2007 - 08:20
User Badges:
  • Cisco Employee,

Hi.


show ifindex and show port ifindex only exists on CAT code.

For CAT 6k running IOS (native IOS), there is no command for this info. So if you want to check what snmp index is associated with what port/interface, you can do this as you would do on any router (IOS):


You need to poll ifName and ifIndex from a host machine and then correlate the two output to see what snmp index is assigned to what port. It's easiest to do from a UNIX server, but if you load any of the freeware polling software on to a PC you can also do it. Here's an example of the poll, and what to look for:


% snmpwalk -c public 172.16.100.30 ifName


IF-MIB::ifName.1 = STRING: Gi1/1

IF-MIB::ifName.2 = STRING: Gi1/2

IF-MIB::ifName.3 = STRING: Gi5/1

IF-MIB::ifName.4 = STRING: Gi5/2

IF-MIB::ifName.5 = STRING: Gi5/3

IF-MIB::ifName.6 = STRING: Gi5/4

IF-MIB::ifName.7 = STRING: Gi5/5

IF-MIB::ifName.8 = STRING: Gi5/6

IF-MIB::ifName.9 = STRING: Gi5/7



% snmpwalk -c public 172.16.100.30 ifIndex


IF-MIB::ifIndex.1 = INTEGER: 1

IF-MIB::ifIndex.2 = INTEGER: 2

IF-MIB::ifIndex.3 = INTEGER: 3

IF-MIB::ifIndex.4 = INTEGER: 4

IF-MIB::ifIndex.5 = INTEGER: 5

IF-MIB::ifIndex.6 = INTEGER: 6

IF-MIB::ifIndex.7 = INTEGER: 7

IF-MIB::ifIndex.8 = INTEGER: 8

IF-MIB::ifIndex.9 = INTEGER: 9


From the above 2 outputs, Gi5/7 is snmp index 9.


ifName is Oid .1.3.6.1.2.1.31.1.1.1.1 and ifIndex is oid .1.3.6.1.2.1.2.2.1.1


Hope this helps.


-J

arumugam006 Fri, 08/31/2007 - 02:51
User Badges:

Hi,


Thanks a lot for your immediate response.


Arumugam M

axfalk Wed, 09/10/2014 - 06:07
User Badges:

is there a similar command for n5k?

Thanks.

-Greg

 

 

muca Wed, 09/10/2014 - 13:38
User Badges:

Try

 show interface snmp-ifindex


HTH

Don Muthukumarana Thu, 01/08/2015 - 05:30
User Badges:

In IOS XR, show snmp interface

 

ifName : TenGigE0/3/0/0        ifIndex : 1581
ifName : TenGigE0/3/0/1        ifIndex : 1582
ifName : TenGigE0/3/0/2        ifIndex : 1583
ifName : TenGigE0/3/0/3        ifIndex : 1584
ifName : TenGigE0/3/1/0        ifIndex : 1579
ifName : TenGigE0/3/1/1        ifIndex : 1580
ifName : Bundle-Ether100       ifIndex : 11105
ifName : Bundle-Ether101       ifIndex : 11106


...

Actions

This Discussion