API Guide
Identifier GUID-F2EB09D0-6296-4C9A-B1BC-37EE8903B088
Version 7
Status Translation approved
源 IP 地址
配置要包含在所有 NTP 数据包中的一个接口 IP 地址。NTP 数据包的源地址是系统在默认情况下用于访问网络的接口 IP 地址。
• 在 CONFIGURATION 模式下配置 NTP 数据包的源 IP 地址。
ntp source interface
• ethernet node/slot/port[:subport] — 输入以太网接口信息。
• port-channel channel-id — 输入端口通道 ID,从 1 到 128。
• vlan vlan-id — 输入 VLAN ID 号,从 1 到 4093。
• loopback id — 输入环回接口 ID 号,从 0 到 16383。
• mgmt node/slot/port — 输入管理接口的物理端口接口。默认值为 1/1/1。
配置源 IP 地址
OS10(config)# ntp source ethernet 1/1/10
查看源 IP 配置
OS10(config)# do show running-configuration | grep source
ntp source ethernet1/1/1
Identifier
GUID-8FDF7911-D889-4EFF-896C-DEB75562F233
Version 6
Status Translation approved
身份验证
NTP 身份验证和相应的受信任密钥可为具有受信任时间源的 NTP 数据包提供可靠的交换。NTP 身份验证首先在密钥配置后创建第一
个 NTP 数据包。NTP 身份验证使用消息摘要 5 (MD5) 算法。密钥嵌入在发送到 NTP 时间源的同步数据包中。
1. 在 CONFIGURATION 模式下启用 NTP 身份验证。
ntp authenticate
2. 在 CONFIGURATION 模式下设置身份验证密钥编号和密钥,从 1 到 4294967295。
ntp authentication-key number md5 key
• 必须匹配 ntp trusted-key 命令中的数字。
• key 是加密的字符串。
3. 在 CONFIGURATION 模式下定义受信任密钥,从 1 到 4294967295。此 number 必须与 ntp trusted-key 命令中的编号匹配。
ntp trusted-key number
4. 在 CONFIGURATION 模式下配置 NTP 服务器。
ntp server {hostname | ipv4-address | ipv6-address} [key keyid] [prefer]
• hostname — 输入关键字以查看远程设备的 IP 地址或主机名称。
• ipv4-address — 采用 A.B.C.D 格式输入 IPv4 地址。
• ipv6-address — 采用 nnnn:nnnn:nnnn:nnnn:nnnn:nnnn:nnnn:nnnn 格式输入 IPv6 地址。支持零省音。
• key keyid — 输入文本字符串作为 NTP 服务器与客户端之间交换的密钥。
• prefer — 输入关键字以将此 NTP 服务器设置为首选服务器。
5. 在 CONFIGURATION 模式下,配置 NTP 的主节点并输入标识 NTP 服务器层次结构的层次编号,从 2 到 10。默认值为 8。
ntp master {2–10}
系统管理
175