Previous |
Home | Next |
Version: | - ntpd 4.2.0 |
[bash]# ntpdate
-b pool.ntp.org |
[bash]# cp /etc/ntp.conf
/etc/ntp.conf.original [bash]# vi /etc/ntp.conf |
server 0.pool.ntp.org server 1.pool.ntp.org server 2.pool.ntp.org |
restrict default kod nomodify notrap noquery nopeer |
Parameters |
Definitions |
ignore |
Deny all packets and
queries |
kod |
Send Kiss-Of-Death
packet on access violation |
nomodify |
Deny ntpq / ntpdc
queries that attempt to modify the server |
notrap |
Deny control message
trap service |
noquery |
Deny all ntpq / ntpdc
queries |
noserve | Deny all queries - except ntpq / ntpdc |
notrust |
Deny access unless
cryptographically authenticated (ver 4.2 onwards) |
nopeer |
Deny all packets that
attempt to establish a peer association |
In NTP versions prior to 4.2, the notrust option meant not to trust a server/host for time. In NTP versions 4.2 and later, the notrust option means cryptographic authentication is required before believing the server/host. Unless using cryptography, do not use the notrust option, your client requests will fail. |
restrict 127.0.0.1 |
restrict 0.pool.ntp.org
mask 255.255.255.255 nomodify notrap noquery restrict 1.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery restrict 2.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery |
restrict 192.168.1.0
mask 255.255.255.0 nomodify notrap |
server
127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift broadcastdelay 0.008 keys /etc/ntp/keys |
server |
Specifies that a server
is running on the host (own local
clock) |
fudge |
Passes additional
information to the clock driver |
stratum
10 |
Manually sets the
Stratum the server should operate at (1-15) |
driftfile |
Specifies the location
of the frequency file |
broadcastdelay |
Sets the propagation
delay from the server when broadcasting |
keys |
Store a list of keys
needed for any cryptographic links |
[bash]# ntpdate
-b pool.ntp.org |
[bash]# chkconfig
--level 2345 ntpd on [bash]# /etc/init.d/ntpd restart |
The NTP server uses UDP
packets to query time servers on port 123.
Depending on your Linux configuration, the initscripts for the ntpd
service may have iptables commands to
allow ntpd to access the external time servers. |
[bash]# chkconfig --list ntpd |
[bash]# grep ntpd
/var/log/messages |
galaxy ntpd[1110]: ntpd [email protected] Thu Feb 23 04:42:00 EST 2006 (1) galaxy ntpd[1110]: precision = 2.000 usec galaxy ntpd[1110]: Listening on interface wildcard, 0.0.0.0#123 galaxy ntpd[1110]: Listening on interface wildcard, ::#123 galaxy ntpd[1110]: Listening on interface lo, 127.0.0.1#123 galaxy ntpd[1110]: Listening on interface eth0, 192.168.1.1#123 galaxy ntpd[1110]: kernel time sync status 0040 galaxy ntpd[1110]: frequency initialized 0.000 PPM from /var/lib/ntp/drift |
[bash]# ntpq -pn |
remote
refid st t when poll
reach
delay offset jitter ============================================================================== 80.26.104.184 .INIT. 16 u - 64 0 0.000 0.000 4000.00 128.95.231.7 .INIT. 16 u - 64 0 0.000 0.000 4000.00 64.112.189.11 .INIT. 16 u - 64 0 0.000 0.000 4000.00 127.127.1.0 LOCAL(0) 10 l - 64 0 0.000 0.000 4000.00 |
remote
refid st t when poll
reach
delay offset jitter ============================================================================== *80.26.104.184 217.127.32.90 2 u 66 256 377 470.247 32.058 33.497 +128.95.231.7 140.142.2.8 3 u 254 256 377 217.646 -3.832 2.734 +64.112.189.11 128.10.252.6 2 u 2 256 377 258.208 2.395 47.246 127.127.1.0 LOCAL(0) 10 l 56 64 377 0.000 0.000 0.002 |
Your internal workstation computers will not be able to use the server as a synchronisation source until the LOCAL(0) clock has stable time. This may take up to 15 minutes after starting the NTP daemon. |
[bash]# ntpdate 192.168.1.1 |
[bash]# vi /etc/ntp.conf |
server 192.168.1.1 restrict default ignore restrict 127.0.0.1 restrict 192.168.1.1 mask 255.255.255.255 nomodify notrap noquery driftfile /var/lib/ntp/drift |
These commands are
tested on Windows XP, and may not be
specific to every version of Windows. |
C:\>net time
/setsntp:192.168.1.1 The command completed successfully. |
C:\>net time
/querysntp The current SNTP value is: 192.168.1.1 The command completed successfully. |
C:\>net stop
w32time && net start
w32time The Windows Time service is stopping. The Windows Time service was stopped successfully. The Windows Time service is starting. The Windows Time service was started successfully. |
Adjusting the Windows
registry may cause your computer system
to become unstable, do so at your own risk. |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpClient] "SpecialPollInterval"=dword:00093a80 |
If the service does not
appear to be synchronising with the
Linux server, ensure that the firewall is allowing any required
connections. |
Previous |
Home | Next |