I am working with two PCs: PC1 (server) and PC2 (client) and I am trying to synchronize their time with NTP. PC1 is not configured to get synchronized with any external time source. I just want whatever time is there on the PC1, PC2 should be synchronized in accordance to that. I've done following changes-:
In PC1 (server)-:
#vi /etc/ntp.conf
server 127.127.1.0
fudge 127.127.1.0 stratum 1
restrict 127.0.0.1
restrict 192.168.50.0 mask 255.255.255.0 nomodify notrap
driftfile /var/lib/ntp/drift
:wq!
#vi /etc/ntp/step-tickers
# List of servers used for initial synchronization.
127.127.1.0
:wq!
#vi /etc/init/rc.conf
ntpd_enable=\"YES\"
:wq!
In PC2 (client)-:
#vi /etc/ntp.conf
server 192.168.50.201
fudge 127.127.1.0 stratum 2
restrict 127.0.0.1
driftfile /var/lib/ntp/drift
restrict 192.168.50.201 mask 255.255.255.255 notrap nomodify
:wq!
#vi /etc/ntp/step-tickers
192.168.50.201
:wq!
#crontab -e
1 * * * * ntpdate -s -b -u 192.168.50.201
:wq!
#vi /etc/init/rc.conf
ntpd_enable=\"YES\"
:wq!
I've also changed the firewall settings at both sides by adding these lines-:
#vi /etc/sysconfig/iptables
-I INPUT -p udp --dport 123 -j ACCEPT
-I OUTPUT -p udp --sport 123 -j ACCEPT
:wq!
However, I am not able to synchronize PC2 date with PC1 date i.e. when I change date in PC1, changes are not immediately reflected in PC2. I am using RHEL 6.2 .
Can anyone tell me where I am going wrong??