把華為交換機設置成(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