LAN - DHCP Server, Lease TimeIs there a way to alter the router's default dhcp lease time for LAN clients of 24 hours to something less?
In your LAN section, you can change the lease time.Is there a way to alter the router's default dhcp lease time for LAN clients of 24 hours to something less?
Why should the local caching of DNS server be set to 'No'?no_name, do you have the WAN: Use local caching DNS server as system resolver set to 'Yes'? You may want to change that to 'No'.
@RMerlin was right (of course!) when he made the WAN: Use local caching DNS server as system resolver default to 'No'.
Cool!! I have a burning question now. When using dnsmasq.conf.add populated with devices and their host names, and now possibly lease times, do I need the caching setting set to yes or no?If you use the dnsmasq entry for lan clients, you can specify time. In this example, 1440 min or 1440 min/60 =24 hours
dhcp-host=11:20:AE:5E:86:63,Security-Camera-DVR,192.168.2.200,1440
Thanks for the explanation. I have no scripts that use host names specifically, so I'm good with the default setting of "no."It shouldn't make any difference unless you need to use the names you've given them in scripts on the router itself.
Wan: Use local caching DNS server as system resolver (default: No)
No:
Yes:
- The router will not be able to resolve client host names. This has no effect on clients themselves (they can always resolve them if using the router for dns).
- The router will use ISP DNS servers. Essential for setting system time if using DoT. Clients will use whatever dnsmasq is set to use.
So it's mostly a choice between stuff working and having the router able to use client host names. If you really need both, it's possible to set dnsmasq to use the ISP DNS servers for the time servers only (That'd be "Yes" with dnsmasq.conf.add entries like server=/pool.ntp.org/8.8.8.8).
- The router may be unable to set the time if DoT is enabled. DoT will not work without the time being set. Everything may be horribly broken.
- The router can resolve host names set by dnsmasq (some-pc.lan etc). Once again, no effect on clients themselves (they can always resolve them if using the router for dns).
#!/bin/sh
append_on_demand () {
TARGET="$1"
shift
for LINE in "$@"; do
if [ -z "`grep -F \"$LINE\" $TARGET`" ]; then
(
echo "$LINE" >> $TARGET
logger -t "SCRIPT_$(basename $0)" "$LINE have been added to $TARGET successfully"
)
else
logger -t "SCRIPT_$(basename $0)" "$LINE is already located inside $TARGET"
fi
done
}
case $1 in
/etc/dnsmasq.conf)
if [ "$(nvram get dns_local_cache)" = "1" ]; then
{
NTPSERVERS=""
for VAR in 0 1; do
NTP="$(nvram get "ntp_server$VAR")"
[ -n "$NTP" ] && NTPSERVERS="$NTPSERVERS/$NTP"
done
[ -z "$NTPSERVERS" ] && NTPSERVERS="/pool.ntp.org"
for DNS in $(nvram get wan_dns); do
append_on_demand $1 "server=$NTPSERVERS/$DNS"
done
for VAR in 1 2 3; do
DNS="$(nvram get "ipv6_dns$VAR")"
[ -n "$DNS" ] && append_on_demand $1 "server=$NTPSERVERS/$DNS"
done
}
fi
if [ `nvram get ntp_ready` -eq 1 ]; then
{
if ping -w 1 -c 1 1.1.1.1 > /dev/null 2>&1
then
for VAR in 0 1; do
NTP="$(nvram get "ntp_server$VAR")"
/usr/sbin/ntpd -q -n -p $NTP
logger -t "SCRIPT_$(basename $0)" "Time synced from $NTP"
done
else
logger -t "SCRIPT_$(basename $0)" "FAILED to sync time from $NTP"
fi
}
fi
;;
esac
#!/bin/sh
append_on_demand () {
TARGET="$1"
shift
for LINE in "$@"; do
if [ -z "`grep -F \"$LINE\" $TARGET`" ]; then
(
echo "$LINE" >> $TARGET
logger -t "SCRIPT_$(basename $0)" "$LINE have been added to $TARGET successfully"
)
else
logger -t "SCRIPT_$(basename $0)" "$LINE is already located inside $TARGET"
fi
done
}
case $1 in
/etc/dnsmasq.conf)
if [ "$(nvram get dns_local_cache)" = "1" ]; then
{
NTPSERVERS=""
for VAR in 0 1; do
NTP="$(nvram get "ntp_server$VAR")"
[ -n "$NTP" ] && NTPSERVERS="$NTPSERVERS/$NTP"
done
[ -z "$NTPSERVERS" ] && NTPSERVERS="/pool.ntp.org"
for DNS in $(nvram get wan_dns); do
append_on_demand $1 "server=$NTPSERVERS/$DNS"
done
for VAR in 1 2 3; do
DNS="$(nvram get "ipv6_dns$VAR")"
[ -n "$DNS" ] && append_on_demand $1 "server=$NTPSERVERS/$DNS"
done
}
fi
if [ `nvram get ntp_ready` -eq 0 ]; then
{
if ping -w 1 -c 1 1.1.1.1 > /dev/null 2>&1
then
for VAR in 0 1; do
NTP="$(nvram get "ntp_server$VAR")"
/usr/sbin/ntpd -q -n -p $NTP
logger -t "SCRIPT_$(basename $0)" "Time synced from $NTP"
done
else
logger -t "SCRIPT_$(basename $0)" "FAILED to sync time from $NTP"
fi
}
fi
;;
esac
In regards to the above posts by @L&LD : I don't understand the need for either of these scripts to be honest. What would the real world scenario look like to require either script?
These are the settings I use, and the feature in question set to "no." I have included a screen shot of my router's system page where the network monitor settings are. What I noticed and captured in the shot is; the drop down for ping target has domains not IP's, yet the tool tip clearly says the target is an IP. A close look shows mine set to 1.1.1.1 and this works with OVPN server and client startup. Please see attached screen-shot.If they solve the issue of the OpenVPN server being dropped, it would make the 'Yes' setting stable and my network responsiveness (and @Marin's, it seems) better than when it is set to 'No'.
These are the settings I use, and the feature in question set to "no." I have included a screen shot of my router's system page where the network monitor settings are. What I noticed and captured in the shot is; the drop down for ping target has domains not IP's, yet the tool tip clearly says the target is an IP. A close look shows mine set to 1.1.1.1 and this works with OVPN server and client startup. Please see attached screen-shot.
View attachment 17911
The use of the firmware's built in ntp server isn't relevant. If the ntp script of @Jack Yaz requires the use of host names then simply set the caching setting to yes. I don't understand the complexity here. Sorry.I don't use the firmware's NTP server. I am using @Jack Yaz' ntpMerlin script instead.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!