003.NTP客户端配置

时间:2023-03-09 14:26:16
003.NTP客户端配置

一 NTP客户端同步方式

  • ntpdate定时任务同步
  • ntp服务同步

二 ntpdate定时任务同步

2.1 安装ntp软件

 [root@client ~]# yum -y install ntp #此方式也可只安装nptdate

 [root@client ~]# ntpdate 172.24.8.30 #ntpdate命令同步即可

003.NTP客户端配置

三 ntp服务同步

3.1 安装ntp软件

 [root@client ~]# yum -y install ntp #此方式也可只安装nptdate

3.2 ntp配置

 [root@client ~]# vi /etc/ntp.conf

 restrict 172.24.8.30 nomodify notrap noquery

 server 172.24.8.30 iburst

 server 127.127.1.0

 fudge 127.127.1.0 stratum 10

3.3 启动服务

 [root@client ~]# systemctl start ntpd.service

 [root@client ~]# systemctl enable ntpd.service

3.4 检测状态

 [root@client ~]# ntpdate -u 172.24.8.30 #先手动同步测试一次

 [root@client ~]# systemctl start ntpd.service

 [root@client ~]# systemctl enable ntpd.service

003.NTP客户端配置