Dnsmasq DHCPv6 config breaks DHCP table in the web interface

The issue I am facing:

Using custom dnsmasq configuration to provide IPv6 ULA addresses breaks the dhcp leases table in the web interface

Details about my system:

Device: Pi 5 with 64bit Pi OS 12
I am running a access point on wlan0 using: hostapd(wifi AP), radvd(IPv6 Router advertisements) and pihole-FTL/dnsmasq(DHCPv4 + DHCPv6)

Custom dnsmasq lines:

interface=eth0
interface=wlan0
interface=tailscale0
no-dhcp-interface=tailscale0
no-dhcp-interface=wlan1
no-dhcp-interface=eth0
dhcp-option=26,1450
dhcp-range=fd78:1426:def1:bebe::100,fd78:1426:def1:bebe::200,slaac,ra-names,64,12h

for DHCPv6 dhcp-range=fd78:1426:def1:bebe::100,fd78:1426:def1:bebe::200,slaac,ra-names,64,12h is important.

This will populate /etc/pihole/dhcp.leases with DHCPv6-related entries:

1751646371 e0:2e:0b:ac:XX:XX 172.30.0.65 redacted-hostname-1 01:e0:2e:0b:ac:XX:XX
1751640049 ea:30:d6:cd:XX:XX 172.30.0.19 redacted-hostname-2 01:ea:30:d6:cd:XX:XX
1751623879 0e:27:ac:b4:XX:XX 172.30.0.54 iPhone 01:0e:27:ac:b4:XX:XX
1751616718 72:61:22:17:XX:XX 172.30.0.36 * 01:72:61:22:17:XX:XX
duid 00:01:00:01:2f:2e:7d:71:2c:cf:67:a9:XX:XX
1750479972 165686795 fd78:1426:def1:bebe::181 redacted-hostname-1 00:01:00:01:2e:be:8b:77:e0:2e:0b:ac:XX:XX
1750457480 0 fd78:1426:def1:bebe::133 * 00:03:00:01:0e:27:ac:b4:XX:XX

The table for active dhcp leases in the web interface looks like this:

Debug token:
https://tricorder.pi-hole.net/CrLEPadk/

Your answer is not helpful. If I chatgpt would help here I could have asked it myself.
Copy-pasting chatgpt answers without even providing your own knowledge is useless.

Pi-hole is designed to work with custom dnsmasq configurations.
I am not asking you to "fix" my setup, rather to inform the devs about this issue.

3 Likes

The existing code somehow didn't expect IPv6 addresses and, hence, didn't reserve enough space, causing the address to spill over into adjacent fields. Fortunately, the fix is very simple:

1 Like

@darkexplosiveqwx - are you able to test the fix proposed? sudo pihole checkout ftl fix/api_ipv6

Just came across this discussion via the approval queue on Github, and cannot really speak to the fix as I neither use DHCP, nor IPv6 :slight_smile:

If you could let us know - that would be appreciated!

Thanks for the reminder, I simply forgot to report it as working after I tested it.

My response from GitHub:

The branch fix/api_ipv6 seems to be working, both for viewing and deleting DHCPv6 leases.

I have not looked into Static DHCP configuration for DHCPv6, but I think no one would want to micro-manage IPv6 ULAs.
Additionally DHCPv6 doesnt use MAC-addresses but instead some random number. That is, however, not a feature I`m interested in.

1 Like