DHCP Client Table / edit in shell / persistance?

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
schlupps
New here
Posts: 3
Joined: Fri Apr 23, 2021 9:58 pm

DHCP Client Table / edit in shell / persistance?

Post by schlupps » Sat Apr 24, 2021 12:15 am

Hi

i am pretty new to the QNAP. Formerly, i ran a OpenWRT device (an old access point) to handle my NAS-related needs.. not the fastest, but rock solid and sort of handy to configure. =)) Additionally, the DHCP service was done by the OpenWRT. There are round about 75 devices in my network; so i took the time to transfer each of them into to the QNAPs DHCP server (no batch import..*dough*). As the QNAPs DHCP server GUI is sort of 'basic' and is lacking the option to edit the reservations (only delete..), the only chance to edit a reservation entry, is to delete and re-enter it again :cry: .
As any edited or re-added entry will be put at the very bottom of the list, my list grew a completely chaos in the meantime, unsorted and not very intuitive to check, edit or add stuff =/

As the GUI wont help me much with this chaos, i started digging in the QNAPs filesystem and found /etc/dhcp/dhcpd_eth0.conf and /mnt/HDA_ROOT/.config/nm_dhcpd.conf .
"Awesome!", i thought =)) i started editing the files (veeery carefully!!!), put them back in place in the QNAP, checked the GUI and wow... i found my list sorted and working! WONDERFUL, i thought again. But...

Some time and some service and/or device restarts later, the GUI showed the completely unsorted DHCP client table again :`( Did not manage to find any other place, where the QNAP pulls this data.. i guess, this is some hidden/binary/zipped cached backup-config-file, where the QNAP pulls this list again after DHCP restart.

is there any chance to have my editing of these files a little more persistent? RO flag? ;)

Qnap is a TS-230 running latest 4.5.2 system (holy.. over 100Megs/sec from this little box impressed me deeply :-0 ). The DHCP server running at the moment, is the one, that is offered in the 'Network & virt Switch' app on the device, aka the default... Is there maybe another, alternative DHCP server i could install/use?

Thanks for any thoughts/advice or input =)

kind regards and a great weekend to you..
schlupps
...if nothing goes right... go left!

Mousetick
Been there, done that
Posts: 949
Joined: Thu Aug 24, 2017 10:28 pm

Re: DHCP Client Table / edit in shell / persistance?

Post by Mousetick » Sat Apr 24, 2021 1:11 am

Maybe try to make the .conf file immutable:

Code: Select all

# chattr +i /path/to/file
Even superuser won't be able to modify it... (use chattr -i to revert).

This will only work on config files stored in /mnt/HDA_ROOT/.config. Stuff that's in /etc but not in /etc/config lives in a tmpfs (RAM-based) filesystem that is reset on each boot.

I don't know how the network boot procedure will cope with it though, it may not handle it gracefully and fail miserably.

Other than that, no idea. I don't use the DHCP server on QNAP and the QTS network manager is a big black box. I suspect the list of clients may be stored into a sqlite DB or some such somewhere and the .conf files are generated from it, with the admin UI editing the DB.

You may be better off going back to OpenWRT for your DHCP service needs...

schlupps
New here
Posts: 3
Joined: Fri Apr 23, 2021 9:58 pm

Re: DHCP Client Table / edit in shell / persistance?

Post by schlupps » Sat Apr 24, 2021 2:37 am

since the QNAP is about to handle my data, my bravery isnt evolved too strong ;)
Guess ill go for a raspberryPi to serve the DHCP, as i could shut down the QNAP outside my 'i-need-data'-timeframe, without loosing the DHCP.
Thanks a lot for your response!
Take care...
...if nothing goes right... go left!

schlupps
New here
Posts: 3
Joined: Fri Apr 23, 2021 9:58 pm

Re: DHCP Client Table / edit in shell / persistance?

Post by schlupps » Sun Apr 25, 2021 6:06 pm

Hi

...and i learned, that the DHCP table for reservations (or the whole NIC and DHCP config incl. reservations!) is sort of volatile, aka. lost too fast without the option to import the reservations directly for me 8/

Yesterday, i attached an USB nic and detached it again, after its job was done; then i found an entry in the virtual switch/network section for this 'abandoned' nic and .... after removing that entry, DHCP server incl. reservations was gone for good 8D. Sure, the device warned me beforehands, but i could not resist to test, if the whole network config is being resetted for real (hope dies last, right? ;) ) -> from that time on, i started taking the QNAPs warnings for real and restored the config! The device is "new" and i am willing to learn ;)

So.. following your suggestion and my experience so far and my impression, that the QNAPs DHCP will not work as expected for me, a raspi is about to come soon; to let the QNAP just be my QNAS, and this is working beautifully so far!
Maybe the rotating drives will be replaced by some SSDs; not for the speed (the nic already is maxed out), but for the lower level of clicking/ticking/HDDworking noises..

Thanks Mousetick!
...if nothing goes right... go left!

Post Reply

Return to “Miscellaneous”