NTP Server


Setting your servers’s clock and timezone properly is essential in ensuring the healthy operation of distrubted systems and maintain accurate log timestamps. This article will show you how to install and configure the NTP time synchronization service on an Red Hat Enterprise Linux 7.2 Server.

Set Timezone

# list available timezones
$ timedatectl list-timezones
# set desired timezone
sudo timedatectl set-timezone Asia/Shanghai
# verify the timezone has been set properly
$ timedatectl


yum -y install ntp


Choose ntp servers and add them to the configure file

server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

Setup Client Range

restrict mask nomodify notrap

Log File

logfile /var/log/ntp.log

### Firewall

# firewall-cmd --add-service=ntp --permanent
# firewall-cmd --reload

Service Management

# systemctl start ntpd
# systemctl enable ntpd
# systemctl status ntpd

Verify Server Configure

ntpq -p