简介
本文档介绍如何在以应用为中心的基础设施(ACI)交换矩阵解决方案中配置网络时间协议(NTP)。
先决条件
要求
Cisco 建议您了解以下主题:
使用的组件
本文档中的信息基于以下软件和硬件版本:
- 应用策略基础设施控制器 (APIC)
- Nexus 9500
- Nexus 9300
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
配置
步骤1.在菜单栏上,导航至FABRIC > FABRIC POLICIES。
在导航窗格中,执行以下操作:
步骤2.右键单击并选择创建日期和时间策略,如图所示。

步骤3.在“创建日期和时间策略向导”和步骤1 > IDENTITY中,输入以下详细信息:
- 输入姓名
- 输入说明
- 选择管理状态(已启用)
- 选择身份验证状态(禁用)
- 单击下一步,如图所示。

步骤4.步骤2 > NTP服务器
- 指定要在此策略中使用的NTP服务器
- 单击+以添加NTP服务器。
- 在创建提供程序向导中,执行以下操作:
- 输入Name(即主机名或IP地址)
- 输入说明
- 选中首选框。
- 最小轮询间隔(4)
- 最大轮询间隔(6)
- 选择管理EPG(默认(带外))
- 单击OK(确定),如图所示。

步骤5.单击“完成”。
- 在“策略”窗格中,导航到“交换矩阵”>“交换矩阵策略”>“Pod策略”>“策略”>“日期和时间”,选择“日期/时间格式”并执行以下操作:
- 选择时区
- 选择显示格式(本地)
- 选择偏移状态(已启用)
- 单击SUBMIT,如图所示。

步骤6.更新POD策略组以使用日期时间策略,如图所示。

步骤7.将新策略组分配为默认交换矩阵策略组。
- 在窗格中,导航至交换矩阵>交换矩阵策略> Pod策略,选择默认,并在Pod选择器 — 默认工作窗格中执行以下操作:
- 输入说明
- 选择Pod-policy-group作为交换矩阵策略组,如图所示。

验证
使用本部分可确认配置能否正常运行。
从交换机:
fabric1-leaf1# show ntp peers
--------------------------------------------------
Peer IP Address Serv/Peer
--------------------------------------------------
173.36.129.235 Server (configured)
fabric1-leaf1# show ntp peer-status
Total peers : 1
* - selected for sync, + - peer mode(active),
- - peer mode(passive), = - polled in client mode
remote local st poll reach delay vrf
-------------------------------------------------------------------------------
*173.36.129.235 0.0.0.0 3 16 37 0.00134 management
fabric1-leaf1# show ntp statistics peer ipaddr 173.36.129.235
remote host: 173.36.129.235
local interface: Unresolved
time last received: 2s
time until next send: 14s
reachability change: 408s
packets sent: 30
packets received: 30
bad authentication: 0
bogus origin: 0
duplicate: 0
bad dispersion: 0
bad reference time: 0
candidate order: 6
fabric1-leaf1#
从APIC:
admin@apic1:~> cat /etc/ntp.conf
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
#restrict default ignore
restrict 127.0.0.1
#restrict -6 ::1
keysdir /etc/ntp/
keys /etc/ntp/keys
server 173.36.129.235 prefer minpoll 4 maxpoll 6
admin@apic1:~> ntpstat
synchronised to NTP server (173.36.129.235) at stratum 4
time correct to within 268 ms
polling server every 16 s
故障排除
目前没有针对此配置的故障排除信息。