统信UOS V20(1070e)版本配置NTP服务端

1、安装NTP服务可通过yum install ntp来安装。挂载yum源可参见链接:统信UOS V20(1070e)版本配置yum源本地仓库

2、安装好后,修改ntp配置文件,vi /etc/ntp.conf,保留以下配置
driftfile /var/lib/ntp/drift
restrict 127.0.0.1
server 127.0.0.1
fudge 127.0.0.1 startum 10
restrict 192.168.0.0 mask 255.255.0.0
server 192.168.3.3
这个配置里restrict 192.168.0.0 mask 255.255.0.0是允许192.168.0.0/16网段的设备过来同步时间,server为上层时间服务器。
配置文件中的
restrict default nomodify notrap nopeer noepeer noquery
restrict source nomodify notrap noepeer noquery
tos maxclock 5
crypto
keys /etc/ntp/keys
都注释掉。

3、防火墙需要放通时间服务,或关闭防火墙systemctl stop firewalld。

4、可以在本机或其他设备上用ntpdate -d ntp服务器IP来测试NTP服务端是否正常。

5、如果在本机可以ntpdate -d 本机的IP,但是其他跨网段的设备ntpdate不行,则可以在服务端通过tcpdump -i 网卡接口 host 客户端IP and port 123 -nnv抓包看是否有包过来,如果没有包,则可能为中间链路有ACL拦截。

统信UOS V20(1070a)版本配置NTP服务端,参见链接:https://www.wxcn.com/?p=24879