NTP(Network Time Protocol) インターネット上の時刻同期を行うためのプロトコル。
通信ポートは、UDP 123 を使用します。
NTPを提供しているサーバ
Windowsなどからの設定時には、下記のアドレスを指定します。
ntp.jst.mfeed.ad.jp
Linuxの場合には、下記のアドレスを指定します。
ntp1.jst.mfeed.ad.jp (210.173.160.27)
ntp2.jst.mfeed.ad.jp (210.173.160.57)
ntp3.jst.mfeed.ad.jp (210.173.160.87)
mfeedのNTPサーバへの接続と、クライアントへのNTPサービスの提供を設定します。
#すべての設定を無効にします
restrict defautlt ignore
#指定したNTPサーバへのアクセスを許可します
restrict 210.173.160.27
restrict 210.173.160.57
restrict 210.173.160.87
restrict 127.0.0.1
#クライアントからのアクセスを許可します
restrict 192.168.1.0 mask 255.255.0.0 nomodify notrap
#指定したNTPサーバのアドレス指定
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp
#ローカルサーバの定義(自身もNTPサーバになる場合)
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
#ドリフトファイル/タイムの指定
driftfile /etc/ntp/drift
broadcastdelay 0.008
#NTPのキーファイルの指定
keys /etc/ntp/keys
時刻同期できたかの確認方法
NTPは、その仕組み上、同期するまでにある程度(10分以上)の時間がかかります。
ntpq -p
remote refid st t when poll reach delay offset jitter
===========================================================
+ntp1.jst.mfeed. 172.29.3.60 2 u 20 64 37 23.714 -0.042 1.161
+ntp2.jst.mfeed. 133.243.236.17 2 u 11 64 37 24.009 -0.288 1.005
*ntp3.jst.mfeed. 172.29.3.50 2 u 58 64 17 22.916 -1.683 1.247
LOCAL(0) .LOCL. 10 l 13 64 37 0.000 0.000 0.000