安装NTP:
yum install ntp配置时间源vi /etc/ntp.confserver 210.72.145.44server ntp.api.bzserver 2.centos.pool.ntp.org配置对客户端(172.16.0.0/24的网段机器)提供NTP服务# vi /etc/ntp.confrestrict 172.16.0。0 mask 255.255.255.0 nomodify notrap配置NTP Server的层数提供本地服务server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 2设置开机时自动运行时间服务chkconfig ntpd on启动或停止时间服务# service ntpd start# service ntpd stop# service ntpd restart验证ntp服务已经运行pgrep ntpd更新本服务器的时间ntpdate -u 210.72.145.44配置iptable规则允许客户端访问本机NTP Severvi /etc/sysconfig/iptables增加一行(NTP Server使用UDP 123端口)-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT重启iptablesservice iptables restart