玩转华为ENSP模拟器系列 | 配置带验证的NTP广播模式示例

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_华为模拟器实验


目标

在局域网中,指定时钟精度高的设备作为NTP服务器,其他的设备同步服务器的时钟。在广播模式下,用户不需要为客户端指定服务器,客户端只要实时侦听广播服务器发送的报文即可。

组网需求

DeviceC和DeviceD在同一个网段,DeviceA在另一个网段。DeviceF连接这两个网段。

DeviceC作为NTP广播服务器,使用本地时钟作为NTP主时钟,层数为3,从接口GE1/0/0向外发送广播消息包。

DeviceD和DeviceA分别从各自的接口GE1/0/0侦听广播消息。

DeviceA、DeviceB、DeviceC和DeviceD上启用NTP验证。

配置思路

  • 配置DeviceC为NTP广播服务器
  • 配置DeviceA和DeviceD为NTP广播客户端
  • 在DeviceA、DeviceC和DeviceD上配置NTP验证

操作步骤

  1. 配置各路由器的IP地址

按图1配置各接口的IP地址。具体过程略。

  1. 配置NTP广播服务器,并启用验证

配置DeviceC使用本地时钟作为NTP主时钟,层数为3。

DeviceC:
ntp-service refclock-master 3

启用NTP验证。

DeviceC:
ntp-service authentication enable
ntp-service authentication-keyid 16 authentication-mode md5 cipher %^%#4XS%<ESZOKjY_)</JkvVysa3(&~qZ'*"]oBt^8RO%^%#
ntp-service reliable authentication-keyid 16

配置DeviceC为NTP广播服务器,从接口GE1/0/0发送NTP广播消息包,并指定使用密钥ID 16加密。

interface Ethernet1/0/0
 ntp-service broadcast-server authentication-keyid 16
  1. 配置与服务器在同一网段的NTP广播客户端DeviceD

启用NTP验证。

DeviceD:
ntp-service authentication enable
ntp-service authentication-keyid 16 authentication-mode md5 cipher %^%#yyD{DZfy`Vp1~8Yd(jS-VE>_TUv{~~HZ"1*DP-~6%^%#
ntp-service reliable authentication-keyid 16

配置DeviceD为NTP广播客户端,从接口GE1/0/0侦听NTP广播消息包。

DeviceD:
interface Ethernet1/0/0
 ntp-service broadcast-client

配置完成后,DeviceD的时钟同步到DeviceC。

  1. 配置与服务器在不同网段的NTP广播客户端DeviceA

启用NTP验证。

DeviceA:
ntp-service authentication enable
ntp-service authentication-keyid 16 authentication-mode md5 cipher %^%#KECr/a6vR>,,\&=DgkM3%fzs-Zf[c&A[h1<^CJ"F%^%#
ntp-service reliable authentication-keyid 16

配置DeviceA为NTP广播客户端,从接口GE1/0/0侦听NTP广播消息包。

interface Ethernet1/0/0
 ntp-service broadcast-client
  1. 验证配置结果

完成以上配置后,DeviceD能够同步到DeviceC,而DeviceA不能同步到DeviceC。

这是因为DeviceA和DeviceC不在同一个网段,收不到DeviceC发出的广播包;而DeviceD和DeviceC在同一个网段,能够收到DeviceC发出的广播包。

查看DeviceD的NTP状态,可以看到时钟状态为“synchronized”,即,已经完成同步。时钟的层数为4,比服务器DeviceC低1级。

[~DeviceD]dis ntp-service status 
 clock status: synchronized
 clock stratum: 4
 reference clock ID: 3.0.1.31 
 nominal frequency: 100.0000 Hz
 actual frequency: 100.0000 Hz
 clock precision: 2^18
 clock offset: 3.5230 ms
 root delay: 1.33 ms
 root dispersion: 2.10 ms
 peer dispersion: 0.00 ms
 reference time: 09:49:25.500 UTC Nov 2 2019(E167CFA5.80000000)
 synchronization state: clock set but frequency not determined
[~DeviceA]dis ntp-service status 
 clock status: unsynchronized
 clock stratum: 16
 reference clock ID: none 
 nominal frequency: 100.0000 Hz
 actual frequency: 100.0000 Hz
 clock precision: 2^18
 clock offset: 0.0000 ms
 root delay: 0.00 ms
 root dispersion: 0.00 ms
 peer dispersion: 0.00 ms
 reference time: 00:00:00.000 UTC Jan 1 1900(00000000.00000000)
[~DeviceA]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值