Instead of hard coded to a day, what would you say to linking the DHCP lease timer to the config in LAN/DHCP Server tab? (Accessible from nvram using dhcp_lease)
My suggestion & preference would be to have greater flexibility with YazFi by keeping the "DHCP Lease Time" configuration option *
separate* between the MAIN LAN (which uses the "
dhcp_lease" NVRAM setting) & the GUEST WLANs. This can be done by having the "DHCP Lease Time" value for
*each* GUEST network defined in the "
/jffs/addons/YazFi.d/config" file.
For example:
...
wl01_ENABLED=true
wl01_IPADDR=172.26.225.0
wl01_DHCPSTART=2
wl01_DHCPEND=126
wl01_DHCPLEASE=172800
wl01_DNS1=9.9.9.9
wl01_DNS2=1.1.1.2
wl01_FORCEDNS=false
wl01_ALLOWINTERNET=true
wl01_REDIRECTALLTOVPN=false
wl01_VPNCLIENTNUMBER=1
wl01_TWOWAYTOGUEST=false
wl01_ONEWAYTOGUEST=false
wl01_CLIENTISOLATION=true
...
The user then has the option to set a different value from the initial default by manually setting the appropriate "
wXXX_DHCPLEASE" variable in the config file to whatever valid DHCP lease time (in seconds) they so desire, independently of the setting for the MAIN network or any other GUEST networks.
Attached to this post is a text file (
YazFi_v4.4.2.ORIG_vs_MOD_DIFFs.txt) containing the result of diffing the original YazFi script & the modified version with my code changes.
EDIT: Updated the DIFFs text file because I had the wrong file revision when running diff.
The modified script adds the corresponding variable "
wXXX_DHCPLEASE" (when not found) for each GUEST network and sets the initial value (obtained via the cmd "
nvram get dhcp_lease") in the "
/jffs/addons/YazFi.d/config" file; from then on the user is free to modify the settings manually as they see fit.
I've been running this configuration setup for over 7 months now, and it's been working well so far. I like the flexibility of having a different DHCP lease time for each GUEST WLAN (e.g. one for IoTs devices, another for the GUEST network for relatives & friends that come to visit, etc.).
If you want to see, verify, or check out the changes I've made, the modified YazFi script is in PasteBin. You can download it directly onto your router with this cmd:
Bash:
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused pastebin.com/raw/qAJ7RgpJ | tr -d '\r' > "$HOME/YazFi_v4.4.2.MOD.sh"
P.S.
The modified script also includes a fix that I made as explained in this thread:
YazFi 4.4.2 version, one 2.4 GHz + one 5GHz Guest network. RT-AC86U running AsusWRT-Merlin 386.5_0 F/W. I have found 2 problems in the YazFi WebGUI tab where connected clients' information is displayed. The 1st problem is that sometimes the wrong IP address for a Guest client is shown. The 2nd...
www.snbforums.com
NOTE:
AFAICT,
@Jack Yaz has not made the proposed changes for the fix in the old thread above since no new releases have been made since the "
4.4.2" version.