cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

63261
Views
55
Helpful
13
Replies
Beginner

how to check a ifindex of the interface in router

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

13 REPLIES 13
Enthusiast

Re: how to check a ifindex of the interface in router

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

Beginner

Re: how to check a ifindex of the interface in router

Hi,

Thanks a lot for your immediate response.

Arumugam M

Beginner

Re: how to check a ifindex of the interface in router

how to check ifindex of the interface in SG500X-24P series Switch

Beginner

how to check a ifindex of the interface in router

show snmp mib ifmib ifindex

Swap

CCIE # 19804

Beginner

is there a similar command

is there a similar command for n5k?

Thanks.

-Greg

 

 

Participant

Try show interface snmp

Try

 show interface snmp-ifindex


HTH

Beginner

thanks - that worked... _

thanks - that worked...

 

_ Greg

Highlighted

perfect worked like a charm

perfect worked like a charm

Beginner

Re: Try show interface snmp

Please let me know the cmd to check the ifIndex for SG500X-24P-K9. Switch

Thanks in advance

Beginner

Re: Try show interface snmp

Thanks that worked 

is there a similar command on

is there a similar command on IOS XR?

 

Thanks,

Adrian

In IOS XR, show snmp

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


...

Contributor

Re: how to check a ifindex of the interface in router

This worked, thanks!