NTP服务器配置(centos)
2011-01-10 11:31
302 查看
NTP服务器配置
1,检查是否安装。
[root@zxclinux ~]# rpm -q ntp
ntp-4.2.2p1-7.el5
2.编辑配置文件/etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
[align=left]限制其他计算机查询。修改[/align]
restrict 127.0.0.1
开放本机内部接口,用于反馈
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
开放这个网段,不能修改
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
这些是网络中真正服务器!
3.启动服务(最好关掉iptable,使用udp123端口)
Service ntpd start
chkconfig --levels 3 ntpd on
chconfig --list ntpd
ntpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关
设置开机启动。
4.测试
修改网络时间date MMDDhhmmYYYY.ss
ntpq –p检查NTP服务器同步状态
[root@zxclinux ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
61.129.66.79 216.218.192.202 2 u 21 64 3 36.800 75527.0 25.918
www.chinaepg.ne 158.43.128.66 3 u 20 64 3 57.995 75497.6 46.614
211.166.12.46 218.75.4.130 3 u 17 64 3 52.094 75534.2 56.985
LOCAL(0) .LOCL. 10 l 17 64 3 0.000 0.000 0.008
检查本地NTP服务器是否通过NTP校验
ntptrace 158.43.128.66
ntp1.pipex.net: stratum 2, offset -0.000026, synch distance 0.020605
ntp0.nl.uu.net: stratum 1, offset 0.000001, synch distance 0.000410, refid 'PPS'
如果stratum小于16.那么正常
vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
几个命令
#/usr/sbin/ntpdate -u 210.72.145.44 校对时间
#/usr/sbin/ntpdate -q 210.72.145.44 查询不更新
#hwclock --systohc 将机器硬件时钟同步为系统时钟
1,检查是否安装。
[root@zxclinux ~]# rpm -q ntp
ntp-4.2.2p1-7.el5
2.编辑配置文件/etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
[align=left]限制其他计算机查询。修改[/align]
restrict 127.0.0.1
开放本机内部接口,用于反馈
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
开放这个网段,不能修改
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
这些是网络中真正服务器!
3.启动服务(最好关掉iptable,使用udp123端口)
Service ntpd start
chkconfig --levels 3 ntpd on
chconfig --list ntpd
ntpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关
设置开机启动。
4.测试
修改网络时间date MMDDhhmmYYYY.ss
ntpq –p检查NTP服务器同步状态
[root@zxclinux ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
61.129.66.79 216.218.192.202 2 u 21 64 3 36.800 75527.0 25.918
www.chinaepg.ne 158.43.128.66 3 u 20 64 3 57.995 75497.6 46.614
211.166.12.46 218.75.4.130 3 u 17 64 3 52.094 75534.2 56.985
LOCAL(0) .LOCL. 10 l 17 64 3 0.000 0.000 0.008
检查本地NTP服务器是否通过NTP校验
ntptrace 158.43.128.66
ntp1.pipex.net: stratum 2, offset -0.000026, synch distance 0.020605
ntp0.nl.uu.net: stratum 1, offset 0.000001, synch distance 0.000410, refid 'PPS'
如果stratum小于16.那么正常
vi /etc/ntp/step-tickers
加入一行
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
几个命令
#/usr/sbin/ntpdate -u 210.72.145.44 校对时间
#/usr/sbin/ntpdate -q 210.72.145.44 查询不更新
#hwclock --systohc 将机器硬件时钟同步为系统时钟
相关文章推荐
- IT零起步-CentOS6.4配置NTP服务器
- Centos 5.5 NTP服务器配置
- CentOS之NTP服务器配置
- CentOS7之NTP服务器简单配置
- centos NTP服务器配置总结
- ntp服务器和客户端配置(centos安装系列5)
- redhat7.2 centos7.2怎么配置ntp服务器
- centos NTP服务器配置总结
- CentOS下NTP服务器安装配置
- centos6.5配置NTP服务器的详细步骤
- CentOS6.3下配置NTP服务器
- centos7 配置NTP服务器
- CentOS NTP服务器安装与配置
- CentOS 5.5 下配置NTP服务器
- Centos7.1 for NTP服务器配置
- redhat7.2 centos7.2怎么配置ntp服务器
- centos 下配置ntp服务器
- Centos6.5 配置NTP服务器
- CentOS-7.0的核心安装与配置