在企业内部网络,不是所有的服务器都可以连接外网,需要搭建一台可以连接外网的服务器用于NTP服务器

  安装环境查看

CentOS搭建内网NTP服务器

  安装ntp

yum -y install ntp

  修改配置文件

driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1    
restrict ::1
restrict 10.1.3.0 mask 255.255.255.0  #可以使用该服务器的IP
server  ntp1.aliyun.com                        #设置一个公网NTP服务器
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor

  重启NTP服务

systemctl restart ntpd

  随意给本机设置一个时间

date -s "2018-03-22 1:00:00"

  过一会大概几分钟查看是否同步

ntpq -p

CentOS搭建内网NTP服务器

  客户端同步

ntpdate 10.1.1.230

CentOS搭建内网NTP服务器

  如果在客户端同步报错则稍等一会即可,是服务器端未正常同步,同时服务器端关闭防火墙和Selinux

相关文章:

  • 2021-09-09
  • 2021-07-23
  • 2022-12-23
  • 2021-04-27
  • 2021-04-10
  • 2021-10-01
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-05-02
相关资源
相似解决方案