把華為交換機設定成(NTP)時鐘源服務器
把華為交換機設定成(NTP)時鐘源服務器
京準電子科技微♥(ahjzsz)
把華為交換機設定成(NTP)時鐘源服務器,提供給下面客戶端Linux服務器使用,
1,先設定交換機的時區,和正確時間
假設地理位置在中國北京,設定本地時區名稱為BJ,
如果系統默認的UTC是倫敦時間,倫敦當地時間為2012年12月1日0時0分0秒,想要得到對應的北京時間的方法是:北京處于+8時區,時間偏移量增加了8,在配置時,就是在系統默認的UTC時區的基礎上,加上偏移量8,才能得到預期的BJ時區,
clock timezone BJ add 08:00:00
設定時區并在現在的UTC基礎上偏移8
clock datetime 0:0:0 2012-12-01
這是設定時間的命令,設定成對應的北京時間就行,
2,開啟交換機的NTP服務
使能NTP服務器功能,
[~HUAWEI] undo ntp server disable 開啟NTP服務(默認關閉)
[*HUAWEI] commit
配置NTP主時鐘,層數為2,
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
3,下面的是NTP設定的更多功能,可以不配置
配置NTP認證功能,配置認證密鑰并宣告該密鑰可信,
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
廣播模式
配置NTP主時鐘,層數為2,
system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
配置NTP認證功能,配置認證密鑰并宣告該密鑰可信,
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
配置NTP廣播服務器,從介面10GE1/0/1發送NTP廣播報文,并指定使用密鑰ID 42加密,
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp broadcast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
使能NTP服務器功能,
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
組播模式
配置NTP主時鐘,層數為2,
system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
配置NTP認證功能,配置認證密鑰并宣告該密鑰可信,
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
配置NTP組播服務器,從介面10GE1/0/1發送NTP組播報文,并指定使用密鑰ID 42加密,
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp multicast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
使能NTP服務器功能,
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
多播模式
配置NTP主時鐘,層數為2,
system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
配置NTP認證功能,配置認證密鑰并宣告該密鑰可信,
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
配置NTP多播服務器,從介面10GE1/0/1發送NTP多播報文,
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp manycast-server
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
使能NTP服務器功能,
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
————————————————
著作權宣告:本文為CSDN博主「安徽京準電子公司」的原創文章,遵循CC 4.0 BY-SA著作權協議,轉載請附上原文出處鏈接及本宣告,
原文鏈接:https://blog.csdn.net/weixin_44990608/article/details/106807078
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/3715.html
標籤:其他
上一篇:GB/T 30269.809-2020 資訊技術 傳感器網路 第809部分:測驗:基于IP的無線傳感器網路網路層協議一致性測驗
