I use Ubuntu server 16.04 and I set up local NTP server with the following configs in
# this is the IP or name of the local networks NTP ser$ # should be commented out on the server # server 192.168.1.202 iburst # this line is uncommented for clients # this enables checking the local clock. Do not change$ server 127.127.1.0 fudge 127.127.1.0 stratum 10 # this lines are required to run the ntpq -p command t$ # function of the system restrict 127.0.0.1 restrict ::1
The problem is when I restart the system, time is not synced and correct and even is wrong!
Output of the command
timedate status in server:
Local time: Thu 2018-02-22 19:03:50 IRST Universal time: Thu 2018-02-22 15:33:50 UTC RTC time: Thu 2018-02-22 15:33:50 Time zone: Asia/Tehran (IRST, +0330) Network time on: no NTP synchronized: yes RTC in local TZ: no
Here UTC time is the correct local time. in the clients:
Local time: Mon 2018-02-19 02:07:18 IRST Universal time: Sun 2018-02-18 22:37:18 UTC RTC time: Sun 2018-02-18 22:37:19 Time zone: Asia/Tehran (IRST, +0330) Network time on: no NTP synchronized: yes RTC in local TZ: no
In server machine the date is correct but the time is wrong. In client machine both are wrong.
The peers in clients are
remote refid st t when poll reach delay offset jitter ============================================================================== 192.168.1.202 LOCAL(0) 11 u 46 64 1 0.381 3201920 0.011 *LOCAL(0) .LOCL. 10 l 17 64 377 0.000 0.000 0.000
But when I use command
sudo apt update date became correct in clients:
Local time: Thu 2018-02-22 19:16:44 IRST Universal time: Thu 2018-02-22 15:46:44 UTC RTC time: Sun 2018-02-18 22:50:13 Time zone: Asia/Tehran (IRST, +0330) Network time on: no NTP synchronized: no RTC in local TZ: no
But time still is wrong! I used the command
date -s "correct time and date", but after restarting it goes wrong!
How can I fix the problem!