Network map including bad_if interfaces

====================================
Component | Version
--------- | -------
LibreNMS  | 1.62.2
DB Schema | 2020_03_24_0844_add_primary_key_to_device_graphs (160)
PHP       | 7.3.14
MySQL     | 10.2.31-MariaDB-1:10.2.31+maria~bionic
RRDTool   | 1.7.2
SNMP      | NET-SNMP 5.8
====================================

[OK]    Installed from the official Docker image; no Composer required
[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN]  Updates are managed through the official Docker image

We primarily run Juniper routers at my site, and I have put in some time getting LibreNMS to ignore the magic Junos interfaces. In the end I logged into the database backend and set the list of interfaces to ‘disabled=1’ which is working well for the UI. All of these non-forwarding interfaces are listed both as bad_if and bad_if_regexp in config.php. (Incidentally, Librenms seems to ignore bad_if_regexp on discovery.)

I have my UI largely sorted, but the map generator, is still picking up Junos bme[01] interfaces and directly linking all of my Juniper routers together. These are QFX and EX devices that otherwise have no physical connections between them. This is the graph it produces. The round globs to the upper and lower left are full meshes of em0.0 or bme0.0 interfaces, which I have explicitly set as bad_if, bad_if_regexp and disabled in the database.

I tried marking these interfaces as deleted, but they keep repopulating into the database. I have also outright deleted these interfaces and they keep coming back. I have only been able to mark them disabled, but the map tool is not honoring that setting.

Any suggestions on how to eliminate these interfaces from my graph?

I did more digging on this and found a deleted Github post from 2017 that put me on a path to a workaround: https://webcache.googleusercontent.com/search?q=cache:mlpaAdnuDwYJ:https://github.com/librenms/librenms/issues/5133

In this post, there was reference to librenms/includes/html/print-map.inc.php, which has a list of mac-addresses to exclude from mapping that initially includes ‘000000000000’ and ‘ffffffffffff’.
M.mac_address NOT IN (‘000000000000’,‘ffffffffffff’,‘02000000000a’,‘000bcafe0000’,‘000bcafe0001’,‘020000000004’,‘200001000004’ ) AND

Junos bme and em devices use a short list of common hardware addresses, which I included in this list. The maps cleaned up, which provides a temporary workaround.

Since I am doing this in a container, I am mounting a patched version of this file over the one in the container, which is working for me for the time being.

Is there a better way to influence the map tool with a more common config.php like mechanism?

The answer ended up being to disable MAC based map rendering in the config with

$config['network_map_items'] = array('xdp');
1 Like