1、ntp.conf中的內容說明:
ios
一、restrict 進行權取控制服務器
restrict default nomodify notrap noquery (不能夠使用ntpq來修改、不提供trap遠程事件登陸、不能用ntpq查詢)網絡
restrict 172.16.28.13 (容許該主機使用)
工具
restrict 192.168.1.0 mask 255.255.255.0 nomodify (容許該網段使用)rest
restrict 127.0.0.1 mask 255.0.0.0server
二、server 設定上層ntp服務來源事件
server 192.0.79.32 prefer (prefer是該主機優先級最高)
rem
server 69.172.201.208
同步
server 127.127.1.0 (當與公用服務器失去聯繫時,以本地時鐘爲客戶端提供時間服務)
it
fudge 127.127.1.0 stratum 10 (設置階層爲10,時間服務器的層級1,2,3...,若是上層是2,則該主機是3,最多15層)
三、driftfile 記錄與上層時間服務的偏差
driftfile /var/lib/ntp/drift
四、keys 設定認證?
keys /etc/ntp/keys
2、工具
一、ntptrace 列出與上層時間服務器的關係
ntptrace -n 127.0.0.1
二、ntpq
ntpq -p 列出與相關的上層服務器狀態
remote: ntp主機,*表示正在起做用的,+表示已鏈接可做爲候選
refid:上一層主機地址?
st:階層stratum
when:幾秒鐘前曾作對時間同步操做
poll:下一次更新在幾箥鍾這後
reach:已向上層服務器請求更新的次數
delay:網絡傳輸中的延遲10^(-6)
offset:時間補償的結果10^(-3)
jitter:系統時間與bios時間差別10^(-6)