How Do You Make SNTP server and client actually work?

I’ve been reading thru the forums and I have yet to see an actual solution. The ONLY boards functioning as Clients are a couple of old WRAP boards and PC boards that are hanging around and won’t die.

I’m trying to understand how they work and all the Routerboard product will not - none of them!

As servers - I’ve yet to make that happen!

Anybody got an idea?

Thank you,
Rod

Are you tying to use the router as an NTP server? You can’t do that with SNTP, it’s client only. You need to install and enable the NTP package for your RouterOS version then configure it. For example:

/system ntp client
set enabled=yes mode=unicast primary-ntp=65.182.224.60 secondary-ntp=216.129.110.22
/system ntp server
set broadcast=no broadcast-addresses="" enabled=yes manycast=yes multicast=no

The primary-ntp and secondary-ntp upstream servers shown were selected by a script that runs once a day and sets them based on whatever addresses from the pool the hostnames 0.us.pool.ntp.org and 1.us.pool.ntp.org resolve to at that moment. (Memory says that it uses a round-robin scheme.)

# Check and set NTP servers - "setntppool"
# Resolve the two ntp pool hostnames
:local ntpipa [:resolve "0.us.pool.ntp.org"];
:local ntpipb [:resolve "1.us.pool.ntp.org"];

# Get the current settings
:local ntpcura [/system ntp client get primary-ntp];
:local ntpcurb [/system ntp client get secondary-ntp];

# Debug output
:put ("Old: " . $ntpcura . " New: " . $ntpipa);
:put ("Old: " . $ntpcurb . " New: " . $ntpipb);

# Change primary or secondary if required and log it.
:if (($ntpipa != $ntpcura) || ($ntpipb != $ntpcurb)) do={
    :put "Making and logging NTP pool server change.";
    /system ntp client set primary-ntp="$ntpipa" secondary-ntp="$ntpipb";
    :log info ("NTP servers changed: Primary was: $ntpcura is: $ntpipa Secondary was: $ntpcurb is: $ntpipb");
    }

Yep - did all that too.

Have you done this and do you have it actively working in v5.12?

Thank you,
Rod

NTP client on RouterBoards works for me perfectly, from my begginings with ROS v. 3.28.
Find reliable NTP server, Stratum 2 if possible.
Below is a list of Stratum 2 servers:
http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers

HTH,

If you have a firewall on your input chain or if the connection will cross a firewall be sure to allow UDP port 123 from the ip addresses of the NTP server you’re using.

Yeah, works like a champ. All the machines on the LAN get their time via the NTP server on the router, and are right in sync.