ntp peer和ntp server

参考网址:https://learningnetwork.cisco.com/thread/42707

ntp peer和ntp server

The “ntp server” command points to a server (meaning you are the
client), and no matter what your clock says, you will jump to the
server’s clock setting because it has presumed authority of knowing
what time it is.

说明:配置“ntp server”这个命令后(说明你是个客户端),然后不管你的时间是多少,你会跳转到服务器的时间设置,因为服务器更有权威嘛

The “ntp peer” command is set between two devices. And the assumption
is that neither one has authority (equal, peering) to know what time
it is, but the two will work on getting in sync. Both sides will
actually shift their clock (maximum jump of two minutes at a time, so
if clocks are way different then it’ll take a while to sync!) towards
each other.

说明:“ntp peer”这个命令配置在两台设备之间,将这两台设备配置为对等体,并且他们会互相努力完成时间的同步


ntp access-group语法

要控制对系统上网络时间协议(NTP)服务的访问,请在全局配置模式下使用ntp access group命令。要删除对NTP服务的访问控制,请使用此命令的no形式。

ntp access-group {peer | query-only | serve | serve-only} {access-list-number |access-list-number-expanded | access-list-name} [kod]

no ntp [access-group {peer | query-only | serve | serve-only} {access-list-number |access-list-number-expanded | access-list-name}]

通过ntp access-group的语法说明,我们能很清晰地看出peer、query-only、serve、serve-only的区别。

模式 语法说明
peer Allows time requests and NTP control queries and allows the system to synchronize to the remote system.
query-only Allows only NTP control queries. See RFC 1305 (NTP version 3).
serve Allows time requests and NTP control queries, but does not allow the system to synchronize to the remote system.
serve-only Allows only time requests. Note: You must configure the ntp server ip-addresscommand before using the serve-onlykeyword.
access-list-number Number (from 1 to 99) of a standard IPv4 access list.
access-list-number-expanded Number (from 1300 to 1999) of an expanded range IPv4 access list.
access-list-name Name of an access list.
kod (Optional) Sends the “Kiss-o-Death” (KOD) packet to any host that tries to send a packet that is not compliant with the access-group policy.

扩展知识

在Cisco网络系统中的NTP配置需要用到的命令及定义:

ntp access-group 该全局命令用于路由器N T P服务的访问控制。
ntp authenticate 是一个全局命令,它启用N T P身份验证。
ntp authentication-key 该全局命令用于定义N T P身份验证的键值。
ntp broadcast 是一个接口命令,用于指定一特定接口来发送N T P广播包。
ntp broadcast client 是一个接口命令,使路由器通过特定接口来接收N T P广播包。
ntp broadcast delay 是一个全局命令,它用于设定数据包在路由器和N T P服务器之间一个回程所需时间的估计值。
ntp clock-period 这条全局命令不必输入,当使用N T P进行系统时钟同步时,路由器将自动产生这条命令。
ntp disable 这条接口命令使特定接口不接收N T P包。
ntp master 这条全局命令用来配置路由器为N T P主时钟,只有当没有可用的外部N T P源或者为测试用途才使用该命令。
ntp peer 该全局命令使路由器的系统时钟与其对等体的时钟同步(或对对等体的时钟进行同步)。
ntp server 该全局命令使路由器的系统时钟由时间服务器进行同步。
ntp source 该全局命令强制路由器在其N T P包中使用特定的源地址。
ntp trusted-key 该全局命令用于确认路由器的特定身份验证键值。
ntp update-calendar 该全局命令使N T P周期性地更新Cisco 7XXX 系列路由器的日历。
show ntp status 是一执行模式命令,用于显示路由器的N T P信息,它可以表明该路由器是通过N T P对等体进行时钟同步还是通过N T P服务器进行同步。
show ntp association[detail] 这条执行模式命令显示与N T P有关的信息,如轮询周期等。

你可能感兴趣的:(网络技术)