Page 160 - RHEL8 BOOK
P. 160
Configure NTP server
NTP stands for Network Time Protocol. NTP is an Internet protocol used to synchronise the clocks of
computers to some time reference. Network time protocol plays an major role in various situations its
very important and crucial below are few advantages of NTP. In this article we are going to see How to
install and configure NTP server and Client in RHEL 7 / Centos 7.
1. Event Logging required NTP to synchronise because each and every log will be logged based on
time stamp
2. Cluster Heart beat always depends on NTP (If other node in cluster is not sent and heart beat within
the given seconds node will switched over)
3. Execute an cronjobs on time (defined time) crontab schedules works in time
4. NTP uses UTC for real time synchronization
NTP Server profile
Packages : ntp*
Port Number : 123
Daemon Name : NTPD
Step 1: Install and Configure NTP server and client in RHEL 7
Install the NTP packeges using yum command – Server side configuration
[root@TechTutorials ~]# yum install -y ntp*
Step 2: Allow NTP protocol to communicate with clients
[root@TechTutorials ~]# firewall-cmd --permanent --add-service=ntp
Success
[root@TechTutorials ~]# firewall-cmd --reload
Success
OR
[root@TechTutorials ~]# firewall-cmd --permanent --add-port=123/tcp
Success
[root@TechTutorials ~]# firewall-cmd --reload
Success
Step 3: start and enable NTP service
[root@TechTutorials ~]# systemctl enable ntpd.service
ln -s '/usr/lib/systemd/system/ntpd.service' '/etc/systemd/system/multi-user.target.wants/ntpd.service'
[root@TechTutorials ~]# systemctl start ntpd.service
[root@TechTutorials ~]# systemctl status ntpd.service
Step 4: edit main configuration file and make changes as required to configure NTP
[root@TechTutorials ~]# vim /etc/ntp.conf
# Default Line number 8
restrict default kod nomodify notrap noquery nopeer -->>> allows other clients to query time server
restrict -6 default kod nomodify notrap noquery nopeer --->> allows forces DNS resolution to IPV6
address resolution
:wq
noquary – dumping status data from ntpd
nopeer – all packets attempts to start a peer association
notrap – control message trap service
kod – packet is sent to reduce unwanted queries
nomodify – all ntpq queries that attempts to modification the server
S. Pradhan
(MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
Email Id:-spradhan.iiht@gmail.com
160