Monday, September 9, 2013

Identification of interface Index IOS-XR 4.2.3


How to find the  SNMP ifIndex IDs on a  ASR9K IOS-XR.


Most network devices has some type of SNMP interface index numbers. In cisco and like most other devices, normally the ordering of the interface matches the ifindex number & for hard interfaces;

e.g

show ip int br

Interface              IP-Address      OK? Method Status                Protocol
GigabitEthernet0/1     unassigned      YES unset  down                  down   
GigabitEthernet0/2     unassigned      YES unset  up                    up      
GigabitEthernet0/3     unassigned      YES unset  down                  down   
GigabitEthernet0/4     unassigned      YES unset  down                  down   
GigabitEthernet0/5     unassigned      YES unset  up                    up     
GigabitEthernet0/6     unassigned      YES unset  down                  down   
GigabitEthernet0/7     unassigned      YES unset  down                  down   
GigabitEthernet0/8     unassigned      YES unset  down                  down   
GigabitEthernet0/9     unassigned      YES unset  down                  down   
GigabitEthernet0/10    unassigned      YES unset  up                    up     
GigabitEthernet0/11    unassigned      YES unset  up                    up     
GigabitEthernet0/12    unassigned      YES unset  up                    up     
GigabitEthernet0/13    unassigned      YES
( output truncated )

So gi0/1 would be ifIndex.1
     gi0/2 would be ifIndex.2
     gi0/3 would be ifIndex.3
     gi0/4 would be ifIndex.4
     gi0/5 would be ifIndex.5
and so on

After the real hard interfaces, any virtual interfaces would start at the next available number. Virtual interfaces would be vlan-SVI,tunnels, Null0, bridge-group-interfaces, loopbacks, etc……


You can use any of the following means to find the ifIndex numbers on IOS-XR to find the interface index numbers.


Method#1

(cmdline )

show snmp  interface gigabitEthernet 0/0/0/2 ifindex
Thu Sep  1 11:30:22.959 UTC
ifName : GigabitEthernet0/0/0/2  ifIndex : 445

Method#2

It requires that you enable ifindex persistence first;

config t
  snmp ifindex persist
commit

This does 2 things;

  • ·      It craft’s a persistence within the ifIndex  ( so if you add/remove a interface card or virtual-interfaces nothing changes )

  • ·      And this information is stored on the file-system disk and read by the OS

You can dir & more this file via the commands;

dir disk0:snmp/

and

more disk0:snmp/ifindex-table

NOTE: this is unix, so case sensitive is a must


Now why would we want to know the ifIndex #?

Simple, in monitoring, graphing and querying  interfaces, the known  ifIndex # can be very helpful. 

e.g

Great if you want to ensure that ifIndex.1 is really gi0/1 and not on tunnel 777.




Ken Felix
Freelance Network / Security Engineer
kfelix  ----a---t---socpuppets ---d---o---t---com

     ^      ^
=(  @   @ )=
          o
       /     \

No comments:

Post a Comment