NTPの設定
我が家で常時起動しているPCは玄箱しかないので、とりあえず玄箱を家庭内LANのNTPサーバにしてみます。
参考サイト:
- 第3回 UNIXベースのNTPサーバとWindows Timeサービス (1/3):Windowsネットワーク時刻同期の基礎とノウハウ - @IT
- http://www2.i-e-c.co.jp/common4.html
- NTP サーバ一覧
- 4.2.3 ntpdのインストールと設定
- http://homepage3.nifty.com/sony/sd/contents/aix_ntp.htm
ntpd のインストール
パッケージリストを取得・更新し、nptd をインストール
# apt-get update # apt-get install ntp ntpdate ntp-doc ntp-simple
/etc/ntp.confの設定
restrict default ignore restrict 127.0.0.1 restrict 192.168.1.0 mask 255.255.255.0 restrict ntp.nc.u-tokyo.ac.jp mask 255.255.255.255 nomodify noquery server ntp.nc.u-tokyo.ac.jp server 127.127.1.0 fudge 127.127.1.0 stratum 3 #use default driftfile /var/lib/ntp/ntp.drift statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable
NTPデーモンの再起動
# /etc/init.d/ntp-server restart
確認(ntp.nc.u-tokyo.)の行頭に"*"が付けば同期が取れていると言う事。
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== ntp.nc.u-tokyo. .GPS. 1 u 20 64 1 18.705 3655032 0.002 LOCAL(0) LOCAL(0) 10 l 19 64 1 0.000 0.000 0.002 # ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *ntp.nc.u-tokyo. .GPS. 1 u 26 64 37 17.829 3654956 61.574 LOCAL(0) LOCAL(0) 10 l 26 64 37 0.000 0.000 0.002
WindowsXPから同期させようと思ったのだけど、うまくいかない。
"xxx.xxx.xxx.xxxと同期中にエラーが発生しました。タイム サンプルは拒否されました。ピアの階層は、ホストの階層よりも少ないです。"
ググったけど有効な情報なし。どうしようか。