I want to query the OID for wlan2 MAC address on my hAP ac.
While I am able to use both
/interface/print oid
and
SnmpWalk.exe
to identify the OID for a specific device/configuration, the OID for wlan2 is not identical for different hAP acs (and I believe for different configurations).
Is there a way to query the MAC address of specifically the wlan2 interface, independent of device/configuration?
I saw some other OIDs that point to the MAC (not in XX:XX:.. but in XX XX … format), but how do I know they will not change?
I’m not sure exactly how they map it, but I believe the order interface were added matters in the indexing. So if the config wasn’t created from some script (e.g. you added or removed an interface), the OID may vary.
So I do two SNMP querys to fix. One to find names, and then another using another query using the SNMP index of the name, to get the specific data. e.g. iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifIndex value has the index needed for the 2nd query with the data point I want.
Basically my understanding is the OID is assigned when the interface is added using the next index available.
This is correct, and Dynamic interfaces are the same but start at a much higher number
The correct way is always to walk the whole interface MIB, using the matching name to figure out the index, then you have the index to query what you want/need. “some” SNMP based systems also allow indexing by name to avoid things like dynamic indexes changing etc, but that’ll depend on your exact setup.