[c-nsp] Catalyst 6500 Snmp IfIndex Assignment Logic

Phil Mayers p.mayers at imperial.ac.uk
Fri Dec 9 02:45:20 EST 2011

On 12/09/2011 12:47 AM, Michael Balasko wrote:
> All,
> For the TL:DR crowd- Does anyone know dead nuts how the Catalyst 6500
> allocates SNMP ifindex numbers? Specifically the 6513/Sup720-10Gig?

Sort of.

It does it sequentially based on interface creation in my experience. If 
you take a completely empty box, chances are Te1/1 will have ifindex 1, 
Te1/2 ifindex 2, and so on.

For example, we have a "been in service long time" box, and the ifindex 
values are:

Te1/1 = 1
Te1/2 = 2
Te1/3 = 3
Te1/4 = 4
Gi5/1 = 5
Gi5/2 = 6
Gi6/1 = 7
Gi6/2 = 8
Gi8/1 = 9

...and when this chassis was intially powered up, it had a 6704 in slot 
1, sup720 in slot 5 & 6, and SFP linecard in slot 8 & 9. The ifindex 
values climb sequentially through those cards until I reach virtual 

Vlan1 = 105
EOBC0/0 = 106
Null0 = 107
Loop1 = 108
Loop2 = 109

...and then into SVIs and such. As far as my memory can tell, the 
ifindex values seem to be sequential for when I created the SVIs; 
likewise, the newer linecards in other slots have much higher ifindex 

So, I reckon it's sequential, but I can't explain why you're seeing 
other behaviour.

You've already indicated you're aware of the ability to persist ifindex 
values, but it sounds like you want to control the assignment of new ones?

> Subtext: We are converting our Core infrastructure switches from
> CatOS to IOS(YAY!)  and we have nearly 500 devices plugged into EACH
> of these monsters(WOW). The ifindexes of course are going to change
> and I would like to be able to predict them (HAHAHAH) to what they
> will be and or figure out if I can manipulate them such that I can
> have a script ready to realign our monitoring and trending systems.

I'm afraid not. AFAIK you can't specify an ifindex (which seems like it 
would be a pretty trivial feature - one global command for an 
"automatic" ifindex range, one per-interface command for a static value, 
presumably outside of that range).

I would plan to instead use snmp against e.g. ifName before and after, 
and upgrade your NMS. Tedious I know (especially if you are using 
something horrible, like Cacti ;o)

The only other suggestion I can make is to try copying the ifindex 
persist file for CatOS and IOS off - they might be the same format, or 
if not, it might be possible to convert one to the other, and "force" 
the IOS box to read the persist file.

More information about the cisco-nsp mailing list