NTP Installation and Configuration on CentOS 7 and RHEL 7

In this tutorial, I am going to show you, NTP installation and configuration on CentOS 7 and RHEL 7. We will configure automatically synchronize time with the closest geographically peers available for our server location by using NTP Public Pool Time Servers list. So let’s start.

What is NTP?

NTP stand for Network Time Protocol. NTP is used for clock synchronization between computers system over networks. It’s run over port 123 UDP at Transport Layer.

NTP installation and configuration

NTP service package is provided by default from official CentOS7 /RHEL7 repositories and we can install by yum with following command.

You can see here our NTP service has been successfully installed.

We can select NTP Pool Server list from pool ntp site

After successfully NTP service installation, We need to go to official NTP Public Pool Time Servers, choose your continent area where the server physically is located, then search for your country location after that you can see NTP servers list for selected country. Like this:-

NTP installation and configuration

 

After NTP server selection, we have to edit our NTP service configuration file. You can find NTP configuration file on this path:- /etc/ntp.conf. So let’s start NTP configuration. First of all we have to comment the default list of Public Servers from pool.ntp.org project and replace it with the list provided for your country like below configuration in bold:-

Here is our public NTP Server has been configured in ntp.conf file.

Now we need to add our network which we want to allow

Now we need to allow clients from our networks to synchronize time with our server. To accomplish this, we need to add the following line to NTP configuration file, where restrict statement controls, Here we can define network, which Network we want to allowed to query and sync time – replace network IPs accordingly. Like this:-

The nomodify notrap statements suggest that your clients are not allowed to configure the server or be used as peers for time sync.

NTP service Logs enable

If you want to additional information for troubleshooting in case there is any issue with your NTP service then you can add a log file statement which will allow to record all NTP server logs into one dedicated log file. You can add log file /var/log/ntp.log at the end of ntp.conf file. Like this:-

NTP Server Configuration has been completed

After all above mandatory configuration changes, we can save ntp.conf file. Our final configuration should be look like this in the below screenshot. In below yellow line is our final configuration.

 

We need to add Firewall Rules for NTP service

NTP service uses UDP port 123 on OSI transport layer (layer 4). We can run this below commands to open 123 port on RHEL7 / CentOS 7 against Firewalld service.

Now we need to enable and start our NTP server.

After that we can start NTP server and make sure ntpd server should be enable at the server boot time. So once your server will restart, NTP server automatically start. You can use below commands to start the ntpd service and enable ntpd service at the boot time.

You can see here our NTP server has been successfully start.

Now we can Verify NTP Server Time Sync

After NTP server has been successfully started, wait a few minutes for the server to synchronize time with its pool list servers, then run the following commands to verify NTP peers synchronization status and your system time.

Here you can see NTP Time Sync successfully.

If you want to query and synchronize against a pool of your choice use ntpdate command, followed by the server or servers addresses, as suggested in the following command line example.

Synchronize NTP Time has been done with NTP pool server.

Check with timedatectl command

You can also check with timedatectl command and your NTP enabled and NTP synchronized should be yes on your NTP server look like this:-

If your NTP synchronized is no then you have to enable with below commands. First you have stop your NTP server and then you have to try to enable NTP synchronized once this enabled you have to start NTP service. Like this:-

Now our NTP server has been successfully installed and configured.

Configure NTP Client on Windows Machine.

Now we are going to configure our Windows to synchronize time with our NTP server. Go to Time from the right side of Taskbar -> Change Date and Time Settings -> Internet Time tab -> Change Settings -> Check Synchronize with an Internet time server -> put your server’s  IP or FQDN on Server filed -> Update now -> OK.

After that our windows will be sync with our NTP server.

Configure NTP Client on Linux server

Now I am going to show you how to configure NTP client on Linux7 and CentOS7. We need to install ntp package on client as like NTP server.

After package installation we need to add NTP server IP in /etc/ntp.conf file like this:-

After that we need to enable and start our ntp service on NTP client. Like this:-

Now you have to check with timedatectl command and your  output will be look like below. If there is any different you can perform above NTP server timedateclt steps to correct it.

After that you can see you client date automatically sync with your NTP server.

That’s all  we have completed NTP server and NTP Client installation and Configuration.

You can also check with below link how to configure DNS on CentOS 7 and RHEL 7

 

This Post Has 45 Comments

  1. cialis buy online

    It’s going to be end of mine day, except before finish I am reading this great article to increase my knowledge.

  2. how to get help in windows 10

    Hi, Neat post. There’s an issue together with your website in web explorer, might test
    this? IE nonetheless is the marketplace chief and a
    big component to people will miss your excellent writing because of this problem.

  3. fastest proxy

    Very interesting topic, thankyou for putting up.

  4. gamefly free trial

    I’m not sure where you are getting your information,
    but good topic. I needs to spend some time learning more or understanding more.
    Thanks for wonderful info I was looking for this information for
    my mission.

  5. http://canadianorderpharmacy.com/

    Nice replies in return of this matter with real arguments and telling everything concerning that.

  6. Free Stuff

    I simply needed to thank you so much once again. I’m not certain the things I might have worked on in the absence of the creative ideas provided by you over my area. Previously it was a very troublesome scenario for me, however , understanding the very professional way you treated that made me to cry with happiness. Now i am grateful for this service and as well , trust you know what an amazing job that you are accomplishing instructing people via your webblog. I am sure you’ve never come across any of us.

  7. Free Stuff

    This design is steller! You certainly know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

  8. Guqinz

    We absolutely love your blog and find many of your post’s to be exactly I’m looking for. Does one offer guest writers to write content to suit your needs? I wouldn’t mind producing a post or elaborating on many of the subjects you write with regards to here. Again, awesome web log!

  9. Free Stuff

    Hello There. I found your blog using msn. This is a very well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will certainly comeback.

  10. Free Stuff

    Wow! This can be one particular of the most beneficial blogs We’ve ever arrive across on this subject. Basically Magnificent. I am also an expert in this topic therefore I can understand your effort.

  11. eebest8

    “While I was browsing today I noticed a great article about”

  12. Greta

    I have read so many articles or reviews concerning the blogger lovers but this post is truly a nice piece of writing, keep it up.

  13. bandarqq356

    I do not even know the way I finished up here, but I assumed this
    put up used to be great. I don’t understand
    who you might be however definitely you’re going to a well-known blogger when you
    aren’t already. Cheers!

  14. oprolevorter

    I like this internet site because so much useful stuff on here : D.

  15. Quentin

    I blog often and I really thank you for
    your information. This great article has really peaked my interest.

    I am going to take a note of your blog and keep checking
    for new details about once per week. I subscribed to your RSS feed too.

  16. Gia

    I’ll right away clutch your rss feed as I can’t find your e-mail subscription hyperlink or e-newsletter service.
    Do you have any? Kindly permit me recognize
    in order that I may subscribe. Thanks.

  17. Adrianne

    Hey very nice blog!

  18. Alena

    Right now it sounds like Movable Type is the top blogging platform out there right now.
    (from what I’ve read) Is that what you are using on your blog?

  19. Hairstyles

    Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say superb blog!

  20. vulkan.msk.ru

    Superb, what а web site it iѕ! This website givs helpful data tо us, keeр it uρ.

  21. Renita Alcine

    Hello There. I discovered your blog the use of msn. That is an extremely well written article. I will make sure to bookmark it and come back to read extra of your useful info. Thank you for the post. I will definitely comeback.|

  22. Rudy Rittenour

    Hi there, just become alert to your blog thru Google, and found that it’s really informative. I’m gonna be careful for brussels. I will appreciate should you continue this in future. Lots of other people will probably be benefited out of your writing. Cheers!|

  23. Joey Arbizo

    Keep on working, great job!|

  24. Erasmo Barajos

    Hello! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche. Your blog provided us useful information to work on. You have done a marvellous job!|

  25. Bradford Tallada

    I believe that is one of the so much important information for me. And i am happy reading your article. However want to remark on few general things, The web site style is ideal, the articles is actually nice : D. Excellent activity, cheers|

  26. Malcom Almada

    If you are going for finest contents like myself, simply pay a visit this website all the time because it provides feature contents, thanks|

  27. Lawrence Wohlfahrt

    You ought to be a part of a contest for one of the most useful blogs on the web. I am going to recommend this site!|

  28. Stefan Koppinger

    This is very interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I have shared your website in my social networks!|

  29. Leslie

    Excellent post. I was checking constantly this blog and I am impressed! Very helpful info specially the last part 🙂 I care for such information a lot. I was looking for this particular info for a long time. Thank you and best of luck.|

  30. accounting firms near me

    Excellent post. I certainly love this website. Keep it up!

  31. Iraida

    Hey! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy reading through your posts. Can you recommend any other blogs/websites/forums that cover the same topics? Thank you so much!|

  32. Bennie

    Sweet blog! I found it while searching on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Many thanks|

  33. Hello

    Major thankies for the blog post.Really thank you! Awesome.

  34. MEGA888 Situs Judi Slot Games Online Indonesia 2020

    Hello there! I just would like to give you a
    big thumbs up for the great info you have got right here on this post.
    I will be returning to your website for more soon.

  35. see here

    Remarkable! Its truly awesome piece of writing, I have got much clear idea on the topic of from
    this post.

  36. http://images.google.mv/

    Somеbody neceѕsarily lend a һand to mɑke signifіcantly articles І mіght state.

    Thiѕ iѕ thhe fіrst tіme Ӏ frequented үour web paցe andd so far?

    I amazed witһ the reѕearch yoou made to сreate tһiѕ particuⅼar put
    up incredible. Grеаt activity!

  37. Dino

    Every weekend i used to visit this web site, for the reason that
    i wish for enjoyment, since this this web page conations actually fastidious funny material
    too.

  38. bear

    Hi! I know this is kinda off topic but I was wondering which blog platform are you
    using for this website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform.
    I would be fantastic if you could point me in the direction of a
    good platform.

  39. Why does it prompt an API exception when the API is bound?

    Generally Ӏ do not read pоs on blogs, but I ᴡish to say thaat this write-up very pressured
    mе to tryy and do so! Yoսr writing style has been amazed
    me. Thanks, very nice poѕt.

  40. creatine

    This piece of writing is really a pleasant one it helps new the web people, who are wishing for blogging.

  41. john weak

    A big thank you for your article. Want more.

  42. https://34.87.10.172/

    Looking forward to reading more. Great blog post.Thanks Again. Much obliged.

  43. free amazon gift cards

    Hi, I check your blog regularly. Your story-telling style is awesome, keep it
    up!

  44. Britteny Pery

    I’m just looking for place to start up a blog with a friend where we talk sports in Chicago as well as other things going on nationwide….just for fun. Any suggestions on sites would be great. Thanks..

  45. Misti Mominee

    Thanks a lot for providing individuals with an exceptionally splendid possiblity to read critical reviews from this site. It is often very beneficial and also packed with a great time for me and my office fellow workers to visit your web site minimum three times a week to find out the latest tips you will have. And lastly, we’re always fulfilled for the mind-boggling strategies you serve. Selected two ideas in this posting are undoubtedly the most effective we have all ever had.

Leave a Reply