您的位置:首页 > 编程语言 > PHP开发

NTP--将本主机设置为NTP时钟源,供本机或其他主机使用

2014-11-24 11:34 197 查看
1.  修改/etc/ntp.conf文件,将默认的限制注释掉

#restrict default kod nomodify notrap nopeer noquery

#restrict -6 default kod nomodify notrap nopeer noquery

允许客户端同步时间
restrict 127.0.0.1

restrict -6 ::1

restrict 10.6.23.0 mask 255.255.255.0 nomodify

2. 将本机作为时钟源
server  127.127.1.0
fudge  127.127.1.0 stratum 10

127.127.1.0 代表本主机

3.  完了重启ntp服务,执行命令 ntpq -p
看到LOCAL的一行,就是已经把自己配成自己的时钟源,当然也可以做为别人的时钟源。
要等待几分钟,待前面加上*或+号后 就是已经同步成功了

4. 服务器和客户端防火墙放开
iptables -I INPUT -p udp --sport 123 -j ACCEPT

iptables -I OUTPUT -p udp --dport 123 -j ACCEPT

service iptables save

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐