2013年8月17日星期六

配置ntpd 服务

由于有些服务器没有外网 IP, 系统的时间经常有问题导致服务异常。想了想,在中间服务器上搭建一个 ntp 服务,没有外网的通过它来同步时间:

上官网上找到最新的包:

./configure  --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks
make && make install
 
vi /etc/ntp.conf 修改 restrict ,允许客户端ip 范围:
 
#restrict 127.0.0.1
#restrict -6 ::1

restrict 192.16.0.0 mask 255.255.0.0 nomodify
restrict 113.X.0.0 mask 255.255.0.0 nomodify
 
保存启动ntpd server 服务:
/usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p /tmp/ntpd.pid
 
服务器ip:192.16.80.5

没有评论:

发表评论