Client Configuration
Clients should have simple configurations really, there just is not much complexity in setting the clock on a client computer. The one exception to this might be in virtualized environments. In most virtualized environments you should configure the hosting server as a NTP client and the virtual machines with whatever host-guest time synchronization is available on the platform. The two "goals" of a Client NTP Configuration are to specify the server(s) to get time from, and place NTP in a "client" configuration. A simple, locked-down, configuration helps defend the client against potential attack vectors while maintaining functionality. The most common version of this is:server ntp.pool.ntp.org iburst restrict default ignoreThe first line specifies the server to get time from. The NTP Pool Project maintains a list of publicly accessible NTP servers that should be used. The
The second line specifies that the client will not listen to anything. It will not allow other clients to get time from it, nor management information to be pulled - absolutely all incoming requests are ignored. You can just as easily firewall the client and not allow any requests in the first place, but it's good practice to simply close this possibility at the service in addition to denying requests at the firewall. You may want to allow some management functions, mainly to monitor your time synchronization. You can add a third (or more) line to re-enable management functionality for a management server:
restrict 192.0.2.5 noserveThis third line allows the server at 192.0.2.5 unrestricted access to 'query', 'modify', and 'trap' functionalities. If you do not have a monitoring server, or it doesn't use one of these functions they can be individually disable using
Internal Server
Similar to the previous configuration but allowing clients to connect. Additionally it's really important that any NTP Server be connecting to a reliable time source. To that end, pick a single public stratum 1 server and poll it infrequently. Something like this:server tick.usno.navy.mil prefer minpoll 10 maxpoll 16 server 0.us.pool.ntp.org iburst server 1.us.pool.ntp.org iburst server 2.us.pool.ntp.org restrict default kod limited nomodify noquery nopeer notrap discard average 9 minimum 5 driftfile /var/db/ntpd.driftAs in the Client configuration, we still connect to the NTP Pool Project for the bulk of our clock synchronization. Even if your localtime is different from those servers by a few milliseconds, NTP will use their time to stabilize the drift on the local clock. This will result in a more stable localtime even if all external time sources become disconnected. The first server listed here is the US Navy's public NTP Server Cluster. It should only be used by other NTP Server which provide time to clients per the Navy's request. Additionally I've included directives to poll it less often to lighten their load.
If you expect to be disconnect from other time servers regularly you may want to configure your server to use the
Public Server
There's really not much difference in the following configuration from the previous, other than adding some logging. A Public NTP server should be closely monitored to ensure it's providing accurate time as well as not being abused (the UDP nature of NTP means it's easily abused in reflection and amplification attacks).server tick.usno.navy.mil prefer minpoll 10 maxpoll 16 server ntp-oar.usno.navy.mil iburst server ntp-gatech.usno.navy.mil iburst restrict default kod limited nomodify noquery nopeer notrap discard average 9 minimum 5 driftfile /var/db/ntpd.drift logfile /var/log/ntp.log logconfig +sysall +syncall statistics loopstats statsdir /var/log/ntp filegen loopstats file loops type day link enable