|
時計サーバをntpサーバといいます。上位のntpサーバと時刻を同期させ、LAN内のWINODWSクライアント等の時計サーバとして動作させます。
$ sudo apt-get install ntp
/etc/ntp.conf を編集
---
# You do need to talk to an NTP server or two (or three). server ntp.ubuntu.com
---これを下記のように編集
# You do need to talk to an NTP server or two (or three). # server ntp.ubuntu.com <-コメントアウト server ntp.nc.u-tokyo.ac.jp (東京大学のサーバの場合)
---
LAN内のホストの時刻合わせのためのサーバにする
(LANのIPアドレスが192.168.1.xxxで、ネットマスクが255.255.255.0の場合) ---
# Clients from this (example!) subnet have unlimited access, but only if # cryptographically authenticated. #restrict 192.168.123.0 mask 255.255.255.0 notrust
---この下に以下を追加
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
---
時刻の初期設定
$ sudo /etc/init.d/ntp stop (一旦NTPを止める) $ sudo ntpdate ntp.nc.u-tokyo.ac.jp (時刻の強制修正) $ sudo /etc/init.d/ntp start (NTP起動)
動作確認
$ ntpq -p
で以下のようにサーバが表示されれば正常にリンクされています。
remote refid st t when poll reach delay offset jitter ============================================================================== ntp.nc.u-tokyo. .GPS. 1 u 2 64 1 19.465 -11.081 0.001
|