一、網絡設備作為ntp服務器配置。
1、配置NTP主時鐘
ntp-service refclock-master 2
2.開啟NTP認證
ntp-service authentication enable
3、配置NTP時鐘源本地接口,可以不配置。
ntp-service source-Interface loopback0
4、配置NTP服務器服務認證密碼
ntp-service authentication-keyid 1 authentication-mode md5 cipher admin
5、配置可信秘鑰號
ntp-service reliable authentication-keyid 1
6、開啟NTP服務器功能
undo ntp-service disable
二、網絡設備作為NTP客戶端配置。
1.開啟NTP認證
ntp-service authentication enable
2、配置NTP服務認證密碼
ntp-service authentication-keyid 1 authentication-mode md5 cipher admin
3、配置秘鑰號
ntp-service reliable authentication-keyid 1
4、配置NTP服務器地址
ntp-service unicast-server ?192.168.1.1
三、查看NTP各種狀態
1、查看本地設備的NTP會話信息。
display ntp-service sessions
2、查看本地設備NTP會話的詳細信息
display ntp-service sessions verbose
3、查看從本地設備到參考時鐘源的路徑
display ntp-service trace
4、查看NTP報文的統計信息
display ntp-service statistics packet
5、查看最新的10條時鐘不同步原因
display ntp-service event clock-unsync
查看最新的10條時鐘不同步原因
注意:H3C的設備要手動指定clock protocol ntp,否則不會同步