公司内网环境  需要保持时间一致。但是去外网又不通。

 

先安装ntp服务

yum -y install ntpd

内网环境配置安装ntp服务

 

安装完之后开启ntp服务并设置开机启动

内网环境配置安装ntp服务

 

修改ntp同步时间的地址为内网的ntp地址

首先在/etc/hosts加入

172.31.88.10 pool.ntp.org  #内网ntp服务地址

 

修改/etc/ntp.conf为

driftfile /var/lib/ntp/drift

restrict default nomodify notrap nopeer noquery

restrict 127.0.0.1

restrict ::1

server 172.31.88.10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

disable monitor

 

重启ntpd 服务

service ntpd restart

 

同步时间

ntpdate -u 172.31.88.10

内网环境配置安装ntp服务

完成。

相关文章: