Exclude host from DHCP needed

Hi all

I run PiHole in a Debian Buster container; everything works well.
Now I need to exclude 1 host (tv decoder) from the DHCP range otherwise it's not able to connect to the tv service from the provider.
Somehow it gets an address from the modem - that's the way it should be - although DHCP disabled there.

I tried to exclude the MAC address in "/etc/dnsmasq.d/10-local.conf" with

dhcp-host=aa:bb:cc:dd:ee:ff,ignore

which I found by chance while searching for hours but to no avail.
I guess this is because dnsmasq has been replaced but that's just a guess since I'm no linux expert at all.

Any idea how to solve this since this is a real PITA because the decoder keeps losing it's connection every few minutes, over and over again...

Thanks in advance!

dnsmasq has not been replaced. Since Pi-hole V4, it no longer runs as a separate process - the code is embedded in pihole-FTL. All existing dnsmasq configuration files will still work.

That doesn't seem to be the way it should be. If DHCP is disabled on the modem, and DHCP is enabled on the Pi-hole, the only DHCP server on your network should be Pi-hole and no other device should be providing IPs or DNS assignments.

Hi jfb

Thanks for picking this up!

Ok, so it's because dnsmasq is embedded in pihole-FTL that I couldn't a dnsmasq command that I found somewhere but cannot find it anymore right now...

The tv decoder is locked down so no possibility to change any settings.
Before it has worked this way by entering it's MAC address in that file but somehow - I guess because of some updates on Pi-Hole - this problem has rised again.

I also have no details on how it's done that the decoder has worked before without the DHCP scope on the modem activated.
Could it be because of VLAN's?

Any other suggestions?

By exempting a device from being assigned an IPv4 address via DHCP, you effectively shut it off from joining your IPv4 network - unless you are setting a suitable static IP address on that device.

By your own description, you cannot set anything on your TV decoder, so that rules out using a static IP. At the same time, you claim having disabled DHCP on your modem router (assuming that is a combo device, as a modem strictly would just be concerned with encoding and decoding your network data for transmission).

This leads to the assumption that Pi-hole would be the only remaining DHCP server on your network.

By configuring Pi-hole's DHCP to ignore your TV decoder, you would prevent it to communicate to anything beyond link-local, let alone the Internet.

Unless there is another router or dedicated DHCP server on your network you haven't mentioned yet, your configuration would not work for your TV decoder.

I can just guess that this isn't the state of affairs you are actually aiming at. Maybe what you want instead is to exclude your TV decoder's DNS traffic from being filtered by Pi-hole?

Could you add a bit detail to what you are actually trying to achieve?

Hi Bucking_Horn, thanks for jumping in!

I don't know how it's done that the (IPTV) decoder gets an IP - mostly the same from what I've seen - even with no DHCP server on the LAN, which has worked before after excluding the MAC address from the decoder on Pi-Hole as described above.
Yes, it's a modem/router combo.

To make things easier (using dynamic IP's and assign the right DNS on hosts) and because I couldn't change the DNS settings on the modem/router I activated the DHCP server from Pi-Hole and disabled the one on the modem/router.

What happens is that the decoder stops streaming every few minutes and displays a message to check the connection because it has lost it.
I don't see any requests from the decoder in the Query Log from Pi-Hole.

So the main goal is to get the decoder working flawlessly.

TIA

Is your TV decoder registering with a DHCP lease on Pi-hole's DHCP settings?

No, but after disabling the Pi-hole DHCP server, streaming works fine...

With Pi-hole's DHCP disabled, run the following command from a Terminal / console on your Pi-hole machine:

sudo dhcpcd -T

Please post the output here (I'll help with formatting if required).

v-piho:~# dhcpcd -T

dhcp6_listen: Address already in use
dhcp6_listen: Address already in use
eth0: using static address 192.168.1.3/24
interface='eth0'
pid='10917'
protocol='dhcp'
reason='TEST'
ifcarrier='up'
ifflags='4163'
ifmtu='1500'
ifwireless='0'
new_broadcast_address='192.168.1.255'
new_domain_name_servers='127.0.0.1'
new_ip_address='192.168.1.3'
new_network_number='192.168.1.0'
new_subnet_cidr='24'
new_subnet_mask='255.255.255.0'
dhcpcd exited

That is yet inconclusive.

Let's follow this up by two more commands.
a) for determining if DHCP ports are in use on your Pi-hole machine

sudo netstat -nltup | grep 'Proto\|:67 \|:547 '

b) for another way to try soliciting a DCHP lease from your network

sudo nmap --script broadcast-dhcp-discover

If that fails at first, you probably have to install nmap prior to running that (using sudo apt-get install nmap).

v-piho:~# netstat -nltup | grep 'Proto\|:67 \|:547 '
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:67              0.0.0.0:*                           13304/pihole-FTL

v-piho:~# nmap --script broadcast-dhcp-discover
Starting Nmap 7.70 ( https://nmap.org ) at 2020-04-11 07:33 UTC
Pre-scan script results:
| broadcast-dhcp-discover:
|   Response 1 of 1:
|     IP Offered: 192.168.1.61
|     DHCP Message Type: DHCPOFFER
|     Server Identifier: 192.168.1.3
|     IP Address Lease Time: 2m00s
|     Renewal Time Value: 1m00s
|     Rebinding Time Value: 1m45s
|     Subnet Mask: 255.255.255.0
|     Broadcast Address: 192.168.1.255
|     Domain Name Server: 192.168.1.3
|     Domain Name: xxx.xxx
|_    Router: 192.168.1.1
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 3.82 seconds

You should run those commands with Pi-hole's DHCP disabled.
Sorry I didn't remention that explicitly.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.