Linux
局域网中配?/p>
NTP
服务?/p>
一个局域网内有两台
Linux
,安装了
CentOS5.6
,想配置
NTP
,使两台电脑的时
间保持同步。局域网网段配置?/p>
192.168.100.0 netmask 255.255.255.0
1.
配置
NTP
服务器,要求运行
NTP
服务的计算机能够访问
Internet
。如果不?/p>
联网,则不能保证时间的正确性,因此无法提供
NTP
时间同步服务?/p>
2.
首先检查是否安装了组件?/p>
[root@testmechine ~]# rpm -qa ntp
ntp-4.2.2p1-9.el5.centos.1
假如没有安装?/p>
yum install ntp
来进行安装?/p>
以下操作需?/p>
root
权限?/p>
3.
配置
NTP Server
?/p>
1
?/p>
NTP Server
必须已经联网?/p>
?/p>
2
)修?/p>
/etc/ntp.conf
这个配置文件中有注释,具体配置参数请参考“鸟哥的私房?/p>
-
服务器架设篇?/p>
?/p>
我只修改了如下内容:
# Hosts on local network are less restricted.
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 133.100.11.8 prefer
server 129.7.1.66
server pool.ntp.org
server 202.120.2.101
修改说明?/p>
restrict
192.168.100.0
mask
255.255.255.0
nomodify
notrap
因为我的局域网?/p>
IP
地址段为?/p>
192.168.100.0 mask 255.255.255.0
?/p>
,这个根据自己的网络配置进行?/p>
改?/p>
server 133.100.11.8 prefer
这是从网上参考的,该
NTP
服务器来自日?/p>
server 129.7.1.66
,该
NTP
服务器来自美?/p>
server pool.ntp.org
这是官方推荐
server 202.120.2.101
这是上海交大?/p>
NTP