Hey guys so I am currently trying to figure out how to have my router act as a client and a server so I can serve time to all my devices connected to my network. I’ve been using most of my time today researching to figure out how to do it but I’ve just been seeing mixed answers. Maybe I wasn’t looking in the right places so I came here in hopes any of you experienced folks can help me out with this. I’d greatly appreciate it. Oh yeah btw I already have my router as an ntpclient. I just need to know how do i make it as an ntp server so it can provide to all my connected devices.
To enable the NTP server, add this line to /etc/config/system
under the config timeserver 'ntp'
section
option enable_server '1'
Or in LuCI:
System > System > Time Synchronization > Provide NTP server
You may also want to add DHCP option 42 to the DHCP server, pointing to your router's address.
What if I’m using the ntpd package? For some reason if I use the busy box version and I check under netdata. It shows that my system isn’t synced. But ntpd works just fine.
Then you would configure ntpd and disable the system's time software.
How would I go about that. When I do sysinfo it shows that my stratum is at 2 and my system peer mode is client. But I would like it for it to be a provider for my devices as well.
Are you asking how to configure the non-OpenWrt default software (i.e. it's ntpd) or the default one (information was provided)?
Next, what are you asking to do?
From your description, you already have it running (so all is well). May I ask why you installed ntpd?
I installed Ntpd because I seen that my system was not being synced. I confirmed this by using the net data package. Right when I installed ntpd I disabled sysntpd or whatever is called. The problem for me is I know that my ntpd is working because under sysinfo it shows that my system peer mode for the router is assigned as client. But I want my router to be a provider for all the other devices on my network.
Now I’m not sure if ntpd has any connection to the /etc/config/system file where it still shows enable server which is at 1. I also when into the dhcp file and put option ntp ‘192.168.x.x’
Is there something preventing you from configuring ntpd to do so?
If so, it's not clear why you're asking the OpenWrt forum.
I also tried dhcp option 42 but can’t quite confirm if it’s working as a server as well (my router)
Mind you I’m a year into this openwrt stuff so I’m sorry if I sound stupid lol. I’m a rookie still.
Tried DHCP Option 42 to accomplish what?
You lost me.
Cool, but we have to understand in order to help.
Well I just want to know how can I confirm if my router is provider too. As you see I have ntpd running. Confirmed by sysinfo as stratum column is at 2 and system peer mode says client.
From a client:
ntpdate -q <IP_of_router>
I read that to have ntp provider you have to go under lan interface dhcp settings and put in 42, then whatever your ip address of the router is.
Ok I will try that command. Like I said I was looking thru Reddit but I was seeing mixed answers. I don’t know why busybox doesn’t work on my router but ntpd does.
You slightly misunderstand the purpose of DHCP Option No. 42. The client may or may not use that option (most don't).
Feel free to configure your clients or redirect them to your server (once you "confirm").
I'm sorry for your loss [of brain cells].
Some of my clients do ask for a ntp. Not so much my windows or my phone but I have a few devices that do. I thought there was a way to force ntp from your router to all devices.
lol im a mechanic not a nerd. Im trying to get into this stuff so I can have a better network.