IXP-Manager icon indicating copy to clipboard operation
IXP-Manager copied to clipboard

MRTG config generation: add IPv6 enable flag

Open lucix-mich opened this issue 2 years ago • 3 comments

Hello,

MRTG does still not enable IPv6 by default; you need to add a flag to mrtg.cfg to enable polling targets over IPv6. IXP Manager doesn't contain functionality to add the IPv6 enable flag if required, based on target switches management IP(v6).

The current mrtg.cfg template ($IXPROOT/resources/views/services/grapher/mrtg/header.foil.php) does not set the IPv6 enable flag as default. Looking over mrtg's IPv6 doc (https://oss.oetiker.ch/mrtg/doc/mrtg-ipv6.en.html), it seems safe to enable IPv6 support by default.

Hence, I propose to add this line to the mrtg template:

EnableIPv6: Yes

I see this as the easier solution versus determining programmatically if the flag is required in the current context. Of course one can patch the template locally, but that change would get overwritten on upgrades.

We are currently patching the generated mrtg config file, but that's also a hacky solution.

Thanks for considering this FR!

lucix-mich avatar Jul 28 '23 16:07 lucix-mich

definitely not a bad idea, but looking through the mrtg code + running a quick test, this enables a pile of internal code path changes and directly uses import Socket6, which redefines several low-level primitives including sub sockaddr_in6. It also changes how snmp calls are handled.

This needs to be tested before we can commit, as there's a chance it could break existing configs.

nickhilliard avatar Jul 28 '23 23:07 nickhilliard

One does not actually need to patch the template, but one may use resources/skins/<skin>/services/grapher/mrtg/custom-header.foil.php to add EnableIPv6: Yes to the final configuration.

agbcix avatar Oct 31 '25 13:10 agbcix

Second this, we could not figure out why our graphs weren't showing up after we changed to our IPv6 only management IPs until we found this line.

hermanl0 avatar Nov 12 '25 09:11 hermanl0