How is SNMP ifIndex assigned to a interface?

This article provides describes the process of how a SNMP ifIndex is assigned to a interface and why the same interface may have a different ifIndex in two Junos devices.

How a SNMP ifIndex is assigned to a interface and why the same interface may have a different ifIndex in two Junos devices.

The SNMP ifIndex information stored in a text format file – dcd.snmp_ix, which is located in the /var/db folder.

When a new interface gets created in the system, mib2d checks for an entry of the interface in the file /var/db/dcd.snmp_ix. If the entry for this index is present, the system then picks the SNMP interface index value from this file, or else it assigns a new interface index value and writes it to this file.

Since the file is maintained across reboots, the next time somebody deletes and re-creates the same interface, the SNMP ifIndex does not change.

The assignment of the interface index primarily depends on the order in which it is created and if any old value of SNMP exists in the index of /var/db/dcd.snmp_ix.

So, there is no guarantee of the snmpindex values being the same on two different machines.

The /var/db/dcd.snmp_ix file stores SNMP indexes for the interfaces, using the following syntax:

For example, the SNMP ifIndex of ge-0/0/8 can be checked either in the /var/db/dcd.snmp_ix file or through the CLI command – show interface ge-0/0/8.

 

About the author

Prasanna

Leave a Comment