1) 安装和配置
http://ntp.isc.org在Redhat上安装ntp-4.2.0.tar,或者使用原有的NTP包(目前使用这个)
你只需要在/etc/ntp.conf中设置server和driftfile两项参数即可,server项你可以从上面的主页中找公共的时间服务器域名。例如
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server pool.ntp.org
server asia.pool.ntp.org
server s1d.time.edu.cn
driftfile /var/lib/ntp/drift
在/etc/ntp/ 下的step-tickers中添加时间服务器跟ntp.conf中相同
2) 客户端配置
windows:
net time \timeserver /set /yes来与之同步。可以放该命令在startup
linux:
ntpdate 10.0.101.101
交换机:
ntp server 10.0.101.101
ntp peer 10.0.101.101
clock timezone Peking +8
sh clock
3) 基本操作
./etc/init.d/ntpd start
./etc/init.d/ntpd stop
4) 调试
确定windows NTP客户ntptime正在后台与Linux NTP时间服务器同步
在NTP服务器上运行
# tcpdump udp port 123
查看输出
注:默认是每五分钟ntptime向NTP服务器查询一次,你可以从主页上下载控制面板中的控制条件设置程序
./etc/init.d/ntpd –p