歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> ntp,ntp服務器

ntp,ntp服務器

日期:2017/3/6 8:55:45   编辑:學習Linux

ntp,ntp服務器

ntp,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

http://xxx/Linuxjc/1157350.html TechArticle

Copyright © Linux教程網 All Rights Reserved