Disable DHCP daemon?

Hi you hard-working QNAP folks. :nerd_face:

QTS 5.2.7.3256 on a TS-251+.

I’m presently messing-around with some PXE software on my NAS, but found the QTS DHCP server is interfering with the port I need (67).

How can I disable the DHCP server? There doesn’t seem to be a way to do this via the QTS interface (Network & Virtual Switch → Network → DHCP Server). I can kill the processes of-course, but there should be a neater way to handle this. I don’t run any containers on this NAS.

Also, the DHCP service isn’t shown as a system service in the UI (Control Panel → System → System Status → System Service). Can this be added please?

Thank you.

Was there not a default DNSMasq install on the QNAP OS?
https://forum.qnap.com/viewtopic.php?t=157975

I agree, if not vital for operation, there should be a way to disable that

1 Like

Somebody did (presumably) put a request in before (for the DNS side of DNSMasq)

I haven’t checked but do we know if QNAP did something to permit this? If so, it’s a start. :wink:

Maybe there is a new little qcli option for this … worth a peek (even though the ‘help’ flag does not disclose all commands… annoyingly)

Maybe try

qcli_network --disabledhcpserver

1 Like

Oh, nice find! I’ll give that a go. :nerd_face:

1 Like

Nope, it seems that option doesn’t disable dhcpd. It takes a single required argument (the interface name):

[/share/Public] # qcli_network -d --help
  -d  --disabledhcpserver,                   disable DHCP server.
        interfaceID=<interfaceID>                  interfaceID
        ex:qcli_network -d interfaceID=eth0

I tried it on the main NAS Ethernet ports, and it reported success. But, the dhcpd kept running and was still listening on 0.0.0.0:67

:disappointed:

Some info to add: dhcpd wasn’t running until I installed Container Station.

But, even with Container Station stopped (and disabled), dhcpd kept running.

So, I uninstalled Container Station, and that killed dhcpd.

Also, the DHCP Server section of Network & Virtual Switch always shows the DHCP server status as ‘Enabled’, even when it’s not. * shrug *

boo…was worth a shot

I think it’s something QNAP really should fix. :wink:

1 Like

Hi @OneCD @dolbyman ,

Thank you very much for your detailed discussion and testing.
We truly appreciate the time and effort you’ve taken to share your findings.
Our internal team is currently reviewing and testing this behavior.
We will provide an update here once further information or improvements become available.

Best regards,
QNAP Team

1 Like

Hi @OneCD

May in know what kind of PXE tools or software are you using? Is it installed on Virtualization Station or another platform?

Hi @OliverLam. :slight_smile:

The software I’m checking-out is GitHub - pxehost/pxehost: Boot Linux over LAN in one command

I’m considering making it into a QPKG, but I’ll need to mark Container Station as a conflict for it.

Hi @OneCD The DHCP server is a crucial service in our system. It’s used for things like distributing IPs to containers from the Container Station, the Network Virtual Switch service, and establishing vSwitch connections between different virtual machines.

While removing the Container Station, as you tested, frees up the port, but it might still affect the operation of PXE applications if they use it. For example, if DHCP is enabled on PXE, the Container Station may experience interference.

I would suggest trying to create a separate Virtual Machine with its own IP address, or even use a different VLAN, to prevent PXE DHCP from impacting system operation and even the DHCP function on your gateway/router.

I’ve also looked at the GitHub project you provided, and it seems pretty good. :grin:

I agree, and it should probably be listed in the system services status display. It uses a port, why not admit it in the display?

I understand, it could even be considered a part of the Network & Virtual Switch application.

Of course.

Maybe QNAP could ensure the dhcpd service can only be seen by localhost (i.e. the NAS)?

I’d like to make this application available to as-many QNAP users as-possible. Even those with NAS unable to run VMs or containers. On low-end NAS models, port 67 won’t be claimed by Network & Virtual Switch (so there’s no issue), but requiring a VM on high-end models is messy. If QNAP didn’t allow dhcpd to listen on 0.0.0.0 there wouldn’t be an issue at-all. :wink:

It’s not my project, but I agree. :+1: