华为NTP配置教程(二)
首页 > HuaWei > 基础配置   作者:浙江思唯网络  2016年10月19日 12:13 星期三  字号:   评论:0 条
时间:2016-10-19 12:13   评论:0 条 

华为NTP配置教程(二)

华为NTP配置教程(一):http://www.023wg.com/jcpz/361.html

10、配置NTP KOD

KODKiss-o'-Death)是NTPv4提出的一种全新的访问控制技术,主要用于服务器向客户端上提供状态报告和接入控制等信息。在服务器上使能KOD功能后,服务器会根据系统的运行状态向客户端发送DENY KissRATE Kiss码。

当客户端接收到DENY Kiss码,客户端将断开与服务器的所有连接,并停止向服务器发送报文。当客户端接收到RATE Kiss码,客户端将立即缩短与该服务器的轮询时间间隔,且以后每次接收到RATE Kiss码,轮询时间间隔都会进一步缩短。

KOD支持单播客户端/服务器模式、对等体模式和多播模式。KOD仅在NTPv4上有效。

1、使能KOD功能

[Huawei]ntp-service kod-enable

 

2、对入方向NTP报文速率的控制

[Huawei]ntp-service access limited ?

  INTEGER<2000-2999>  Apply basic ACL

  ipv6                NTP IPv6 service

  

11、配置NTP认证

在一些对安全性要求较高的网络中,运行NTP协议时需要启用验证功能。通过客户端和服务器端的密码验证,可以保证客户端只与通过验证的设备进行同步,从而提高网络安全性。

在配置NTP认证功能时,应注意以下原则:

必须先使能NTP认证功能,否则不会进行验证。客户端和服务器端均需要配置NTP认证功能。否则,NTP认证功能不生效。如果使能了NTP认证功能,在客户端配置一个可信的密钥。在服务器端和客户端上配置的密钥必须相同。需要进行时间同步的设备必须声明其密钥可信,否则无法通过验证。在NTP对等体模式下,主动对等体相当于客户端,被动对等体相当于服务器端。

1、使能NTP认证功能

[Huawei]ntp-service authentication enable

 

2、配置NTP认证密钥

[Huawei]ntp-service authentication-keyid ?

  INTEGER<1-4294967295>  Authentication key identifier value

 

[Huawei]ntp-service authentication-keyid 023 ?

  authentication-mode  Specify an authentication mode

 

[Huawei]ntp-service authentication-keyid 023 authentication-mode ?

  md5  MD5 authentication

        

[Huawei]ntp-service authentication-keyid 023 authentication-mode md5 ?

  STRING<1-16>/<24>  Plain text/Encrypted text

 

3、声明可信的密钥

[Huawei]ntp-service reliable authentication-keyid ?

  INTEGER<1-4294967295>  Authentication key identifier value

 

12、查看NTP运行状态信息

<HUAWEI> display ntp-service status

clock status: synchronized

clock stratum: 2

reference clock ID: LOCAL(0)

nominal frequency: 60.0002 Hz

actual frequency: 60.0002 Hz

clock precision: 2^18

clock offset: 0.0000 ms

root delay: 0.00 ms

root dispersion: 0.00 ms

peer dispersion: 10.00 ms

reference time: 15:51:36.259 UTC Apr 25 2012(C6179088.426490A3)

synchronization state: spike (clock will be set in 1010 secs)

display ntp-service status命令输出信息描述

项目

描述

clock status

表示时钟状态。

synchronized:本地时钟被同步到一个NTP服务器或时钟源。

unsynchronized:本地时钟未被同步到任何一个NTP服务器。

clock stratum

表示本地时钟所处的NTP层数。

reference clock ID

表示时钟源。

当本地时钟已被同步到一个远程NTP服务器或某个时钟源时,指示远程NTP服务器的地址或时钟源的标识。

如果采用本地时钟作为参考时钟,将显示Local

如果时钟状态是unsynchronized,将显示None

nominal frequency

表示本地时钟的标称频率。

actual frequency

表示本地时钟的实际频率。

clock precision

表示本地时钟的精度。

clock offset

表示本地时钟相对参考时钟的offset

root delay

表示本地时钟相对主参考时钟总的系统延迟。

root dispersion

表示本地时钟相对主参考时钟的系统离差。

peer dispersion

表示本地时钟和远程NTP对等体时钟的离差。

reference time

表示参考时间戳。

synchronization state

表示本地时钟的同步状态:

clock not set: 表示时钟未更新。

frequency set by configuration: 表示时钟频率由NTP配置而设定。

clock set: 表示时钟已设定。

clock set but frequency not determined: 表示时钟已设定,但时钟频率没有确定。

clock synchronized: 表示时钟已同步。

spike (clock will be set in XXX secs): 表示系统检测到时钟服务器与客户端之间的时间差超过128毫秒,且时钟会在XXX秒内重新生效。

 

13、查看本地设备的NTP会话信息。

<HUAWEI> display ntp-service sessions

 clock source: 224.0.1.1                                                        

 clock stratum: 1                                                             

 clock status: configured, insane, valid, unsynced                             

 reference clock ID: LOCAL(0)                                                   

 reach: 0                                                                      

 current poll: 64                                                              

 now: 9                                                                         

 offset: 0.0000 ms                                  

 delay: 0.00 ms                                                 

 disper: 0.00 ms

display ntp-service sessions命令输出信息描述

项目

描述

clock source

时钟源地址。

clock stratum

时钟源的层数。

时钟层数决定了时钟的准确度,取值范围为116,层数为1的时钟准确度最高,准确度从116依次递减,层数为16的时钟处于未同步状态,不能作为参考时钟。

clock status

指定时钟状态。其中:

configured:表示该会话是配置命令所建立的

master:表示该会话对应的时钟源是当前系统的主时钟源

selected:表示该会话对应的时钟源通过了时钟选择算法

candidate:表示该会话对应的时钟源为候选时钟源

sane:表示该会话对应的时钟源通过健全验证

insane:表示该会话对应的时钟源未通过健全验证

valid:表示该会话对应的时钟源是有效的(通过验证、处于同步状态、层数有效、根延时/离差未越界等)

invalid:表示该会话对应的时钟源是无效的

unsynced:表示该会话对应的时钟源未同步或层数非法

reference clock ID

当本地系统已被同步到一个远程NTP服务器或某个时钟源时,指示远程服务器的地址或时钟源的标识。

reach

时钟源的可达性计数,0表示时钟源不可达。

current poll

NTP报文轮询间隔,即两个连续NTP报文之间的时间间隔,单位为秒。

now

最后一次同步到现在的时间间隔。

offset

表示相对上一级时钟源的时差。

delay

表示相对上一级时钟源的延时。

disper

表示相对于上一级时钟源的离差。

 

14、查看本地设备NTP会话的详细信息。

<HUAWEI> display ntp-service sessions verbose

 clock source: 172.11.12.1                                                       

 clock stratum: 1                                                             

 clock status: configured, insane, valid, unsynced                             

 reference clock ID: LOCAL(0)                                                   

 local mode: client, local poll: 64, current poll: 64                           

 peer mode: server, peer poll: 64, now: 21                                              

 offset: -3.2385 ms,delay: 26.97 ms,  disper: 14.85 ms                            

 root delay: 0.00 ms, root disper: 10.94 ms                                    

 reach: 255, sync dist: 0.058, sync state: 4                                  

 precision: 2^18, version: 3, peer interface: wildcard                         

 reftime: 10:01:38.546 UTC Sep 5 2005(C6C69602.8C00DA1A)                       

 orgtime: 10:01:43.463 UTC Sep 5 2005(C6C69607.76ACC921)                       

 rcvtime: 10:01:43.480 UTC Sep 5 2005(C6C69607.7AF4ADBC)                       

 xmttime: 10:01:43.452 UTC Sep 5 2005(C6C69607.73F1E8E6)                      

 filter delay :  0.03   0.02   0.03   0.02   0.02   0.02   0.04   0.02         

 filter offset:  0.00  -0.01   0.00   0.01   0.00   0.00   0.00   0.00         

 filter disper:  0.03   0.02   0.00   0.11   0.09   0.08   0.06   0.05

 reference clock status: normal

display ntp-service sessions verbose命令输出信息描述

项目

描述

clock source

时钟源地址。

clock stratum

本地系统所处的NTP层数。

clock status

指定时钟状态。其中:

configured:表示该会话是配置命令所建立的

master:表示该会话对应的时钟源是当前系统的主时钟源

selected:表示该会话对应的时钟源通过了时钟选择算法

candidate:表示该会话对应的时钟源为候选时钟源

sane:表示该会话对应的时钟源通过健全验证

insane:表示该会话对应的时钟源未通过健全验证

valid:表示该会话对应的时钟源是有效的(通过验证、处于同步状态、层数有效、根延时/离差未越界等)

invalid:表示该会话对应的时钟源是无效的

unsynced:表示该会话对应的时钟源未同步或层数非法

reference clock ID

当本地系统已被同步到一个远程NTP服务器或某个时钟源时,指示远程服务器的地址或时钟源的标识。当该服务器处于某一VPN内时,将显示该VPN实例的名称。

local mode

本地系统模式。

peer mode

对端系统模式。

local poll

本地选举模式。

peer poll

对端选举模式。

offset

表示相对上一级时钟源的时差。

delay

表示相对上一级时钟源的延时。

disper

表示相对于上一级时钟源的离差。

root delay

本地到主参考时钟总的系统延迟。缺省值是0

root disper

本地相对主参考时钟的系统离差。缺省值是0

reach

可达性标记。表明了相对于时钟源的可达性。

sync dist

表示相对上一级时钟源的同步距离,此参数评价描述时钟源,NTP选择同步距离最小的时钟源。

sync state

同步的状态:

0:时钟没有被更新过

1:从配置信息中得到频率信息

2:时钟被设定

3:时钟被设定,但是还没有决定频率

4:时钟被同步

5:发现错误

precision

对端时钟精度。

version

NTP版本。

peer interface

对端接口。

reftime

参考时间戳。

orgtime

最后发送NTP报文时间。

rcvtime

最后收到NTP报文时间。

xmttime

最后转发NTP报文时间。

filter delay

最后接收的8个报文的过滤延迟。

filter offset

最后接收的8个报文的过滤偏差。

filter disper

最后接收的8个报文的过滤误差。

reference clock status

表示参考时钟的状态,包括:

normal 表示对端时钟可达。

abnormal 表示对端时钟不可达。

 

15、查看从本地设备到参考时钟源的路径

<HUAWEI> display ntp-service trace

server 127.0.0.1,stratum 5, offset 0.024099 s, synch distance 0.06337

server 192.168.1.2,stratum 4, offset 0.028786 s, synch distance 0.04575

server 192.168.2.2,stratum 3, offset 0.035199 s, synch distance 0.03075

server 192.168.10.1,stratum 2, offset 0.039855 s, synch distance 0.01096

refid 127.127.1.0

display ntp-service trace命令输出信息描述

项目

描述

server

NTP服务器的IP地址。

stratum

NTP服务器的层数。

offset

相对上一级时钟源的时差。

synch distance

相对上一级时钟源的同步距离,此参数评价描述时钟源,NTP选择同步距离最小的时钟源。

refid

参考时钟源。

 

16、查看NTP报文的统计信息

<HUAWEI> display ntp-service statistics packet

NTP IPv4 Packet Statistical Information                                       

 ---------------------------------------                                       

 Sent                                  :          100                            

    Send failures                      :          10                            

 Received                              :          1000                            

    Processed                          :          800                            

    Dropped                            :          200                            

       Validity test failures          :          50                            

          Authentication failures      :          20                            

       Invalid packets                 :          50                            

       Access denied                   :          50                            

       Rate-limited                    :          0

       Processing delay                :          50                            

       Interface disabled              :          0                             

       Max dynamic association reached :          0                            

       Others                          :          0

Last 2 packets drop reasons:

  [2011-11-24 12:19:26-08:00] Global drop: NTP service disabled for interface.

  [2011-11-24 12:20:30-08:00] Global drop: NTP service disabled for interface.

1 display ntp-service statistics packet命令输出信息描述

项目

描述

NTP IPv4 Packet Statistical Information

表示IPv4 NTP包的统计信息。

Sent

表示发送的包的数目。

Send failures

表示发送包的失败次数。

Received

表示接收到的包的数目。

Processed

表示处理的包的数目。

Dropped

表示丢弃的包的数目。

Validity test failures

表示由于NTP合法性检验不通过而丢弃的包的数目。

Authentication failures

表示由于认证失败而丢弃的包的数目。

Invalid packets

表示由于包无效而丢弃的包的数目。

Access denied

表示由于访问控制权限拒绝接入而丢弃的包的数目。

Rate-limited

表示由于速度限制而丢弃的包的数目。

Processing delay

表示由于处理延迟而丢弃的包的数目。

Interface disabled

表示由于接口失效而丢弃的包的数目。

Max dynamic association reached

表示由于超过动态连接的最大数目而丢弃的包的数目。

Others

表示由于其它原因而丢弃的包的数目。

Last 2 packets drop reasons

表示最近n次丢包的原因,n最大取10

 

17、查看最新的10条时钟不同步原因

<HUAWEI> display ntp-service event clock-unsync

 1. Clock source   :  10.1.1.1(vrf1)

    Session type   :  client, configured

    Unsync reason  :  Peer reachability lost

    Unsync time    :  2012-07-30 12:24:44+00:00

 

 2. Clock source   :  10.2.1.1(vrf2)

    Session type   :  bdcast client (Interface: Eth0/0/0), dynamic

    Unsync reason  :  Authentication failure

    Unsync time    :  2011-06-15 11:24:44+00:0

 

1 display ntp-service event clock-unsync命令输出信息描述

项目

描述

Clock source

显示服务器时钟的IP地址。

Session type

显示服务器时钟的会话类型。

Unsync reason

显示时钟不同步的原因。

Unsync time

显示时钟不同步时间。

 您阅读这篇文章共花了: 
二维码加载中...
技术交流:欢迎在本文下方留言或加入QQ群:859273036 互相学习。     
本文地址:http://www.023wg.com/jcpz/362.html
版权声明:若无注明,本文皆为“Swiers思唯网络博客”原创,转载请保留文章出处。

返回顶部    首页   
版权所有:Swiers思唯网络博客    浙江思唯网络