Ntpd assistance

Rob spamrefuse at yahoo.com
Wed Sep 22 21:37:27 PDT 2004


alden.pierre wrote:
> /etc/rc.conf contains the following:
> 
> ntpdate_enable="YES"
> ntpdate_flags="timex.cs.columbia.edu"
> xntpd_enable="YES"        # Run ntpd Network Time Protocol
> 
> /etc/ntpd.conf contains the following:
> 
> driftfile    /etc/ntp/drift
> server 65.211.109.1
> server 65.211.109.11
> server 209.51.161.238
> server 128.59.59.177

Use /etc/ntp.conf (NOT ntpd.conf).

I would configure this system as follows:

/etc/rc.conf:

ntpdate_enable="YES"
ntpdate_flags="-b 65.211.109.1 65.211.109.11 209.51.161.238 128.59.59.177"
xntpd_enable="YES"


/etc/ntp.conf:

#--------------------------
# prohibit general access to this service
#--------------------------
restrict default ignore

#--------------------------
# localhost has full access to the server
#--------------------------
restrict 127.0.0.1

#--------------------------
# servers to query
#--------------------------
server 65.211.109.1
restrict 65.211.109.1

server 65.211.109.11
restrict 65.211.109.11

server 209.51.161.238
restrict 209.51.161.238

server 128.59.59.177
restrict 128.59.59.177

#--------------------------
# files to use
#--------------------------
driftfile /var/db/ntp.drift


-------------------------------------------------

The idea is, that, at boot up, you force instant time synchronization
with ntpdate, using the list of servers in ntpdate_flags="-b ....".
(check the man page of ntpdate and the -b flag).
Then you allow ntpd to start (xntpd_enable = "YES"), that will keep
the time in sync with the servers in /etc/ntp.conf.
As a regular user, verify nptd's sync behaviour with:

    ntpq -np

I hope that helps.
Rob.




More information about the freebsd-questions mailing list