Update DHCP option 6 immediately at all LAN & WLAN clients

Hi,

I have the same query as this question 205671

If I change the values of option 6 in UCI, is there a way to immediately update this information to all LAN & WLAN DHCP clients, without waiting for the complete (or 50%) lease time to expire?
Eg: dhcp.lan.dhcp_option='6,10.10.10.1,192.168.240.20'

Following is the data in /etc/config/dhcp

dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='0'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.@dnsmasq[0].nonwildcard='1'
dhcp.@dnsmasq[0].localservice='1'
dhcp.@dnsmasq[0].ednspacket_max='1232'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.start='100'
dhcp.lan.limit='150'
dhcp.lan.leasetime='12h'
dhcp.lan.dhcp_option='6,192.168.100.20,172.22.3.3'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'

I have tried the following commands to no avail

ifdown lan
ifup lan
#This causes some WLAN clients to disconnect, & will have to manually connect them back
rm /tmp/dhcp.leases
/etc/init.d/dnsmasq reload
/etc/init.d/dnsmasq restart

killall -SIGUSR1 dnsmasq

NOTE: On disconnecting & reconnecting LAN & WLAN clients, they are receiving the updated option 6. But, I want this to be handled at the Router-end, so that I can automate this.
Reducing lease time is also a solution that I would not prefer.

Is DHCP force renew from the server/router a possibility that can aid with this ?
I could not find a way to achieve DHCP renew from the OpenWRT router.

Thanks in advance

Try:

service dnsmasq restart  # to make sure option 6 is active
service network restart  # to force renewal

DHCP does not provide push updates.

4 Likes

The only way to affect an immediate change would be to bounce the physical interfaces of the clients. This can typically be done by power cycling the ap(s) for wireless clients and the switches and/or router for wired.

Or you can go to the clients and bounce them manually (network and/or power) or force renew the lease from the client’s os.

4 Likes

Option 6 is used to send a DNS to the clients. Use a stable DNS on your network, push that to your clients, then change the upstream DNS when you need it.

1 Like

... in your stable DNS, not on the clients.

1 Like

Hi All,

Thank you for your replies

I think I'll go with the option of disconnecting & reconnecting LAN & WLAN clients, as that is the easiest approach which helps

if you don't have a very long DHCP lease time, all your clients should have already received the options 6 DNS IP by now.

1 Like