ntp peer和ntp server

本文深入解析了NTP协议中的关键命令,包括ntpserver、ntppeer、ntpaccess-group及其语法细节,阐述了它们在网络时间同步中的作用与区别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考网址: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的区别。

模式语法说明
peerAllows time requests and NTP control queries and allows the system to synchronize to the remote system.
query-onlyAllows only NTP control queries. See RFC 1305 (NTP version 3).
serveAllows time requests and NTP control queries, but does not allow the system to synchronize to the remote system.
serve-onlyAllows only time requests. Note: You must configure the ntp server ip-addresscommand before using the serve-onlykeyword.
access-list-numberNumber (from 1 to 99) of a standard IPv4 access list.
access-list-number-expandedNumber (from 1300 to 1999) of an expanded range IPv4 access list.
access-list-nameName 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有关的信息,如轮询周期等。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姜亚轲

你花钱的样子真帅

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值