Ubuntu16:NTPサーバー設定

NTPサーバー設定

NTPdをインストールして、時刻同期します。

root@www:~# apt-get -y install ntp

NTPdを設定します。

root@www:~# vi /etc/ntp.conf

18行目: 各行頭に「#」を追記してコメント化し、時刻同期する NTP サーバーを追加します。

#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
server ntp1.jst.mfeed.ad.jp iburst
server ntp2.jst.mfeed.ad.jp iburst
server ntp3.jst.mfeed.ad.jp iburst

50行目:時刻同期を許可する範囲を追記します。

restrict 192.168.1.3 mask 255.255.255.0 nomodify notrap

再起動します。

root@www:~# systemctl restart ntp

動作確認します。

root@www:~# ntpq -p
? remote          refid          st t when poll reach delay    offset  jitter
==============================================================================
 ntp.ubuntu.com  .POOL.         16 p -    64   0     0.000    0.000   0.000
 ntp1.jst.mfeed. 133.243.236.17 2  u 1    64   1     21.646   4.806   0.219
 ntp2.jst.mfeed. 133.243.236.18 2  u 1    64   1     21.818   4.799   0.138
 ntp3.jst.mfeed. 133.243.236.19 2  u 2    64   1     21.477   3.643   0.139

コメント

タイトルとURLをコピーしました