Dnsmasq dhcp.lease && ntp client

I'm using openwrt firmware, after the board was restored from the factory, the time was 2024-5-14, at that time my lease in dhcp.leases was 1 day, that is, the time was 2024-5-15, and when I went to the page to turn on the ntp time synchronization, the dhcp.leases file only had information about the duid, and all of my device's lease information had been deleted.

you solved the mystery in your 1st sentence.

Do you mean not using openwrt?


what is the actual issue ?

The actual problem is that after I click on restore factory and the router is running, the dhcp downlist shows my computer's ip and mac address, but when I turn on the ntp sync time setting, my dhcp downlist disappears. I've found so far that this problem has something to do with time synchronization, but how do I change it? Let me click on time synchronization to still show my computer information

you can't, unless you skip the time sync.
this will only happen during the 1st 12hrs of the uptime of the router, assuming your DHCP leases are 12hrs.

briefly disconnect the computer from the network/router.

Can't the router do this automatically?Add some code

do what automatically ?

it's a open source project, feel free to chip in.

I want the dhcp downlink device table to show up properly instead of disappearing

and it will, after the DHCP leases with the incorrect date expire, in 12 hours.

you can't force the clients to renew their leases from the router.

you can kill the wifi for the wireless devices, forcing them to make a new request,.
for wired devices bring down the port, if doable.
still won't work if you have a switch in between, then you need to power cycle the switch.

another option is to have a shorter DHCP lease time.

Ok, I wonder if this issue has been addressed officially by openwrt?

why ?
it's no issue per se, it's a race condition.
you want it working 100% from the 1st second, get a device with a RTC.

I got another solution for you

disable dnsmasq autostart
sync the time
start dnsmasq

Okay, thank you very much.