CentOS7系列--2.1CentOS7中安裝配置NTP服務

CentOS7安裝配置NTP服務centos

NTP服務是時間同步服務服務器

1. 安裝NTPd

[root@centos7 ~]# yum install -y ntpcentos7

[jack@centos7 ~]$ vi /etc/ntp.confspa

添加以下的代碼rest

restrict 192.168.0.0 mask 255.255.0.0 nomodify notrapserver

更改時間同步服務器rem

#server 0.centos.pool.ntp.org iburstcmd

#server 1.centos.pool.ntp.org iburst同步

#server 2.centos.pool.ntp.org iburstit

#server 3.centos.pool.ntp.org iburst

server ntp1.jst.mfeed.ad.jp iburst

server ntp2.jst.mfeed.ad.jp iburst

server ntp3.jst.mfeed.ad.jp iburst

[root@centos7 ~]# systemctl start ntpd

[root@centos7 ~]# systemctl enable ntpd

2. 設置防火牆,容許NTP服務使用123/UDP

[root@centos7 ~]# firewall-cmd --add-service=ntp –permanent

[root@centos7 ~]# firewall-cmd –reload

3. 驗證

[root@centos7 ~]# ntpq -p

remote refid st t when poll reach delay offset jitter

==============================================================================

*leontp.ccgs.wa. .GPS. 1 u 2 64 15 443.939 -3.250 4.178

+120.25.115.19 10.137.38.86 2 u 62 64 17 49.708 9.697 6.603

+ntp-sz.chl.la 202.118.1.46 2 u 59 64 17 41.490 13.642 5.630

-202.118.176.2 202.118.177.155 4 u 34 64 37 54.802 27.184 4.129

相關文章
相關標籤/搜索