Saturday, 23 May 2015

Configure NTP using Chrony for an isolated network

The 'chrony' package provides 'chronyd' daemon and 'chronyc' command-line utility. The 'chronyd' makes adjustments to the system clock by consulting external time sources, using the NTP protocol.

In this tutorial, we configure Chrony for an isolated network (which is not connected to the Internet). One computer is selected to be the master time server . All other computers are clients of the master.

NTP Server IP Address 192.168.122.1

Configure NTP Server:


1) Install chrony
[root@meru ~]# yum install -y chrony

2) Edit the Server Config file '/etc/chrony.conf' and make the following changes.

#Comment the server entries
#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

# Allow NTP client access from local network.
allow 192.168/16

#Not synchronized to any external source. (local mode)
local stratum 10

# Allow manual time change using chronyc settime command
manual


3) Open UDP Port 123 in firewall
[root@meru ~]# firewall-cmd --zone=public --add-service=ntp --permanent
[root@meru ~]# firewall-cmd --reload

4) Start the server and enable at boot time
[root@meru ~]# systemctl start chronyd
[root@meru ~]# systemctl enable chronyd

5) Verify Chrony tracking
[root@meru ~]# chronyc tracking
Reference ID    : 127.127.1.1 ()
Stratum         : 10
Ref time (UTC)  : Sat May 23 12:31:27 2015
System time     : 0.000000000 seconds fast of NTP time
Last offset     : 0.000000000 seconds
RMS offset      : 0.000000000 seconds
Frequency       : 8.226 ppm fast
Residual freq   : 0.000 ppm
Skew            : 0.000 ppm
Root delay      : 0.000000 seconds
Root dispersion : 0.000001 seconds
Update interval : 0.0 seconds
Leap status     : Not synchronised

The Reference ID field shows the IP Address or name of the NTP Server to which we are synchronized. The value 127.127.1.1 indicates "local" mode (Not synchronized with any external source).


Configure NTP Client:


1) Install chrony
[root@server2 ~]# yum install -y chrony

2) Edit the Client Config file '/etc/chrony.conf' and make the following changes.

#Comment the server entries
#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

#Add server entry 
server 192.168.122.1 iburst

 
3) Start the server and enable at boot time
[root@server2 ~]# systemctl start chronyd
[root@server2 ~]# systemctl enable chronyd

4) Verify Chrony tracking
[root@server2 ~]# chronyc tracking
Reference ID    : 192.168.122.1 (meru.mycompany.com)
Stratum         : 11
Ref time (UTC)  : Sat May 23 12:39:06 2015
System time     : 0.000001926 seconds fast of NTP time
Last offset     : 0.000005437 seconds
RMS offset      : 0.000270029 seconds
Frequency       : 0.008 ppm slow
Residual freq   : 0.001 ppm
Skew            : 0.050 ppm
Root delay      : 0.000190 seconds
Root dispersion : 0.000184 seconds
Update interval : 260.7 seconds
Leap status     : Normal

The Reference ID field shows the IP Address or name of the NTP Server to which we are synchronized.

4) Verify Chrony Sources
[root@server2 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* meru.mycompany.com           10   9   377    66  -9368ns[  -18us] +/-  117us


NOTE: To quickly synchronize with the server,
[root@server2 ~]# ntpdate 192.168.122.1


1 comment:

  1. Nikmati Bonus Menarik Dari Bolavita Sekarang...
    -Nikmati Bous New member 10%
    -Nikmati Bonus Cashback Hingga 10%
    -Nikmati Juga Bonus jackpot Hingga Ratusan juta Rupiah Setiap harinya...

    Info Lengkap Hubungi:
    WA : 0812-2222-995
    Line : cs_bolavita
    Link : www.bolavita1.com

    TERIMA KASIH

    ReplyDelete