Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Setup NTP Server on CentOS/RHEL 7/6 and Fedora 30/29

    How to Setup NTP Server on CentOS/RHEL 7/6 and Fedora 30/29

    RahulBy RahulFebruary 8, 20152 Mins ReadUpdated:June 3, 2019

    We have running approximate 50 systems on our LAN. In which most of the systems are running with Linux operating system’s and few of them are running with Windows and MAC. In this setup, we will configure one of Linux system as NTP server which will be synchronized from public NTP server. Now remaining system’s on LAN will sync their time from local LAN NTP server.

    Setup NTP Server on CentOS/RHEL & Fedora

    Step 1 – Install NTP Server

    NTP packages are available under default repositories. You just log in to your server as root user and execute the following command.

    yum install ntp     ## CentOS/RHEL systems 
    dnf install ntp     ## Fedpra systems 
    

    Step 2 – Setup NTP Server

    Sync Local Time from pool.ntp.org

    First, we need to keep synchronize the time on this server. For this, we will use NTP POOL cluster servers to synchronize the time of the local system. NTP POOL project is providing a large number of cluster servers. Let’s edit the NTP configuration file and update the following values

    vim /etc/ntp.conf
    
    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
    

    As NTP pool providing a large number of server spread worldwide. We suggest using any nearby servers also. You can find nearby servers at http://www.pool.ntp.org/en/.

    Allow LAN Systems

    Now configure your NTP server to allow LAN systems to keep synchronize their time from this server. To do it add the following entry in the configuration file

     restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
    

    ntp-pool-settings

    Step 3 – Restart NTP Server

    NTP server listen on UDP port 123. After making all above configuration, Let’s restart NTP server using following commands.

    For CentOS/RHEL 7 and Fedora

    systemctl start ntpd
    systemctl enable ntpd
    

    For CentOS/RHEL 6/5

    service ntpd start
    chkconfig ntpd on
    
    Network Time ntp
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Memcached on Ubuntu 18.04 & 16.04 LTS
    Next Article FATAL: Ident authentication failed for user "postgres"

    Related Posts

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    Updated:May 10, 20221 Min Read

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Enable SSH Server on Ubuntu 22.04

    Updated:April 22, 20222 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    10 Best Linux Video Players in 2022

    Updated:February 18, 20226 Mins Read

    How to Switch Python Version in Ubuntu & Debian

    Updated:April 22, 20223 Mins Read

    1 Comment

    1. Shantanu on March 16, 2016 11:22 am

      I have configured ntp server on centos 6.7 and entered public ntp server address ” in.pool.ntp.org”. when i run command “ntpq -np” or “ntpstat” then its showing its syncing the time from public ntp server but in actual its not syncing the time automatically. when i set wrong time in my ntp server and wait for some time then it doesn’t correct my system time, Now if i run “ntpq -np, it says it is syncing time from local clock. In this condition i have to restart ntp service, then again it shows time syncing from public ntp server and correct the time also. But its not done automatically.
      We are using clients on windows os here. i have done the necessary settings in internet time tab (Given our ntp server ip) and in registery also but those are also not syncing automatically but if i click on update now button then it corrects the time.

      Please suggest on this.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.