[root@server-rhel6 ~]# yum install ntp -y
[root@server-rhel6 ~]# date
Tue Feb 23 16:43:07 PST 2016
vim /etc/ntpd.conf ====> comment this lines first and add required lines
#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
restrict 172.16.28.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0 #local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
[root@server-rhel6 ~]# date -s “1 JAN 2001 12:00:00”
Mon Jan  1 12:00:00 PST 2001
[root@server-rhel6 ~]# date
Mon Jan  1 12:00:02 PST 2001
[root@server-rhel6 ~]# service ntpd restart
Shutting down ntpd: Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â [ Â OK Â ]
Starting ntpd:
[ Â OK Â ]
[root@server-rhel6 ~]# ntpq -p
remote      refid    st t when poll reach  delay  offset  jitter
========================================================================
*LOCAL(0)     .LOCL.      10 l   5  64   1   0.000   0.000  0.000
[root@server-rhel6 ~]# ntpdc -c sysinfo
system peer: Â Â Â Â Â LOCAL(0)
system peer mode: Â Â client
leap indicator: Â Â Â 00
stratum: Â Â Â Â Â Â Â 11
precision: Â Â Â Â Â Â -23
root distance: Â Â Â Â 0.00000 s
root dispersion: Â Â Â 7.94789 s
reference ID: Â Â Â Â [127.127.1.0]
reference time:    bdfb604b.174c634d  Mon, Jan  1 2001 12:00:11.091
system flags: Â Â Â Â auth monitor ntp kernel stats
jitter: Â Â Â Â Â Â Â 0.000000 s
stability: Â Â Â Â Â Â 0.000 ppm
broadcastdelay: Â Â Â 0.000000 s
authdelay: Â Â Â Â Â Â 0.000000 s
[root@server-rhel6 ~]# iptables -I INPUT -p udp –dport 123 -j ACCEPT
[root@server-rhel6 ~]#service iptables save
[root@server-rhel6 ~]#service iptables reload
[root@server-rhel6 ~]# chkconfig ntpd on
————————–Client side—————————————–
[root@rhel6-client1 ~]# date
Tue Feb 23 16:43:13 PST 2016
[root@rhel6-client1 ~]# vim /etc/ntp.conf
comment this lines first and add required lines
#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
server 172.16.28.150 prefer
restrict 172.16.28.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0 #local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
[root@rhel6-client1 ~]# service ntpd restart
Shutting down ntpd: Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â [ Â OK Â ]
Starting ntpd: Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â [ Â OK Â ]
[root@rhel6-client1 ~]# ntpdate -u 172.16.28.150
1 Jan 12:01:06 ntpdate[26161]: step time server 172.16.28.150 offset -601194011.739872 sec
[root@rhel6-client1 ~]# dateÂ
Mon Jan  1 12:01:17 PST 2001
[root@rhel6-client1 ~]# ntpq -p
remote      refid    st t when poll reach  delay  offset  jitter
========================================================================
172.16.28.150  LOCAL(0)     11 u  37  64  377   0.741  -601194 6011940
*LOCAL(0)     .LOCL.      10 l  41  64  37   0.000   0.000  0.000
[root@rhel6-client1 ~]# ntpdc -c sysinfo
system peer: Â Â Â Â Â LOCAL(0)
system peer mode: Â Â client
leap indicator: Â Â Â 00
stratum: Â Â Â Â Â Â Â 11
precision: Â Â Â Â Â Â -23
root distance: Â Â Â Â 0.00000 s
root dispersion: Â Â Â 0.44897 s
reference ID: Â Â Â Â [127.127.1.0]
reference time:    bdfb61eb.66f71ff3  Mon, Jan  1 2001 12:07:07.402
system flags: Â Â Â Â auth monitor ntp kernel stats
jitter: Â Â Â Â Â Â Â 0.000000 s
stability: Â Â Â Â Â Â 0.000 ppm
broadcastdelay: Â Â Â 0.000000 s
authdelay: Â Â Â Â Â Â 0.000000 s
[root@rhel6-client1 ~]# ntpdate -u 172.16.28.150
1 Jan 12:08:04 ntpdate[26210]: adjust time server 172.16.28.150 offset 0.000400 sec
[root@rhel6-client1 ~]# date
Mon Jan  1 12:08:07 PST 2001
[root@rhel6-client1 ~]# chkconfig ntpd on
