YazDHCP - alpha - Extended DHCP management script

  • ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

Jack Yaz

Part of the Furniture
ALPHA
Installation
Using your preferred SSH client/terminal, copy and paste the following command, then press Enter:
Code:
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/YazDHCP/master/YazDHCP.sh" -o "/jffs/scripts/YazDHCP" && chmod 0755 /jffs/scripts/YazDHCP && /jffs/scripts/YazDHCP install
 
Last edited:

Viktor Jaep

Regular Contributor
I'm tempted to make another GUI addon that can use the custom settings API to read/write to JFFS and do this. You increased the user page limit from 10 to 20, so someone has to start filling those up!

I was *just* going to suggest what a great opportunity it would be to build some kind of config editor into the GUI for those of us who aren't too familiar with using these methods, and since I just went through this exercise to dump my vpn custom config into an openvpnclient1.postconf file... LOL... We're all behind you on this! Thank you! :)
 

JGrana

Very Senior Member
I'm tempted to make another GUI addon that can use the custom settings API to read/write to JFFS and do this. You increased the user page limit from 10 to 20, so someone has to start filling those up!
Great idea given that Asus keeps reducing the amount of nvram to static IP management. I don’t blame them - it really does start to eat into the small nvram space.

I switched to dnsmasq.conf.add and hosts.add long ago. Works great, more portable and you could use some of the many options dnsmasq provides.

I would also recommend that the GUI provides an initial “export existing nvram static info to dnsmasq.conf.add“ (and create a hosts.add). You could also support different lease times on a per IP basis, etc.

Go for it Jack!
 

Heelderpeel

New Around Here
I'm tempted to make another GUI addon that can use the custom settings API to read/write to JFFS and do this. You increased the user page limit from 10 to 20, so someone has to start filling those up!

I say, sounds good
 
Last edited:

Jack Yaz

Part of the Furniture
Great idea given that Asus keeps reducing the amount of nvram to static IP management. I don’t blame them - it really does start to eat into the small nvram space.

I switched to dnsmasq.conf.add and hosts.add long ago. Works great, more portable and you could use some of the many options dnsmasq provides.

I would also recommend that the GUI provides an initial “export existing nvram static info to dnsmasq.conf.add“ (and create a hosts.add). You could also support different lease times on a per IP basis, etc.

Go for it Jack!
@Xentrk has a script that can export the existing to dnsmasq.conf.add already....let me see if he minds me using it!
 

Stephen Harrington

Senior Member
I'm tempted to make another GUI addon that can use the custom settings API to read/write to JFFS and do this.

That would be a very useful utility indeed @Jack Yaz with the impending 128 => 64 reduction - would you envisage it being part of scMerlin perhaps?
 

Stephen Harrington

Senior Member
I'm working on it as a separate script/entity

@Jack Yaz
Ah I see - anxious to stake a claim on those 20 available slots :)
Thanks, looking forward to it.

(J7 arriving soon to an AMTM near you ...)
 

Stephen Harrington

Senior Member
As it happens I'm looking to override the stock Asus DHCP page, so not even using one of the user pages :)

Sounds good @Jack Yaz, looking forward as always to what you come up with. May I assume some kind of export/import of (externally stored) lists from/to your new “editor” would be on the radar?
 

Jack Yaz

Part of the Furniture
Sounds good @Jack Yaz, looking forward as always to what you come up with. May I assume some kind of export/import of (externally stored) lists from/to your new “editor” would be on the radar?
my current plan is to just rework the existing DHCP page to read/write from jffs via the addons API rather than to nvram/pseudo-nvram-jffs
Since each "setting" can be up to 2999 characters/bytes with the custom_settings.txt being allowed to be 8KB overall, that gives a pretty big increase in the number of reservations allowed.
Reservations will only exist in custom_settings.txt when the page is submitted, before being written out to my script's directory (and parsing into dnsmasq's config)
 

Jack Yaz

Part of the Furniture
Any willing alpha testers for this script? I'm confident that I've covered enough in my testing, but I'm currently only able to test on an AC86U which is HND, so I'd like any non-HND users especially!

The script will export and unset the existing nvram variables for static assignments, but I recommend screenshotting your WebUI assignment list in case anything goes wrong. For this reason I'd prefer starting testing with users with not many assignments, so if my script doesn't do something correctly you don't have to manually re-input 50+ entries!

Reply here if interested and I will send a PM.
 

Jack Yaz

Part of the Furniture
It would be awesome if the UI would allow IPs that are not on the local LAN so resolution of private IPs on different networks is possible!
I assume you'd be looking for a GUI way to edit a hosts file in this case, rather than assign DHCP addresses?
 

SomeWhereOverTheRainBow

Very Senior Member
I assume you'd be looking for a GUI way to edit a hosts file in this case, rather than assign DHCP addresses?
do the entries appear in DNSMASQ.conf the exact same way they do when you use the regular GUI option?

for example

Code:
dhcp-host=A1:B2:C3:D4:E5:F6,set:A1:B2:C3:D4:E5:F6,192.168.1.250

and host file

Code:
192.168.1.250 Some-Device-Name
 

Jack Yaz

Part of the Furniture
do the entries appear in DNSMASQ.conf the exact same way they do when you use the regular GUI option?

for example

Code:
dhcp-host=A1:B2:C3:D4:E5:F6,set:A1:B2:C3:D4:E5:F6,192.168.1.250

and host file

Code:
192.168.1.250 Some-Device-Name
yes and no. i add the following to dnsmasq.conf.add:
Code:
addn-hosts=/jffs/addons/YazDHCP.d/.hostnames # YazDHCP_hostnames
dhcp-hostsfile=/jffs/addons/YazDHCP.d/.staticlist # YazDHCP_staticlist
dhcp-optsfile=/jffs/addons/YazDHCP.d/.optionslist # YazDHCP_optionslist
the contents of these files then matches (omitting the dhcp-host= bit for staticlist)
 

SomeWhereOverTheRainBow

Very Senior Member
yes and no. i add the following to dnsmasq.conf.add:
Code:
addn-hosts=/jffs/addons/YazDHCP.d/.hostnames # YazDHCP_hostnames
dhcp-hostsfile=/jffs/addons/YazDHCP.d/.staticlist # YazDHCP_staticlist
dhcp-optsfile=/jffs/addons/YazDHCP.d/.optionslist # YazDHCP_optionslist
the contents of these files then matches (omitting the dhcp-host= bit for staticlist)
I only ask because I am interested testing your script ( i got 123 devices). I was just checking how you defined the list.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top