Environment: RHEL6.0 I. Configure the NTP server 1. Install the NTP Software Package [root @ client ~] # The configuration of yuminstallntp-y2 and NTP service [root @ server ~] # Grep-v "^ #"/etc/ntp. confdriftfile/var/lib/ntp/driftrestrictdefakokodnomodifynotrapnopeern
Environment: RHEL6.0
1. Configure the NTP server
1. Install the NTP Software Package
[Root @ client ~] # Yum install ntp-y
2. NTP service configuration
[Root @ server ~] # Grep-v "^ #"/etc/ntp. conf
Driftfile/var/lib/ntp/drift
Restrict default kod nomodify notrap nopeer noquery
Restrict-6 default kod nomodify notrap nopeer noquery
Restrict 127.0.0.1
Restrict-6: 1
Restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
Server 192.168.0.254
Server 0.rhel.pool.ntp.org
Server 1.rhel.pool.ntp.org
Server 2.rhel.pool.ntp.org
Server 127.127.1.0 # local clock
Fudge 127.127.1.0 stratum 10
Includefile/etc/ntp/crypto/pw
Keys/etc/ntp/keys
[Root @ server ~] # Cat/etc/ntp/step-tickers)
# List of servers used for initial synchronization.
192.168.0.254
[Root @ server ~] # Cat/etc/sysconfig/ntpd
# Drop root to id 'ntp: ntp 'by default.
SYNC_HWCLOCK = yes
OPTIONS = "-u ntp: ntp-p/var/run/ntpd. pid-g"
3. Start the ntp service
[Root @ server ~] # Chkconfig ntpd on
[Root @ server ~] # Service ntpd start
Starting ntpd: [OK]
4. ntp Test
[Root @ server ~] # Ntpstat
Synchronised to local net at stratum 11
Time correct to within 950 MS
Polling server every 64 s
[Root @ server ~] # Ntpq-p
Remote refid st t when poll reach delay offset jitter
========================================================== ==============================================
Server. INIT. 16 USB-64 0 0.000 0.000 0.000
* LOCAL (0). LOCL. 10 l 50 64 177 0.000 0.000
Client synchronization time:
1. windows
2. linux
[Root @ client ~] # Date
Wed Apr 11 10:43:30 CST 2012