(1)NTP服务器是用于局域网服务器时间同步使用的,可以保证局域网所有的服务器与时间服务器的时间保持一致,某些应用对时间实时性要求高,必须保证时间的统一性

(2)在互联网中的时间服务器也有很多,

例如: 复旦大学免费NTP:"ntp.fudan.edu.cn

阿里云免费NTP:"ntp1.aliyun.com"


NTP服务器的监听端口为UDP的123端口,如果防火墙开启的话就需要在本地防火墙开启运行客户端访问123端口

实验系统环境

root@rsync[15:33:47]:~#cat /etc/redhat-release CentOS release 6.9 (Final)

在iptables配置文件中添加如下规则:

vim /etc/sysconfig/iptables -A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT

如图所示

部署服务端NTP服务

第一步:yum安装NTP

yum install ntp ntpdate -y

第二步:配置ntp.conf配置文件

\#备份源配置文件 cp /etc/ntp.conf{,.bak} #清空原有文件中的配置内容 > /etc/ntp.conf #编辑ntp.conf配置文件 driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 serv

标签: Linux, 配置文件, 服务器, etc, ntp, NTP, restrict

相关文章推荐

添加新评论,含*的栏目为必填