2021-11-05 15:11:17 +01:00
|
|
|
# Use a larger cachesize by default
|
|
|
|
cachesize=1024
|
|
|
|
|
|
|
|
# Increase cachesize for systems with enough memory
|
|
|
|
mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
|
|
|
|
[ "$mem" -gt 65536 ] && cachesize=8192
|
|
|
|
|
2021-01-31 14:01:16 +01:00
|
|
|
uci batch >/dev/null <<EOF
|
2018-02-12 19:13:15 +01:00
|
|
|
delete dhcp.@dnsmasq[0]
|
|
|
|
delete dhcp.lan
|
|
|
|
delete dhcp.wan
|
|
|
|
add dhcp dnsmasq
|
2021-01-31 14:01:16 +01:00
|
|
|
set dhcp.@dnsmasq[-1].domainneeded='0'
|
|
|
|
set dhcp.@dnsmasq[-1].boguspriv='0'
|
|
|
|
set dhcp.@dnsmasq[-1].filterwin2k='0'
|
|
|
|
set dhcp.@dnsmasq[-1].localise_queries='0'
|
|
|
|
set dhcp.@dnsmasq[-1].rebind_protection='0'
|
|
|
|
set dhcp.@dnsmasq[-1].rebind_localhost='1'
|
|
|
|
set dhcp.@dnsmasq[-1].domain='fff.community'
|
|
|
|
set dhcp.@dnsmasq[-1].expandhosts='0'
|
|
|
|
set dhcp.@dnsmasq[-1].nonegcache='0'
|
2021-11-05 15:11:17 +01:00
|
|
|
set dhcp.@dnsmasq[-1].cachesize="$cachesize"
|
2021-01-31 14:01:16 +01:00
|
|
|
set dhcp.@dnsmasq[-1].authoritative='1'
|
|
|
|
set dhcp.@dnsmasq[-1].readethers='1'
|
|
|
|
set dhcp.@dnsmasq[-1].leasefile='/tmp/dhcp.leases'
|
|
|
|
set dhcp.@dnsmasq[-1].noresolv='1'
|
|
|
|
set dhcp.@dnsmasq[-1].localservice='1'
|
2018-02-12 19:13:15 +01:00
|
|
|
|
2020-12-18 20:49:01 +01:00
|
|
|
set dhcp.client=dhcp
|
|
|
|
set dhcp.client.interface='client'
|
|
|
|
set dhcp.client.leasetime='1h'
|
2018-02-12 19:13:15 +01:00
|
|
|
EOF
|
|
|
|
|
|
|
|
uci commit dhcp
|
|
|
|
|
|
|
|
exit 0
|