Install and configure ntp centos 7

In this tutorial, How to install and configure ntp server in Centos. NTP- is a protocol that runs over port 123 UDP at Transport Layer and allows computers to synchronize time over networks for an accurate time.

Install and configure ntp

[vagrant@DevopsRoles ~]$ sudo yum -y install ntp

Configure NTP server

[vagrant@DevopsRoles ~]$ sudo vi /etc/ntp.conf

The content file “ntp.conf” as below

# line 18: add the network range your network
restrict mask nomodify notrap
# change servers for synchronization

Start and startup ntp

[vagrant@DevopsRoles ~]$ sudo systemctl start ntpd
[vagrant@DevopsRoles ~]$ sudo systemctl enable ntpd

If Firewalld is running, allow NTP service. NTP uses 123/UDP.

[vagrant@DevopsRoles ~]$ sudo firewall-cmd --add-service=ntp --permanent
[vagrant@DevopsRoles ~]$ sudo firewall-cmd --reload

Check it works normally

[vagrant@DevopsRoles ~]$ ntpq -p
Install and configure ntp centos 7


You have to install and configure ntp centos 7. I hope will this your helpful. Thank you for reading the DevopsRoles page!

, , , ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.