LibreNMS and dynamic interfaces - issue with interface index numbers (RFC2863)

When interface reinitializes or restarts it gets new index number, and LibreNMS sees it as new interface instead as same interface that just restarted.

As you can see in this image usb LTE interface has interface number 66 and OpenVPN tun1 interface has number 67…

On each interface restart they get new interface numbers, and LibreNMS then shows stats from last interface restart but all older data is lost :frowning:

I’m looking at RFC2863 and changing of interface ID-a should be tolerated when driver is reinitialized:

3.1.5. Interface Numbering
MIB-II defines an object, ifNumber, whose value represents:

“The number of network interfaces (regardless of their current state) present on this system.”

Each interface is identified by a unique value of the ifIndex object, and the description of ifIndex constrains its value as follows:

“Its value ranges between 1 and the value of ifNumber. The value for each interface must remain constant at least from one re-initialization of the entity’s network management system to the next re-initialization.”

Is there a way to setup LibreNMS so that is tracks interface name and not interface number? So even if my tun1 interface goes from 5 to 5000 it still shows graphs and data from start to finish?

This is covered in our docs + has been discussed here and on github before. But yes, you can.

1 Like

That is great news! I looked into docs before posting this question and I couldn’t find it. I also searched trough git issues and also couldn’t find anything.

I’m probably using wrong keywords for search, so if you can point me in the right direction I would be really grateful. Thanks!

Original conversation started here:

port association mode. You can edit the device and choose how you want to associate the ports.

1 Like

Ok, so solution is simple, at least in my case. I just made all nodes use ‘ifname’ instead ‘ifindex’ and this fixed the issue for me. Thanks!