How to Configure NTP Server on Centos 7?

Today we will look how to install and configure NTP Server on Centos 7. So follow steps below:

1.First we need to install NTPd . to do this open command line :

[root@tekbloq ~]# yum -y install ntp

2. Then open NTP main configuration file for editing:

[root@tekbloq ~]# vi /etc/ntp.conf
# Add the network range you allow to receive requests
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# change servers for synchronization
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#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

3. Then start and enable ntp server:

[root@tekbloq ~]# systemctl start ntpd
[root@tekbloq ~]# systemctl enable ntpd

4. after all that you need to allow ntp service on firewall(NTP service uses UDP port 123). So run next command:

[root@tekbloq ~]# firewall-cmd –add-service=ntp –permanent
success
[root@tekbloq ~]# firewall-cmd –reload
success

5. you can verify you ntp service  with next command:

[root@tekbloq ~]# ntpq -p