What's new

ntpMerlin - NTP Daemon for AsusWRT Merlin

CriticJay

Senior Member
Makaveli,

I'm a Teksavvy/Rogers Cable user in the GTA. Here's my /jffs/addons/ntpmerlin.d/ntp.conf :

Code:
# replace the following time servers to the ones close to you
# see http://support.ntp.org/bin/view/Servers/NTPPoolServers
# server 0.pool.ntp.org iburst
# server 1.pool.ntp.org iburst
# server 2.pool.ntp.org iburst
# server 3.pool.ntp.org iburst

pool -4 time.cloudflare.com iburst

interface ignore wildcard
interface listen br0

logfile /opt/var/spool/ntp/ntp.log
driftfile /opt/var/spool/ntp/ntp.drift
leapfile /opt/var/spool/ntp/leap-seconds.list # https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list

restrict default limited kod nomodify notrap nopeer noquery # restrictive default IPv4
restrict -6 default limited kod nomodify notrap nopeer noquery # restrictive default IPv6
restrict source nomodify notrap noquery # required for pool directive if using restrictive default permissions
restrict 127.0.0.1 # permissive localhost IPv4
restrict -6 ::1 # permissive localhost IPv6

disable auth stats
notes:

i use pool -4 so that it only connects to cloudflare NTP on IPv4. I have disabled IPv6 on my connection. But ntp will still try to connect to the server on IPv6 once every minute otherwise.

in order to use the "leapfile" command/directive you'll need to download a copy of the leapfile to that file location
 

Makaveli

Very Senior Member
Makaveli,

I'm a Teksavvy/Rogers Cable user in the GTA. Here's my /jffs/addons/ntpmerlin.d/ntp.conf :

Code:
# replace the following time servers to the ones close to you
# see http://support.ntp.org/bin/view/Servers/NTPPoolServers
# server 0.pool.ntp.org iburst
# server 1.pool.ntp.org iburst
# server 2.pool.ntp.org iburst
# server 3.pool.ntp.org iburst

pool -4 time.cloudflare.com iburst

interface ignore wildcard
interface listen br0

logfile /opt/var/spool/ntp/ntp.log
driftfile /opt/var/spool/ntp/ntp.drift
leapfile /opt/var/spool/ntp/leap-seconds.list # https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list

restrict default limited kod nomodify notrap nopeer noquery # restrictive default IPv4
restrict -6 default limited kod nomodify notrap nopeer noquery # restrictive default IPv6
restrict source nomodify notrap noquery # required for pool directive if using restrictive default permissions
restrict 127.0.0.1 # permissive localhost IPv4
restrict -6 ::1 # permissive localhost IPv6

disable auth stats
notes:

i use pool -4 so that it only connects to cloudflare NTP on IPv4. I have disabled IPv6 on my connection. But ntp will still try to connect to the server on IPv6 once every minute otherwise.

in order to use the "leapfile" command/directive you'll need to download a copy of the leapfile to that file location
Nice my connection is IPv4 only but will keep this in mind for the future if the ISP enables IPv6.
 
Last edited:

thecheapseats

Regular Contributor
Hey guys. I installed this a few days ago via amtm. In the options menu I set
"2. Toggle redirect of all NTP traffic to ntpMerlin" to 'Enabled'

Do I still need to configure anything in the WebUI? -snip-
'Toggle redirect - yes' - good to go...
suggest you edit ntp.conf to pool addresses close to your geographic location...
 

Makaveli

Very Senior Member
For many years I used time.nrc.ca. Easy to remember.

Cool I may switch to this to see if I see any differences.
 

CriticJay

Senior Member
@Makaveli Here's the results from the NTPQ -p command on my router using the config file I posted above:

Code:
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 time.cloudflare .POOL.          16 p    -   64    0    0.000    0.000   0.000
*time.cloudflare 10.14.8.68       3 u  201 1024  377   21.085   -1.166   1.032
+time.cloudflare 10.14.8.68       3 u  815 1024  377   20.882   -0.418   3.437
 

Marin

Very Senior Member
Try some additional ones:

ntpq -p -c rv

ntpq -4 -c rv | grep jitter

ntpq -pn
 

Marin

Very Senior Member
From an esteemed member of these forums (@sfx2000 thank you!):


General knowledge:

Ping is relevant to show you can connect to the internet, but not accurate to determine the quality of a NTP server. Ping uses IMCP to get a response. completely different from methods used by ntp.

ICMP-timestamps' fields are 31-bit, carry relative-time of "touching" ICMP-packed on outgoing/incoming side of the network connection, expressed as a number of miliseconds elapsed since last UTC-midnight. Highest order bit is used for flagging a UTC-uncoordinated host-time / non-standard value.
NTP-timestamps' fields are 64 bit, carry an absolute time, recorded as a 32-bit for seconds since epoch ( Jan-01-1900 .. till .. rollover in 2036 ) and another 32-bits for fractions of a second ( thus going in a time-measurement down to a sub-nanosecond resolution ).
So even though you may have higher latency with one NTP server versus another, it can be as accurate down to a sub-nanosecond in resolution, NTPD uses the calculations to "fix" or adjust the time once it arrives to you, so as far as NTP is concerned Ping is not a good way to measure accuracy.

NTP will function better when it is used along side other NTP servers, it helps the accuracy of calculations used to make the adjustments.

Jitter actually has not much impact on NTP...
Root Dispersion is a better indication of reliability and trust of both the client and server...
If a server gets its time from an external clock, its root dispersion is the estimated maximum error of that clock. If it gets its time from another NTP server, its root dispersion is that server's root dispersion plus the dispersion added by the network link between them.
For example, “rootdelay=35.833, rootdisp=38.925, refid=216.239.35.8,

reftime=e0ba5d37.e73e976b Sun,”
 

chewmull

Occasional Visitor
Morning - I rebooted my router this morning, several times actually, and the one issue I'm having is under "Add-ons" the NTP tab shows however when clicking on it it just goes to the first tab which in connmon.. Router is an RT-88U with 384.18 and the latest NTP.. NTP appears to be working as there are no errors in the syslog, it's just the tab/display in the UI.
 

JT Strickland

Senior Member
What can one do if NTP Daemon don't start? Anything? I'm having some issues looks like.
thanks,
jts
 

JGrana

Senior Member
From an esteemed member of these forums (@sfx2000 thank you!):


General knowledge:

(lots of great ntp information)
Speaking of NTP, the latest Entware now supports chrony, a more modern NTP client/server.
It runs in place of ntpd.
Some information:

A very good article on ntp in general (and why Facebook moved to chrony):

I had compiled and installed chrony on my AX88u around 4 months ago. If you know how to setup ntpd, chrony is very similar. I also savegly hacked up Jack Yaz ntpMerlin script to use the output from chronyc.
After running it for the past few months, I asked the Entware guys to include. As of the most recent update it is now in there.
 

Jack Yaz

Part of the Furniture
What can one do if NTP Daemon don't start? Anything? I'm having some issues looks like.
thanks,
jts
given you seem to be having issues with various scripts since 384.19, have you tried reformatting jffs and installing a pre 384.19 backup?
 

Jack Yaz

Part of the Furniture
Speaking of NTP, the latest Entware now supports chrony, a more modern NTP client/server.
It runs in place of ntpd.
Some information:

A very good article on ntp in general (and why Facebook moved to chrony):

I had compiled and installed chrony on my AX88u around 4 months ago. If you know how to setup ntpd, chrony is very similar. I also savegly hacked up Jack Yaz ntpMerlin script to use the output from chronyc.
After running it for the past few months, I asked the Entware guys to include. As of the most recent update it is now in there.
i'd be happy to review a PR to add chrony support :)
 

Jack Yaz

Part of the Furniture
Morning - I rebooted my router this morning, several times actually, and the one issue I'm having is under "Add-ons" the NTP tab shows however when clicking on it it just goes to the first tab which in connmon.. Router is an RT-88U with 384.18 and the latest NTP.. NTP appears to be working as there are no errors in the syslog, it's just the tab/display in the UI.
try running below command
Code:
ntpmerlin startup
 

JGrana

Senior Member
i'd be happy to review a PR to add chrony support :)
Great, I'm out of town at the moment. I will clean it up a bit and let you fix and polish it up ;-)
 

JT Strickland

Senior Member
given you seem to be having issues with various scripts since 384.19, have you tried reformatting jffs and installing a pre 384.19 backup?
Do you mean a pre 384.19 backup of the jffs? I haven't yet, but I am considering starting from scratch, maybe even a factory reset.
Or a pre 384.19 backup of my settings? I haven't tried that yet. Do you think I should roll back to 384.18?
thanks,
jts
 

Jack Yaz

Part of the Furniture
Do you mean a pre 384.19 backup of the jffs? I haven't yet, but I am considering starting from scratch, maybe even a factory reset.
Or a pre 384.19 backup of my settings? I haven't tried that yet. Do you think I should roll back to 384.18?
thanks,
jts
pre 384.19 backup of jffs. On the AC86U Asus decided to fiddle with the jffs partition size in the GPLs merged in by Merlin, and unfortunately it has caused some users, myself included, to see files go missing or get corrupted in /jffs
 

L&LD

Part of the Furniture
Thanks, it gave me another NTP Tab (now have 2) but the second works as designed.
Reboot the router and you should be presented with just one working one now.
 

JT Strickland

Senior Member
pre 384.19 backup of jffs. On the AC86U Asus decided to fiddle with the jffs partition size in the GPLs merged in by Merlin, and unfortunately it has caused some users, myself included, to see files go missing or get corrupted in /jffs
Thanks, I started over, formatted my usb, jffs, and installed the scripts fresh. I was worried that my backup may have been corrupted. It didn't work the last time.
thanks again,
jts
BTW, running smooth once again.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top