Linux 上配置 NTP SERVER__Linux

來源:互聯網
上載者:User
在CENTOS 6.2上面安裝配置NTP SERVER

安裝NTP:
yum install ntp

配置時間源
vi /etc/ntp.conf
server 210.72.145.44
server ntp.api.bz
server 2.centos.pool.ntp.org

配置對用戶端(172.16.0.0/24的網段機器)提供NTP服務
# vi /etc/ntp.conf
restrict 172.16.0。0 mask 255.255.255.0 nomodify notrap


配置NTP Server的層數提供本地服務
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 2

設定開機時自動已耗用時間服務
chkconfig ntpd on

啟動或停止時間服務
# service ntpd start
# service ntpd stop
# service ntpd restart

驗證ntp服務已經運行
pgrep ntpd

更新本伺服器的時間
ntpdate -u 210.72.145.44

配置iptable規則允許用戶端訪問本機NTP Sever
vi /etc/sysconfig/iptables
增加一行(NTP Server使用UDP 123連接埠)
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT

重啟iptables
service iptables restart

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.