<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>First, thank you for dnsmasq!</div><div><br></div><div>I'm among a number of people[1][2][3][4] having trouble using dnsmasq for DHCP when it is running in a docker container. Everyone seems to get "no address range available for DHCP request via eth0" in their log unless they change to host networking mode.</div><div><br></div><div>The code path for that error message is at [5]. I'm having a little trouble understanding the 'contexts', but I think the problem is that the container is running in bridged networking mode, and thus the interface has an IP address outside the netmask range.</div><div><br></div><div>Is there a way to make this work without using host networking? Maybe adding the external IP to the container interface? Thank you for any suggestions!</div><div><br></div><div>Relevant sample configuration:</div><div><div><font face="monospace, monospace">addn-hosts=/etc/pihole/gravity.list</font></div><div><font face="monospace, monospace">addn-hosts=/etc/pihole/black.list</font></div><div><font face="monospace, monospace">addn-hosts=/etc/pihole/local.list</font></div><div><font face="monospace, monospace">localise-queries</font></div><div><font face="monospace, monospace">no-resolv</font></div><div><font face="monospace, monospace">cache-size=10000</font></div><div><font face="monospace, monospace">log-queries=extra</font></div><div><font face="monospace, monospace">log-facility=/var/log/pihole.log</font></div><div><font face="monospace, monospace">local-ttl=2</font></div><div><font face="monospace, monospace">log-async</font></div><div><font face="monospace, monospace">server=8.8.8.8</font></div><div><font face="monospace, monospace">server=8.8.4.4</font></div><div><font face="monospace, monospace">interface=eth0</font></div><div><font face="monospace, monospace">dhcp-authoritative</font></div><div><font face="monospace, monospace">dhcp-range=192.168.1.200,192.168.1.251,24h</font></div><div><font face="monospace, monospace">dhcp-option=option:router,192.168.1.1</font></div><div><font face="monospace, monospace">dhcp-leasefile=/etc/pihole/dhcp.leases</font></div><div><font face="monospace, monospace">domain=local</font></div></div><div><br></div><div><div><font face="monospace, monospace">root@6082bda95199:/# ip a</font></div><div><font face="monospace, monospace">1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000</font></div><div><font face="monospace, monospace">    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00</font></div><div><font face="monospace, monospace">    inet <a href="http://127.0.0.1/8">127.0.0.1/8</a> scope host lo</font></div><div><font face="monospace, monospace">       valid_lft forever preferred_lft forever</font></div><div><font face="monospace, monospace">10: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default</font></div><div><font face="monospace, monospace">    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0</font></div><div><font face="monospace, monospace">    inet <b><a href="http://172.17.0.2/16">172.17.0.2/16</a></b> brd 172.17.255.255 scope global eth0</font></div><div><font face="monospace, monospace">       valid_lft forever preferred_lft forever</font></div></div><div><br></div><div>To reproduce, you can run something like what is in [6], then enabling the DHCP server through the non-ssl web interface. `docker exec -it pihole /bin/bash` to get into the container and `tail -f /var/log/pihole.log` for the log. </div><div><br></div><div>[1] <a href="https://github.com/pi-hole/docker-pi-hole/issues/355">https://github.com/pi-hole/docker-pi-hole/issues/355</a></div><div>[2] <a href="https://discourse.pi-hole.net/t/dhcp-not-working-docker/12593">https://discourse.pi-hole.net/t/dhcp-not-working-docker/12593</a></div><div>[3] <a href="https://discourse.pi-hole.net/t/no-address-range-available-for-dhcp-request-via-eth0/14350">https://discourse.pi-hole.net/t/no-address-range-available-for-dhcp-request-via-eth0/14350</a></div><div>[4] <a href="https://serverfault.com/questions/825497/running-dnsmasq-in-docker-container-on-debian-check-dhcp-ignores-dnsmasq">https://serverfault.com/questions/825497/running-dnsmasq-in-docker-container-on-debian-check-dhcp-ignores-dnsmasq</a></div><div>[5] <a href="http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/rfc2131.c;h=56dc3d103741baeb68a730f0ce15a10338a2f885;hb=91421cb7575df7bb211dacc30dc7c7c715c38299#l345">http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/rfc2131.c;h=56dc3d103741baeb68a730f0ce15a10338a2f885;hb=91421cb7575df7bb211dacc30dc7c7c715c38299#l345</a><br></div><div>[6] <a href="https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh">https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh</a></div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:large"><div>Craig Younkins<br></div></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>