VL5 ntpd
家庭用ホームサーバの再構築、今回はntpdの設定です。
ntdpはサーバー用途としてインストールした場合、既に
インストール済みでしたので、インストール方法は割愛します。
--OSインストール時の環境 VineLinux 5.1
サーバーとしてインストール。追加でXサーバとGNOMEをインストール。
--/etc/ntp.conf を編集する。
$ su -
# cd /etc
# cp ntp.conf ntp.conf-ORG <-オリジナルファイルのバックアップ
# vi ntp.conv
----
# デフォルトで全てのNTPアクセス拒否
restrict default ignore
# ローカルホストからのNTPアクセス許可
restrict 127.0.0.1
# 家庭内クライアントからの問い合わせ許可
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
# 外部のNTPサーバへのNTPアクセス許可
restrict 133.243.238.163 mask 255.255.255.255 nomodify notrap noquery
restrict 133.243.238.164 mask 255.255.255.255 nomodify notrap noquery
restrict 133.243.238.243 mask 255.255.255.255 nomodify notrap noquery
restrict 133.243.238.244 mask 255.255.255.255 nomodify notrap noquery
restrict 210.173.160.27 mask 255.255.255.255 nomodify notrap noquery
restrict 210.173.160.57 mask 255.255.255.255 nomodify notrap noquery
restrict 210.173.160.87 mask 255.255.255.255 nomodify notrap noquery
# 外部のNTPサーバの指定
server ntp.nict.jp
server ntp.jst.mfeed.ad.jp
# CMOSクロックの指定
fudge 127.127.1.0 stratum 10
driftfile /etc/ntp/drift
multicastclient # listen on default 224.0.1.1
broadcastdelay 0.008
----
restrict のフラグ
ignore:全てのパケットを拒否します。
noquery:ntpq のクエリー(照会)を無視します。
nomodify:サーバーの状態を変更しようとする ntpq のクエリー(照会)を
無視します。
noserve:時刻同期要求は拒否しますが、ntpq のクエリー(照会)は
許可します。
notrust:指定したホストを参照先サーバーとして使用しません。
notrap:trap サービスのためのパケットを拒否します。trap サービス は、ntpq コントロールメッセージプロトコルのサブシステムで、SNMP のようなネットワークを経由したイベントロギングマネージャによって利用されることを目的としています。
--ntpdの起動
# service ntpd start
--ntpd自動起動設定 ランレベル3と5で自動起動
# chkconfig --level 35 ntpd on
# chkconfig --list ntpd
--ntpd起動確認
# ntpq -p
クライアントPCの設定は、上記コマンドを実行後しばらく(5分程度)
過ぎてから行いましょう。
ファイヤーウォールにて123/(tcp/udp)ポートを開放する。
クライアントPCの設定
--Windows
コマンドプロンプトを起動して
> net time /setsntp:ntp_server
ntp serverの確認
> net time /querysntp
--Linux
端末を起動して、
# /usr/sbin/ntpdate ntp_server
自動起動させるには、
# vi /etc/cron.daily/ntp.cron
----
#!/bin/sh
/usr/sbin/ntpdate ntp_server
----
# chmod 755 /etc/cron.daily/ntp.cron
過去記事
--NTPサーバ
参考ページ
http://linux.kororo.jp/cont/server/ntp.php
http://www.turbolinux.com/products/server/11s/user_guide/ntpdconf.html
http://www.7key.jp/software/ntp_set.html
http://www.aconus.com/~oyaji/ntp/ntp.htm
「Vine Linux 5.xx」カテゴリの記事
- Vine Linux 5.1 -> 5.2 アップグレード(2011.01.23)
- VL5 Squid アクセスログ解析(2010.11.15)
- VL5 アクセスログ解析 Webalizer(2010.11.14)
- VL5 Clam AntiVirus(2010.11.03)
- VL5 VMwarePlayer(2010.11.02)
「自宅サーバー」カテゴリの記事
- BUFFALO NAS LS-V2.0TL(2011.07.17)
- VL5 Squid アクセスログ解析(2010.11.15)
- VL5 アクセスログ解析 Webalizer(2010.11.14)
- VL5 Clam AntiVirus(2010.11.03)
- VL5 Gparted(パーティション操作)(2010.10.29)
Comments