NTPd : NTP Server installation on centos7
1. NTP package is provided by default from Centos repositories, and can be installed by the following command:
[root@Centos7 ~]# yum -y install ntp
2. Configure these lines.
[root@Centos7 ~]# vi /etc/ntp.conf
# line 18: add the network range you allow to receive requests
restrict 172.160.0.0 mask 255.255.0.0 nomodify notrap
# change servers for synchronization
#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
server ntp1.example.local iburst
server ntp2.example.local iburst
3. Once the installation completes, start the service and configure it so it starts automatically each time the server boots:
[root@Centos7 ~]# systemctl start ntpd
[root@Centos7 ~]# systemctl enable ntpd
4. Add the NTP service in firewall
[root@Centos7 ~]# firewall-cmd --add-service=ntp --permanent
success
[root@Centos7 ~]# firewall-cmd --reload
success
5. To get a basic report you can use
[root@Centos7 ~]# ntpstat
[root@Centos7 ~]# date
6. To get some information about the time synchronization process
[root@Centos7 ]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+172.16.66.237 162.23.41.10 2 u 811 1024 377 138.115 -5.214 6.138
*sin.wrtpoona.in 198.168.177.157 2 u 262 1024 377 45.978 -0.386 5.468
+greenore.zeip.e 140.203.204.77 2 u 175 1024 177 133.697 0.892 8.112
+mx.fimn.net 85.199.214.102 2 u 931 1024 377 128.804 -2.038 6.486
[root@Centos7 ~]# yum -y install ntp
2. Configure these lines.
[root@Centos7 ~]# vi /etc/ntp.conf
# line 18: add the network range you allow to receive requests
restrict 172.160.0.0 mask 255.255.0.0 nomodify notrap
# change servers for synchronization
#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
server ntp1.example.local iburst
server ntp2.example.local iburst
3. Once the installation completes, start the service and configure it so it starts automatically each time the server boots:
[root@Centos7 ~]# systemctl start ntpd
[root@Centos7 ~]# systemctl enable ntpd
4. Add the NTP service in firewall
[root@Centos7 ~]# firewall-cmd --add-service=ntp --permanent
success
[root@Centos7 ~]# firewall-cmd --reload
success
5. To get a basic report you can use
[root@Centos7 ~]# ntpstat
[root@Centos7 ~]# date
6. To get some information about the time synchronization process
[root@Centos7 ]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+172.16.66.237 162.23.41.10 2 u 811 1024 377 138.115 -5.214 6.138
*sin.wrtpoona.in 198.168.177.157 2 u 262 1024 377 45.978 -0.386 5.468
+greenore.zeip.e 140.203.204.77 2 u 175 1024 177 133.697 0.892 8.112
+mx.fimn.net 85.199.214.102 2 u 931 1024 377 128.804 -2.038 6.486
Comments