25.1.11 - Dnsmasq tries to bind DHCP although all Interfaces are [no dhcp]

Started by phaze75, July 16, 2025, 12:08:19 PM

Previous topic - Next topic
I just updated to 25.1.11 and my network is shot. Dnsmasq service won't start, throwing the error ,,failed to bind DHCP Server socket: Address already in use".

It tries to bind its DHCP socket although all interfaces are configured [no dhcp] within Dnsmasq Gerneral settings. I still use ISC DHCPv4, hence the conflict.

I guess this might be a bug in this release. Anyone else experiencing this?

I think the reboot did it. The rest is configuration. Maybe you stopped ISC manually to let Dnsmasq run.


Cheers,
Franco



As soon as a dhcp-range is defined in dnsmasq, it will try to bind port 67 to either all interfaces, or the interfaces defined with the strict interface setting in advanced mode.

no dhcp will just ignore DHCP packets, but it will not unbind from port 67 as long as there are defined dhcp-ranges.
Hardware:
DEC740

Quote from: Monviech (Cedrik) on July 16, 2025, 05:01:55 PMAs soon as a dhcp-range is defined in dnsmasq, it will try to bind port 67 to either all interfaces, or the interfaces defined with the strict interface setting in advanced mode.

no dhcp will just ignore DHCP packets, but it will not unbind from port 67 as long as there are defined dhcp-ranges.

Thanks, that must be it! I have had a DHCP-range defined, because I wanted to switch from ISC-DHCP to dnsmasq-DHCP some time ago. I have stopped in midcourse and have left the DHCP-range as defined. I just have set [no dhcp] for all interfaces.

So I guess I will spend this evening and finally finish what I have started... ;-)

Quote from: Monviech (Cedrik) on July 16, 2025, 05:01:55 PMAs soon as a dhcp-range is defined in dnsmasq, it will try to bind port 67 to either all interfaces, or the interfaces defined with the strict interface setting in advanced mode.

no dhcp will just ignore DHCP packets, but it will not unbind from port 67 as long as there are defined dhcp-ranges.

You were right. I needed the better part of yesterday's (late) evening to confirm this. Btw: Is this behavior intentional? It seems a bit unintuitive not to say awkward tbh.

Anyway, at first, I tried to finish my half-baked migration from ISC DHCPv4 to dnsmasq DNS & DHCP, but although following the documentation by the word, recreating all hosts, DHCP ranges and DHCP options, I ended up in a complete mess. dnsmasq's DNS & DHCP service was running, debug logs were flawless, but it persistently failed to serve my hosts - whether connecting via LAN or WLAN. I must have checked, set and unset the [no dhcp] flags at least a dozen times, I restarted the service, I restarted the firewall. Nothing. Around midnight my frustration had grown that big, that I have eradicated all changes made to dnsmasq DNS & DHCP and set the [no dhcp] flags again for all adapters. So, I could at least confirm your solution.

Now I am running again my rock solid ISC DHCPv4 + dnsmasq combination - either I am simply too untalented or the dnsmasq DNS & DHCP service is really as confusing to configure and troubleshoot as it feels.


There was quite some noise when dnsmasq DHCP was first introduced but there is not much going on lately so I assume it must indeed work for most people who use it.

In your case, you were probably unlucky or under stress, frustration is pretty much guaranteed in failure.

Just try it again sometime without pressure and things will work. Maybe give it another go on 25.7. I know for a fact dnsmasq works as I use it fully featured and developed quite some things for its current implementation in OPNsense.
Hardware:
DEC740

You are right again - frustration is never a good companion. Couldn't help it though.

Anyway, I am currently trying again. Unfortunately, with the same result. I simply can't get DHCP to serve my hosts. They won't get an IP assigned, only 169.x.x.x.

I have a 192.168.0/24 network with .253 assigned to my access point. Did I miss something to enable on the DHCP side in order to serve the hosts querying through the AP?