FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
513 views 2 comments
by anonymous
Hello,

i've been trying to setup an NTP Server on my RUT240 to sync devices that are on the same LAN as my router. I have managed to sync my router to the ntp server, but the device that uses the router as the defualt gateway and an ntp server is not synced. I have checked the NTP server option under NTP configuration

2 Answers

+1 vote
by anonymous

Hello,

I wrote this script that should solve your issue. Basic ideas is that this script start up just after boot and stops he NTP server on router, and waits for the time so be synced, if the time is synced, the NTP server will start, or if there is no sync in 2000 seconds, the server will start as to not run it if there is no need to sync time.

To start this script, you need to put in the /bin folder. You can upload the file to your router using WinSCP software, you can find the guide on our wiki page: https://wiki.teltonika-networks.com/view/Upload_%26_Download_Files_from_RutOS

Then you will need to execute the chmod +x /bin/ntp_script.sh, this will allow the script to be executed. After that is done you will need to edit a file called rc.local that is in /etc folder, that will start the script every time just after the device boots up. In the file, at the top, add this line: sh /bin/ntp_script.sh and then save it.

The script is in the attached file NTP_script.sh

Regards,

Paulius

Best answer
by anonymous
Thank you for your answer
0 votes
by anonymous
Hi,

It would be great if you could share information about which firmware version you are using. Have you tested with the latest?

Regards.
by anonymous
Hello,

it works after device reboot, sorry for not trying that first. Im using the 01.14.04. version.

Now im having the same problem someone posted here:

https://community.teltonika-networks.com/39350/enable-ntp-server-only-when-ntp-client-is-synced?show=39350#q39350

Are there any solutions for this? Maybe some user scripts to activate the NTP server when the RUT is synced, and not before. It causes a lot of problems for the logging that our LAN devices do when they have a 60 second interval of a time that is something like 6 days apart from the actual time