How to Setup NTP Server on CentOS 7/6/5 Linux Systems
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 sever which will be synchronized from public NTP server. Now remaining system’s on LAN will sync their time from local LAN NTP server.
Installing NTP Server
NTP packages are available under default repositories. You just login to your server as root user and execute following command.
# yum -y install ntp
Configure NTP Server
Sync Local Time from pool.ntp.org
First we need to keep synchronize time of this server. For this we will use NTP POOL cluster servers to synchronize time of local system. NTP POOL project is providing large number of cluster servers. Lets edit NTP configuration file and update 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 large number of server spread world-wide. We suggest to use any near by 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 following entry in configuration file
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
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 21
# systemctl start ntpd # systemctl enable ntpd
- For CentOS/RHEL 6/5 and Fedora 20/19
# service ntpd start # chkconfig ntpd on
If You Appreciate What We Do Here On Mimastech, You Should Consider:
- Stay Connected to: Facebook | Twitter | Google+
- Support us via PayPal Donation
- Subscribe to our email newsletters.
- Tell other sysadmins / friends about Us - Share and Like our posts and services
We are thankful for your never ending support.