タイムサーバNTPの設定。
自サーバは外部のNTPサーバと時刻同期を行い、内部のクライアントからの時刻同期に応答する。
設定ファイルは/etc/ntp.conf
# vi /etc/ntp.conf
# Prohibit general access to this service. restrict default ignore
# Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 127.0.0.1 restrict 133.100.11.8 mask 255.255.255.255 noquery nomodify notrap restrict 133.100.9.2 mask 255.255.255.255 noquery nomodify notrap restrict 210.173.160.27 mask 255.255.255.255 noquery nomodify notrap
# -- CLIENT NETWORK ------- # Permit systems on this network to synchronize with this # time service. Do not permit those systems to modify the # configuration of this service. Also, do not use those # systems as peers for synchronization. restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# restrict mytrustedtimeserverip mask 255.255.255.255 nomodify notrap noquery # server mytrustedtimeserverip server 133.100.9.2 server 133.100.11.8 server 210.173.160.27
認証が必要であればyes なければno。もしくはコメントアウトする。
authenticate no
未使用ならコメントアウト。
#keys /etc/ntp/keys
この二行はコメントアウトする
# server 66.187.233.4 # fudge 127.127.1.0 stratum 10
# /etc/rc.d/init.d/ntpd strat
# /sbin/shkconfig ntpd on
# /usr/sbin/ntpq -p
コマンドを入力すると下記内容が表示される。
remote refid st t when poll reach delay offset jitter ============================================================================== clock.tl.fukuok .GPS. 1 u 3 64 1 458.659 4.297 0.008 clock.nc.fukuok .GPS. 1 u 13 64 1 603.304 -45.629 0.008 ntp1.jst.mfeed. fs-monntp1.mfee 2 u 10 64 1 416.315 15.997 0.008
10分程度起動したままにすると行頭に*や+がつく。
remote refid st t when poll reach delay offset jitter ============================================================================== *clock.tl.fukuok .GPS. 1 u 3 64 1 458.659 4.297 0.008 +clock.nc.fukuok .GPS. 1 u 13 64 1 603.304 -45.629 0.008 +ntp1.jst.mfeed. fs-monntp1.mfee 2 u 10 64 1 416.315 15.997 0.008
この表示になると通信が確立されたことになる。