LinuxにNTP時刻同期サーバーを迅速に構築する手順

1.ntpのインストール
yum -y install ntp

2.ntp.confを設定
2.1 vim /etc/ntp.conf
方法1:「192.168.100.0」のネットワークのクライアントを時刻同期する
「restrict default kod nomodify notrap nopeer noquery」の後ろ下記を追加
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
 方法2:任意のIPクライアントが時刻を同期することができる
「restrict default kod nomodify notrap nopeer noquery」の後ろ下記を追加
Restrict default nomodify

2.2 タイムサーバーのsereverパラメータを設定
sever IPまたはドメイン 「prefer」
2.3 NTPサーバーの時間遅延を校正
driftfile  ファイル名
2.4 自動起動:chkconfig ntpd on
2.5 校正後時間をCMOSに書き込む
vim /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
3.タイムサーバのステータスを確認
ntpq -p
    
4.クライアントの設定
conteb -e
*/18 * * * * /usr/sbin/ntpdate 192.168.100.102(サーバIPアドレス)

Linux

Posted by arkgame