交换机配置NTP


华为NTP广播模式:

#核心
ntp-service refclock-master 3		#主时间服务器,使用本地时钟作为NTP主时钟,层数为3,这个按需配置,也可不配置

ntp-service authentication enable 		#启用NTP认证
ntp-service authentication-keyid 15 authentication-mode hmac-sha256 cipher superman
ntp-service reliable authentication-keyid 15

int vlan 200		#从VLANIF200发送NTP广播报文,并指定使用密钥ID 15加密
ntp-service broadcast-server authentication-keyid 15

ntp-service unicast-server 203.107.6.88 	#使用aliyun NTP同步本机
undo ntp-service server disable			#使能NTP服务器功能
dis clock 			#查看时间
#其他汇聚、接入设置
ntp-service authentication enable 
ntp authentication-keyid 15 authentication-mode hmac-sha256 cipher superman
ntp-service reliable authentication-keyid 15

int vlan 200
ntp-service broadcast-client 

华三NTP广播模式:

#核心
<H3C>sys
[H3C]ntp-service enable
[H3C]clock protocol ntp
[H3C]ntp-service refclock-master 3
[H3C]ntp-service unicast-server 203.107.6.88
[H3C]ntp-service authentication enable
[H3C]ntp-service authentication-keyid 15 authentication-mode hmac-sha256 simple superman
[H3C]ntp-service reliable authentication-keyid 15

[H3C]int vlan 200
[H3C-Vlan-interface200]ntp-service broadcast-server
[H3C-Vlan-interface200]ntp-service broadcast-server authentication-keyid 15
#汇聚接入
<SwitchA> system-view
[SwitchA] ntp-service enable
[SwitchA] clock protocol ntp
[SwitchA] ntp-service authentication enable
[SwitchA] ntp-service authentication-keyid 15 authentication-mode hmac-sha256 simple superman
[SwitchA] ntp-service reliable authentication-keyid 15

[SwitchA] interface vlan-interface 200
[SwitchA-Vlan-interface200] ntp-service broadcast-client