Community discussions

MikroTik App
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

NTP client time sync

Mon Apr 27, 2020 1:59 pm

My current CPE configuration gives internet access only when a PPPoE session is established, when the PPPoE client on the CPE is disabled internet access ceases and this results in no clock time sync?
I use this on scheduler to keep the clock in sync
/system ntp client set enabled=yes primary-ntp=[:resolve 0.ie.pool.ntp.org] secondary-ntp=[:resolve 1.ie.pool.ntp.org];

Is there any way that I could just retain the clock time sync ?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12633
Joined: Thu Mar 03, 2016 10:23 pm

Re: NTP client time sync

Mon Apr 27, 2020 6:04 pm

NTP stands gor Network Time Protocol. So when there's no network connectivity, you don't have precise time.

Apart from that: router's internal clock keeps running even without internet, it's just not very precise any more. Such devices loose or gain up to a few seconds a day (most are better than that). I don't think that kind of inaccuracy should break anything if device gets internet access at least once a week.
The only problem is that after reboot (could be any reboot or only after power failure, I'm not sure) time starts ticking from 1st of January 1970 and router needs internet access to get current time.
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Mon Apr 27, 2020 7:07 pm

I have a lot of customers who have the PPPoE client on their WiFi Router for port forwarding ( etc...) trying to run scheduled tasks on the CPE's overnight is a challenge as I have to manually correct the time on the CPE's that have incorrect clock times that could be several many days out ?

If only I could setup that only the primary-ntp and secondary-ntp ip's would be able to time sync on those CPE's
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12633
Joined: Thu Mar 03, 2016 10:23 pm

Re: NTP client time sync

Mon Apr 27, 2020 11:22 pm

I'll qoute myself:
NTP stands for Network Time Protocol. So when there's no network connectivity, you don't have precise time.

Now ... you might fing some way of giving routers a tiny connectivity towards some NTP server (DHCP serving private IP address should do the trick) while still requiring PPPoE to offer full internet connectivity.

But then ... I've always thought that internet connectivity on router should be established at all times (unless there's something seriously wrong) which means NTP servers should be available at all times as well. If things are set like this then router gets precise time within seconds after boot.
If, OTOH, PPPoE client is not set to be connected at all times, then you may have to reconsider the policy ...
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Wed Apr 29, 2020 3:41 pm

How do I add NTP package to ROS versions 6.45.7, 6.46.3 ?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12633
Joined: Thu Mar 03, 2016 10:23 pm

Re: NTP client time sync

Wed Apr 29, 2020 6:25 pm

You don't have to install ntp package if you only want to set time on the router itself, ROS includes sntp client in system package. If you want to set up router as NTP server, then install ntp package from extra packages (available as ZIP file from download.mikrotik.com)
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Wed Apr 29, 2020 7:00 pm

I am trying to add NTP package to the AP's so that the AP will serve as NTP server for CPE clients but so far by simply adding NTP to files and reboot does not work?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12633
Joined: Thu Mar 03, 2016 10:23 pm

Re: NTP client time sync

Wed Apr 29, 2020 8:19 pm

The add-on package has to match ROS architecture and version (to the last digit). Anything in log after reboot? It should have some information about package - either that it was installed or some complaint about how the package was inappropriate.
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Wed Apr 29, 2020 9:16 pm

I updated a AP to 6.46.6 added ntp-6.46.6-mipsbe.npk to files - rebooted but no NTP server ? I am really confused
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Wed Apr 29, 2020 9:29 pm

Just checked packages and now Calea has been added, I am sure it was NTP and not Calea package I had in files but will try again
 
Gombeen666
Member Candidate
Member Candidate
Topic Author
Posts: 224
Joined: Tue Jun 25, 2019 5:33 pm

Re: NTP client time sync

Fri May 01, 2020 3:49 pm

I managed to add NTP package to the AP's, The AP uses DHCP server to assign management ip ( 10.100.X.X) to the CPE DHCP clients
but so far selecting on the CPE DHCP client "Use Peer NTP" does not sync time

/ip dhcp-server network
add address=10.100.10.0/24 dns-none=yes gateway=10.100.10.1 netmask=24 ntp-server=162.159.200.123
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12633
Joined: Thu Mar 03, 2016 10:23 pm

Re: NTP client time sync

Sat May 02, 2020 12:06 am

As you probably know, you can check status of NTP client using /system ntp client print ... the DHCP-asigned NTP server IP address should appear in the output. If it's not, then the use-peer-ntp option doesn't work (I don't use DHCP assigned addresses for vital network appliances so I don't have experience in this field). Even if it does, it'll take quite some time (could be half an hour or even more) for NTP client to settle down and set the time ... after that's done, the first command I wrote should return status: synchronized. If there's NTP server address in the print out and the status doesn't change to synchronized in an hour, then you should check firewall(s) if it allows outgoing UDP connections with dst-port 123 ...

Who is online

Users browsing this forum: pedroush and 13 guests