Number interface in snmp

How to renumber an interface in snmp?


2022-12-01.png

SNMP typically reports an interface index provided by the underlying OS, or from how it has built its index whilst enumerating the interfaces. There is no mechanism with SNMP to change this.

Enumerating the interfaces in underlying OS

Numbering does not match.
1.png

The UI interface index is not the same, see what you get from /interface print oid - the final octet of the OIDs are the SNMP interface index.

0 R name=.1.3.6.1.2.1.2.2.1.2.1
1 S name=.1.3.6.1.2.1.2.2.1.2.7
2 S name=.1.3.6.1.2.1.2.2.1.2.3
3 RS name=.1.3.6.1.2.1.2.2.1.2.4
4 S name=.1.3.6.1.2.1.2.2.1.2.5
5 R name=.1.3.6.1.2.1.2.2.1.2.2
6 R name=.1.3.6.1.2.1.2.2.1.2.10
7 RS name=.1.3.6.1.2.1.2.2.1.2.9
8 R name=.1.3.6.1.2.1.2.2.1.2.8
9 R name=.1.3.6.1.2.1.2.2.1.2.6

Can this be changed?

No directly. As mentioned before Mikrotik builds an index whilst enumerating interfaces - each new interface is assigned a sequentially increasing value which does not change.

It is odd that the ethernet interfaces are not sequential as they would be discovered after a factory reset and cannot be removed via the UI, for example:
RB750Gr2 ifIndex 1-5=ether1-5
RB850Gx2 ifIndex 1-5=ether1-5
RB960PGS ifIndex 1-5=ether1-5, 6=sfp1
RB3011UiAS ifIndex 1-5=ether1-5, 6=sfp1, 7-11=ether6-10