Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15586

Beginner Basics • Re: NTP Time server

$
0
0
Most devices allow only unicast NTP server use, so try to use the address of the router as the NTP time server IP for test.
Also try to define accept rule in Ip Firewall Filter, input chain, protocol UDP, destination-port 123, and in-interface to whichever is router LAN interface.
This should make things work but you could use this to test it easily: https://www.ntp-time-server.com/ntp-sof ... check.html

Further advice is to avoid using local clock on the Mikrotik router, as it doesn't have a battery to keep clock when turned off.
So Mikrotik clock resets to 1970 after each power on, until rotuer's sntp client is syncronized to the external ntp clock source (you can see this in the log).
Could be better if you use CHR on a virtual server having real-time quartz clock supported by the battery, though with virtualization jitter is bigger and it has some of it's own issues.

Depending on how reliable is your Internet connection on site, and if the actual time is more important or basic device event-time syncronization...
you could use this script in scheduler on startup, which would eliminate Mikrotik providing bad time to it's ntp clients immediately after reboot.
Not my script, so credits are due but I hope you find this useful.

{
# Assure no stale time served after router reboot until synced
/system ntp server set enabled=no
:log info "System time not synchronized after Boot, disabling ntp server"
:global SMTPstatus [/system ntp client get status]
while condition=($SMTPstatus!="synchronized") do={
delay 60s;
:global SMTPstatus [/system ntp client get status]
}
:log info "System time synchronized after Boot, enabling ntp server"
/system ntp server set enabled=yes;
}

Statistics: Posted by tihovsky — Wed Jan 24, 2024 10:29 pm



Viewing all articles
Browse latest Browse all 15586

Trending Articles