ntp の変更点   

  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • ntp へ行く。

* ntp server 設定 [#c64bac65]

** server [#qfb62989]
基本的にサブネット内に1個サーバを立てておいて残りはそれにぶら下げるようにする~
# emacs /etc/ntp.conf
 
 # restrict はアクセス制限
 restrict default ignore    # 一旦全てのアクセスを拒否設定
 restrict 127.0.0.1         # ntp の状態を知るために localhostからのアクセス許可
 restrict 210.173.160.27    # 同期する ntp サーバ
 restrict 192.168.0.1 mask 255.255.255.0 notrust nomodify notrap
                            # サブネット内の参照を許可する
 
 # 同期する ntp サーバを列挙
 #server xxx.xxx.xxx        # プロバイダが提供している ntp サーバ
 server 210.173.160.27      # とりあえず ntp1.jst.mfeed.ad.jp でもよし
 
 driftfile /etc/ntp/ntp.drift # drift 用のファイル(必須)

# ntpq -p ~
で ntp の同期状態を確認できる。~
同期までには少し時間がかかかり、reach 回数が一定数以上~
になっていないとサーバとして機能しない~
しばらく待って、* が付いているサーバがあれば OK
       remote           refid      st t when poll reach   delay   offset  jitter
 ==============================================================================
 *ntp1.jst.mfeed. mf-isdn2.mfeed.  2 u    4   64  377   11.232   -0.316   0.103


** client [#s007dbc6]
サブネット内に ntp サーバがあるならそれを参照する~
ただし、同期するほどのものでもないので1日一回程度あわせれば十分~
 emacs /etc/cron.daily/ntpdate

 #!/bin/sh
 /usr/sbin/ntpdate -b ntp.localdomain # サブネット内の ntp を指定
 /sbin/hwclock -w                     # ハードウェアクロックを同期

 chmod a+x /etc/cron.daily/ntpdate