NTPサーバーの構築
NTPサーバーを構築してサーバー機の時刻を常に最新に保つようにします。
ついでにLAN内のクライアントマシンがこのサーバー機を参照して時刻を合わせられるようにします。
NTPサーバーのインストール
yumでntpサーバーをインストールします。
[root@jintaro ~]# yum -y install ntp
|
ntpサーバーをインストール
|
NTPサーバーの設定
[root@jintaro ~]# vi /etc/ntp.conf
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
#server 0.fedora.pool.ntp.org dynamic
#server 1.fedora.pool.ntp.org dynamic
#server 2.fedora.pool.ntp.org dynamic
server ntp.nict.jp
server ntp.jst.mfeed.ad.jp
server プロバイダのNTPサーバー
|
ntpサーバーの設定ファイルを開く
←追加 LAN内からの時刻問い合わせ許可
←の3行をコメントアウト
←の3行を追加
|
上記に設定するサーバーはなるべく契約しているプロバイダのNTPサーバーを参照させるようにしましょう。
参考サイト
http://wiki.nothing.sh/page/NTP
NTPサーバーの起動
[root@jintaro ~]# ntpdate ntp.nict.jp
13 Feb 00:39:24 ntpdate[2124]: step time server 133.243.238.243 offset 305.215924 sec
[root@jintaro ~]# service ntpd start
ntpd を起動中: [ OK ]
[root@jintaro ~]# chkconfig ntpd on
[root@jintaro ~]# chkconfig --list ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@jintaro ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*ntp-a2.nict.go. .NICT. 1 u 20 64 17 23.184 41.289 25.588
+ntp3.jst.mfeed. 210.173.176.251 2 u 18 64 17 19.664 41.841 25.472
[root@jintaro ~]#
|
時間を手動であわせてみる
NTPサーバー起動
自動起動on
自動起動設定確認
2〜5でon
状態確認
←*や+になっていれば
動作している
|
クライアント(Windows XP)の設定
LAN内のWindows XPの設定です。
「自動的に...」 → チェック
「サーバー」 → サーバー機のIPアドレス
「今すぐ更新」
時刻の同期を確認
「適用」「OK」
このWindows標準の自動時刻合わせは1週間に1回固定のようです。
じんたろうは桜時計をWindows起動時にスタートアップで起動させてます。
|