SNMP IfIndex Persistence on wlan0,wlan1 interfaces?

Hi all,
How to get SNMP IfIndex Persistence on wlan0,wlan1 interfaces?

The SNMP ifIndex persistence feature provides an interface index (ifIndex) value that is retained and used when the OpenWRT reboots. The ifIndex value is a unique identifying number associated with a physical or logical interface.

There is no requirement in the relevant RFCs that the correspondence between particular ifIndex values and their interfaces be maintained when the switch reboots, but many applications (for example, device inventory, billing, and fault detection) require maintenance of this correspondence.

I am running OpenWRT 18.06 on the Xiaomi Mi R3G and use snmpd for monitoring of the system to collect traffic data from wlan0,wlan1 interfaces. Each time after system reboot wlan interfaces have new IfIndexes and and new SNMP OIDs should be used for collecting data.
Please advice how to solve this problem.

Are you certain that this occurs on a reboot, and not after:

  • edits of the interfaces; or
  • performing an ifup/ifdown?

Also, I've had success using interface name over index, for the 2 reasons I noted above.

Thanks, I will use interface names instead of raw OIDs.