| NTPd : NTPサーバーの設定2014/08/02 | 
| 
NTPd をインストールして、時刻同期のための NTP サーバーを構築します。
 | |
| [1] | NTPd のインストールと設定です。 | 
| 
[root@dlp ~]#  yum -y install ntp  
[root@dlp ~]#  vi /etc/ntp.conf  # 19行目: 時刻同期を許可する範囲を追記 restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap # 同期をとるサーバーを変更 #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.jst.mfeed.ad.jp iburst server ntp2.jst.mfeed.ad.jp iburst server ntp3.jst.mfeed.ad.jp iburst /etc/rc.d/init.d/ntpd start  Starting ntpd: [ OK ] [root@dlp ~]# chkconfig ntpd on  | 
| [2] | Iptables を有効にしている場合は NTP
ポートの許可が必要です。なお、NTP は 123/UDP を使用します。 「-I INPUT 5」の箇所は自身の環境を確認して、適切な値に置き換えてください。 | 
| [root@dlp ~]# iptables -I INPUT 5 -p udp -m state --state NEW -m udp --dport 123 -j ACCEPT  | 
| [3] | 動作確認をしておきます。以下のように結果が返ってくれば OK です。 | 
| [root@dlp ~]# ntpq -p 
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.jst.mfeed. 172.29.1.100     2 u   29   64    1   18.826   -0.126   0.000
+ntp2.jst.mfeed. 172.29.2.50      2 u   28   64    1   21.592    0.018   0.000
*ntp3.jst.mfeed. 133.243.236.18   2 u   28   64    1   22.666   -1.033   0.000
 |