1、配置内网NTP-Server(192.168.1.135)
# yum install ntp
# chkconfig ntpd on
# chkconfig --list ntpd
#vim /etc/ntp.conf
-------------------------------------------------------------------------------------------
# Hosts on local network are less restricted.
# 允许内网其他机器同步时间
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn
server 210.72.145.44 perfer # 中国国家受时中心
server 202.112.10.36 # 1.cn.pool.ntp.org
server 59.124.196.83 # 0.asia.pool.ntp.org
# 允许上层时间服务器主动修改本机时间
restrict 210.72.145.44 nomodify notrap noquery
restrict 202.112.10.36 nomodify notrap noquery
restrict 59.124.196.83 nomodify notrap noquery
# 外部时间服务器不可用时,以本地时间作为时间服务
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
-------------------------------------------------------------------------------------------
#service ntpd start
2、配置内网NTP-Clients
# yum install ntp
# chkconfig ntpd on
# chkconfig --list ntpd
#vim /etc/ntp.conf
-------------------------------------------------------------------------------------------
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict -6 ::1
# 配置时间服务器为本地的时间服务器
server 192.168.1.135
restrict 192.168.1.135 nomodify notrap noquery
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
-------------------------------------------------------------------------------------------
#service ntpd start
手动同步服务器时间
ntpdate -u 192.168.1.135
硬件时间与系统时间一起同步
# vim /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes