我正在使用两台 PC:PC1(服务器)和 PC2(客户端),我正在尝试将它们的时间与 NTP 同步。PC1 未配置为与任何外部时间源同步。我只想PC1上的任何时间,PC2都应该按照那个同步。我已经完成了以下更改-:
在 PC1(服务器)-:
#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!
在 PC2(客户端)中-:
#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!
我还通过添加以下几行更改了双方的防火墙设置:
#vi /etc/sysconfig/iptables
-I INPUT -p udp --dport 123 -j ACCEPT
-I OUTPUT -p udp --sport 123 -j ACCEPT
:wq!
但是,我无法将 PC2 日期与 PC1 日期同步,即当我在 PC1 中更改日期时,更改不会立即反映在 PC2 中。我正在使用 RHEL 6.2 。
谁能告诉我哪里出错了??