« PreviousNext »

NTPサーバー構築

2 12 月 2007

まずNTPサーバーをインストールする

# yum -y install ntp
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package ntp.i386 0:4.2.4p2-6.fc8 set to be updated
--> Finished Dependency Resolution 

Dependencies Resolved 

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 ntp                     i386       4.2.4p2-6.fc8    fedora            1.4 M 

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)          

Total download size: 1.4 M
Downloading Packages:
(1/1): ntp-4.2.4p2-6.fc8. 100% |=========================| 1.4 MB    00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: ntp                          ######################### [1/1]  

Installed: ntp.i386 0:4.2.4p2-6.fc8
Complete!

設定ファイルを編集する

# vi /etc/ntp.conf
restrict 192.168.254.0 mask 255.255.255.0 nomodify notrap                 ← 19行目前後に追加
※内部にNTPサーバーを提供する場合 

#server 0.rhel.pool.ntp.org                 ← 23行目前後の頭に#を追加
#server 1.rhel.pool.ntp.org                 ← 24行目前後の頭に#を追加
#server 2.rhel.pool.ntp.org                 ← 25行目前後の頭に#を追加
server -4 ntp.nict.jp                 ← 26行目前後に追加
server -4 ntp.jst.mfeed.ad.jp                 ← その下に追加
server -4 ntp03.dion.ne.jp                 ← その下に追加
※上2段は日本標準時間を提供しているサーバー、下は自分のプロバイダのサーバー プロバイダ別NTPサーバー
"/etc/ntp.conf" 61L, 2087C 書込み              

NTPサーバーを起動する前に手動で更新しておく
[root@ns ~]# ntpdate ntp.nict.jp
 1 Dec 22:25:40 ntpdate[5600]: step time server 133.243.238.243 offset 252627082.956685 sec

NTPサーバーを起動する

# /etc/rc.d/init.d/ntpd start
ntpd を起動中:                                             [  OK  ] 

NTPサーバーの自動起動に登録
# chkconfig ntpd on 

NTPサーバーの確認をする
# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ntp-b2.nict.go. .PPS.            1 u   15   64    1   18.507   24.628   0.015
 ntp3.jst.mfeed. 210.173.160.86   2 u   14   64    1   23.128  -10.685   0.015
 ntp03.dion.ne.j 192.168.38.229   2 u   13   64    1   48.555   -3.836   0.015

Posted in NTPサーバー構築 | Trackback | del.icio.us | Top Of Page

    One Response to “NTPサーバー構築”

  1. tramadol strength Says:

    Incredible site!

Leave a Reply