星空网 > 软件开发 > 操作系统

ntp

一: 在一台可以连接外网的服务器A上配置ntp:

      配置  /etc/ntp.conf  文件:

     server 202.120.2.101            # local clock (LCL)    //该机器同步的ntp服务器

   restrict  192.168.1.0 mask 255.255.255.0 nomodify   //使 192.168.1.0 网段的内网机器可以和该机器同步

 

启动ntp 服务:  /etc/init.d/ntp start

 查看该机器的ntp :

linux11:~ # /etc/init.d/ntp status
remote refid st t when poll reach delay offset jitter
==============================================================================
dns.sjtu.edu.cn .INIT. 16 u - 1024 0 0.000 0.000 0.000

Checking for network time protocol daemon (NTPD): running
linux11:~ # ping dns.sjtu.edu.cn
PING dns.sjtu.edu.cn (202.120.2.90) 56(84) bytes of data.
64 bytes from 202.120.2.90: icmp_seq=1 ttl=45 time=55.1 ms

表明该机器可以和 dns.sjtu.edu.cn 时间同步。

 

二: 在上面的机器A 上打开 37端口,使内网其他的机器可以和该机器做时间同步。

  执行: rpm -qilf /etc/xinetd.conf

   /etc/init.d/xinetd restart

 chkconfig time on

后,查看 37端口,可以看到 37 端口处于监听状态。

 

三: 在内网机器机器上安装 rdate 。可以使用 zypper install rdate 。 

    rdate -s A

在crontab 中配置,使每天凌晨1点和A机器同步。

  00 01 * * * rdate –s 192.168.1.11




原标题:ntp

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流