LoginSignup
2
2

More than 5 years have passed since last update.

NTPサーバ構築、クライアント設定、centos7

Last updated at Posted at 2017-06-28

NTPサーバ構築

yum -y install ntp

vi /etc/ntp.conf

許可する範囲を指定
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.100.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.200.0 mask 255.255.255.0 nomodify notrap
restrict 172.16.0.0 mask 255.255.240.0 nomodify notrap

同期をとるサーバを指定
server ntp.nict.jp iburst

NTPクライアント

yum -y install ntp

#restrict default kod nomodify notrap nopeer noquery
#restrict -6 default kod nomodify notrap nopeer noquery
restrict default ignore 初期状態としてすべての問い合わせを無視
restrict 192.168.100.2 mask 255.255.240.0 nomodify notrap noquery NTP サーバーとの通信を許可

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.100.2 iburst 参照する NTP サーバー

NTP起動

systemctl start ntpd
systemctl status ntpd

NTP自動起動

systemctl enable ntpd

NTP自動起動確認

systemctl list-unit-files -t service

※ピンポイントで確認したい場合
systemctl list-unit-files | grep ntpd
ntpd.service enabled
ntpdate.service disabled

NTP動作確認

ntpq -p
remote refid st t when poll reach delay offset jitter
=============================================================================
*192.168.100.2 133.243.238.243 2 u 63 64 1 0.900 0.823 0.722

ibrust

初回(初回以外でも条件を満たせばよいが、条件が厳しい)の通信時に2秒間隔で8パケット(8回分のポーリング)を一気に送る。これにより8回分の通信結果を短時間(8回送出するまでに16秒程度)で得る事ができ、同期先を選択するための材料を揃えることができる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2