Trying to run dnsmasq as a DHCP server in Rocky 8

I’m having no success in running dnsmasq as an IPv4 DCHP server for my local network. I’ve managed to at least get the server to start if I set NM_CONTROLLED=no for the LAN ethernet interface. Without that it fails because NetworkManager has seized the bootps port (67). With wireshark, I can see the incoming DHCP discover broadcast packets, but there is no reply. I can see that dnsmasq is listening on the appropriate port:

Jan 13 18:54:44 omega-3x.local dnsmasq[5444]: listening on enp5s0(#3):
lsof -i :67
NetworkMa 1461    root   30u  IPv4  43535      0t0  UDP omega-3x.local:bootpc->omega-3g.local:bootps 
dnsmasq   5444 dnsmasq    4u  IPv4 179368      0t0  UDP *:bootps

And here are the non-comment lines of my dnsmasq.conf (other pre-assigned hosts deleted):


dhcp-range=,,24h#dhcp-host=D8:5E:D3:8A:11:0D,,  omega-3x
#dhcp-host=F4:26:79:E1:27:BA,,  omega-3xw
#dhcp-host=90:E6:BA:31:19:C5,, omega-3a
dhcp-option=option:ntp-server,  # = this machine
dhcp-option=2,-21600  # Central Standard Time
dhcp-option=6,  # domain-name-servers
dhcp-option=15,local  # Domain name#dhcp-host=D8:5E:D3:8A:11:0D,,  omega-3x
#dhcp-host=F4:26:79:E1:27:BA,,  omega-3xw
#dhcp-host=90:E6:BA:31:19:C5,, omega-3a

dhcp-host=00:1E:EC:0C:22:35,,  omega-3p

This is basically the same configuration that I have working in a CentOS 6 server I’m trying to replace. I do have all firewalls turned off. I don’t know what is keeping this from working.


I have had dnsmasq.service (on AlmaLinux 8) happily coexisting with NetworkManager; no “seize” detected.

Alternatively, (already on CentOS 7) I have NetworkManager that is set to dns=dnsmasq.
That is NM that starts dnsmasq as subprocess, as resolver, and additional config for that
dnsmasq instance so that it acts as DHCP and TFTP servers too.

And today it’s suddenly working for me, too. I just wish I knew why, since I’m not aware of anything I’ve changed that’s at all related. dnsmasq would always fail with a message that the bootps port was already bound if NetworkManager was controlling that interface. Today, no problem. Perhaps, like me, it just needed a good night’s rest. (And yes, the system had been rebooted quite a few times in the course of trying to get this working.)

I’ll be using a configuration similar to yours (no TFTP, though), so it’s nice to know there shouldn’t be any major obstacles. Thanks for the response.