# NTPdate - not updating to current time



## userxbw (Oct 31, 2019)

FreeBSD v12 -p10 UEFI TRI boot Linux on UTC net update and win10 that is just win10. I don't really use it, I just keep it installed for a just in case situation, nod  my time never gets updated it is , still.

I added the
server 0.us.pool.ntp.org iburst
because the FreeBSD one wasn't working.

it is 5 hours a head of time


```
$ ntpq -c peer
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*eterna.binary.n 128.252.19.1     2 u    4   64    3   32.439   -0.923   5.613
+t1.time.gq1.yah 208.71.46.33     2 u   58   64    1   81.690   -0.499  10.233
-srcf-ntp.stanfo 171.64.7.73      2 u    3   64    3   62.391    2.729  10.733
+christensenplac 209.51.161.238   2 u   59   64    1   51.614    0.030   2.121
```


```
$ cat  /etc/rc.conf
clear_tmp_enable="YES"
syslogd_flags="-ss"
openntpd_flags="-s"
sendmail_enable="NONE"
hostname="FreeBSD64.net"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
create_args_wlan0="country US regdomain FCC"
#sshd_enable="YES"
#time set on line
ntpd_enable="YES"
ntpd_sync_on_start="YES"
ntpdate_enable="YES"
#powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="/boot/modules/i915kms.ko"
slim_enable="YES"
ifconfig_em0="DHCP"
devfs_system_ruleset="localrules"
autofs_enable="YES"
dbus_enable="YES"
```



```
userx@FreeBSD64.net:~
$ cat /etc/ntp.conf

#
# $FreeBSD: releng/12.0/usr.sbin/ntp/ntpd/ntp.conf 337649 2018-08-11 17:42:42Z brd $
#
# Default NTP servers for the FreeBSD operating system.
#
# Don't forget to enable ntpd in /etc/rc.conf with:
# ntpd_enable="YES"
#
# The driftfile is by default /var/db/ntpd.drift, check
# /etc/defaults/rc.conf on how to change the location.
#

#
# Set the target and limit for adding servers configured via pool statements
# or discovered dynamically via mechanisms such as broadcast and manycast.
# Ntpd automatically adds maxclock-1 servers from configured pools, and may
# add as many as maxclock*2 if necessary to ensure that at least minclock
# servers are providing good consistant time.
#
tos minclock 3 maxclock 6

#
# The following pool statement will give you a random set of NTP servers
# geographically close to you.  A single pool statement adds multiple
# servers from the pool, according to the tos minclock/maxclock targets.
# See http://www.pool.ntp.org/ for details.  Note, pool.ntp.org encourages
# users with a static IP and good upstream NTP servers to add a server
# to the pool. See http://www.pool.ntp.org/join.html if you are interested.
#
# The option `iburst' is used for faster initial synchronization.
#
#pool 0.freebsd.pool.ntp.org iburst

#
# If you want to pick yourself which country's public NTP server
# you want to sync against, comment out the above pool, uncomment
# the next one, and replace CC with the country's abbreviation.
# Make sure that the hostname resolves to a proper IP address!
#
# pool 0.CC.pool.ntp.org iburst

server 0.us.pool.ntp.org iburst
server 1.us.pool.ntp.org iburst
server 2.us.pool.ntp.org iburst
server 3.us.pool.ntp.org iburst

#
# To configure a specific server, such as an organization-wide local
# server, add lines similar to the following.  One or more specific
# servers can be configured in addition to, or instead of, any server
# pools specified above.  When both are configured, ntpd first adds all
# the specific servers, then adds servers from the pool until the tos
# minclock/maxclock targets are met.
#
#server time.my-internal.org iburst

#
# Security:
#
# By default, only allow time queries and block all other requests
# from unauthenticated clients.
#
# The "restrict source" line allows peers to be mobilized when added by
# ntpd from a pool, but does not enable mobilizing a new peer association
# by other dynamic means (broadcast, manycast, ntpq commands, etc).
#
# See http://support.ntp.org/bin/view/Support/AccessRestrictions
# for more information.
#
restrict default limited kod nomodify notrap noquery nopeer
restrict source  limited kod nomodify notrap noquery

#
# Alternatively, the following rules would block all unauthorized access.
#
#restrict default ignore
#
# In this case, all remote NTP time servers also need to be explicitly
# allowed or they would not be able to exchange time information with
# this server.
#
# Please note that this example doesn't work for the servers in
# the pool.ntp.org domain since they return multiple A records.
#
#restrict 0.pool.ntp.org nomodify nopeer noquery notrap
#restrict 1.pool.ntp.org nomodify nopeer noquery notrap
#restrict 2.pool.ntp.org nomodify nopeer noquery notrap
#
# The following settings allow unrestricted access from the localhost
restrict 127.0.0.1
restrict ::1

#
# If a server loses sync with all upstream servers, NTP clients
# no longer follow that server. The local clock can be configured
# to provide a time source when this happens, but it should usually
# be configured on just one server on a network. For more details see
# http://support.ntp.org/bin/view/Support/UndisciplinedLocalClock
# The use of Orphan Mode may be preferable.
#
#server 127.127.1.0
#fudge 127.127.1.0 stratum 10

# See http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.14.
# for documentation regarding leapfile. Updates to the file can be obtained
# from ftp://time.nist.gov/pub/ or ftp://tycho.usno.navy.mil/pub/ntp/.
# Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db.
#leapfile "/etc/ntp/leap-seconds"
leapfile "/var/db/ntpd.leap-seconds.list"
```

what am I missing???


########################

I just did this and I do not know  what effect it will have on the time/date

```
$ sudo tzsetup /usr/share/zoneinfo/America/Chicago
```


----------



## SirDice (Oct 31, 2019)

userxbw said:


> it is 5 hours a head of time


That's too much. If the time difference is too great it's assumed there's something wrong and NTP will refuse to update the clock. This is mainly to prevent a rogue NTP server from making drastic changes. Also check your timezone, especially if it's exactly a couple of hours off. Run tzsetup(8) if it's not correct.

To check your timezone, look at the output from date(1):

```
dice@maelcum:~ % date
Thu Oct 31 16:30:58 CET 2019
```
In this case the timezone is CET, or Central European Time. Which is the correct timezone for me. 

What I typically do with a new installation is to force the clock to update with ntpdate(8). Once it's been set correctly I enable a NTP service (ntpd(8), net/openntpd, whichever you prefer).


----------



## aragats (Oct 31, 2019)

userxbw said:


> FreeBSD v12 -p10 UEFI TRI boot Linux on UTC net update and win10


Not directly related to your question, IMO it's always good to use UTC in MS Windows as well:

```
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
 "RealTimeIsUniversal"=dword:00000001
```


----------



## userxbw (Oct 31, 2019)

Quote


aragats said:


> Not directly related to your question, IMO it's always good to use UTC in MS Windows as well:
> 
> ```
> Windows Registry Editor Version 5.00
> ...


yeah, I just installed it then forgot about it.


----------



## userxbw (Oct 31, 2019)

SirDice said:


> That's too much. If the time difference is too great it's assumed there's something wrong and NTP will refuse to update the clock. This is mainly to prevent a rogue NTP server from making drastic changes. Also check your timezone, especially if it's exactly a couple of hours off. Run tzsetup(8) if it's not correct.
> 
> To check your timezone, look at the output from date(1):
> 
> ...


5 hours diff is normal between me and where ever that big clock is that is always on time.  greenwich time zone CLOCK.

I set it to
Thu Oct 31 11:19:34 CDT 2019
just to see and that keeps it not 5 hrs difference.

UTC

```
Let's say you live in Houston, Texas, which is in Central Standard Time (U.S.). 
To convert 18 UTC into your local time, subtract 6 hours, to get 12 CST. During daylight 
saving (summer) time, you would only subtract 5 hours, so 18 UTC would convert to 13 
CDT.
```
Five hrs diff


----------



## acheron (Oct 31, 2019)

SirDice said:


> That's too much. If the time difference is too great it's assumed there's something wrong and NTP will refuse to update the clock. This is mainly to prevent a rogue NTP server from making drastic changes. Also check your timezone, especially if it's exactly a couple of hours off. Run tzsetup(8) if it's not correct.


He has ntpd_sync_on_start=YES in rc.conf so large time difference doesn't matter.


----------



## acheron (Oct 31, 2019)

userxbw said:


> FreeBSD v12 -p10 UEFI TRI boot Linux on UTC net update and win10 that is just win10. I don't really use it, I just keep it installed for a just in case situation, nod  my time never gets updated it is , still.
> 
> I added the
> server 0.us.pool.ntp.org iburst
> because the FreeBSD one wasn't working.



What does these two commands report:

```
host 0.freebsd.pool.ntp.org
ntpq -c peer
```


----------



## userxbw (Oct 31, 2019)

acheron said:


> What does these two commands report:
> 
> ```
> host 0.freebsd.pool.ntp.org
> ...




```
userx@FreeBSD64.net:~
$ host 0.freebsd.pool.ntp.org
0.freebsd.pool.ntp.org has address 198.50.238.163
0.freebsd.pool.ntp.org has address 18.222.40.121
0.freebsd.pool.ntp.org has address 38.229.71.1
0.freebsd.pool.ntp.org has address 63.211.239.58


userx@FreeBSD64.net:~
$ ntpq -c peer
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+srcf-ntp.stanfo 171.64.7.73      2 u   70  128  377   55.333  198.244  56.815
+69.10.161.7     195.205.216.85   3 u   75  128  377   77.336  142.715  81.071
*cartwheel.spide 164.67.62.194    2 u   20  128  377   50.157  167.662  74.696
+y.ns.gin.ntt.ne 249.224.99.213   2 u   75  128  377   18.649  162.550  79.595
userx@FreeBSD64.net:~
$
```

I'm using us pools


----------



## userxbw (Oct 31, 2019)

acheron said:


> He has ntpd_sync_on_start=YES in rc.conf so large time difference doesn't matter.


already done, been posted in 1st post.


```
ntpd_enable="YES"
ntpd_sync_on_start="YES"
ntpdate_enable="YES"
```


----------



## acheron (Oct 31, 2019)

So it means ntpd works fine.


----------



## George (Oct 31, 2019)

`ntpd` has this option too:
*g*, *--panicgate*
         Allow the first adjustment    to be Big.


----------



## acheron (Oct 31, 2019)

Elazar said:


> `ntpd` has this option too:
> *g*, *--panicgate*
> Allow the first adjustment    to be Big.


it's ntpd_sync_on_start


----------

