Computer man
Configure NTP Server

Install NTPd and Configure NTP server for time adjustment.

[NTPd Server] |192.0.0.20 ---------------- 192.0.0.30| [NTPd Client]
Server.example.com <---------------------> Client.example.com

Server Configuration:-

[root@server ~]# yum -y install ntp
[root@server ~]# vi /etc/ntp.conf
#edit entry as per below
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
restrict 192.0.0.0 mask 255.255.255.0 nomodify notrap
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

[root@server ~]# systemctl start ntpd
[root@server ~]# systemctl enable ntpd

If Firewalld is running, allow NTP service. NTP uses 123/UDP.

[root@server ~]# firewall-cmd --add-service=ntp --permanent
success
[root@server ~]# firewall-cmd --reload
success

To Verify

[root@server ~]# ntpq -p

NTP Client Configuration:-


For client NTP configuration, add the below configuration in the /etc/ntp.conf file

[root@server ~]#cat /etc/ntp.conf
[restrict default kod nomodify notrap nopeer noquery
[restrict -6 default kod nomodify notrap nopeer noquery
[restrict 127.0.0.1
[restrict -6 ::1
server server.eaxmple.com
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

Now you can start the ntpd service.

[root@server ~]# systemctl start ntpd
[root@server ~]# systemctl enable ntpd
Please email me if you face any issue.

Name:

Email:

Comments:

views
PHP Hits Count