首页/网络/网络设备配置速查/NTP 认证配置(防伪造时间源)
设备开局与基础配置61 条

NTP 认证配置(防伪造时间源)

不加密的 NTP 可被伪造源欺骗(时间投毒会扰乱日志与证书校验),生产网应启用 NTP 认证;三厂都是 密钥ID + 认证密码 + 服务端标记可信 的组合。

网络设备配置速查网络更新于 2026-10-12
场景内网时间源安全加固
适用全部设备
命令族ntp-service authentication-keyid / ntp authentication-key / ntp-service authentication-keyid

华为 VRP

华为 VRP
[Huawei] ntp-service authentication enable
[Huawei] ntp-service authentication-keyid 1 authentication-mode md5 cipher Ntp@12345
[Huawei] ntp-service reliable authentication-keyid 1
[Huawei] ntp-service unicast-server 10.10.0.5 authentication-keyid 1

思科 IOS

思科 IOS
SW-CORE-01(config)# ntp authentication-key 1 md5 Ntp@12345
SW-CORE-01(config)# ntp authenticate
SW-CORE-01(config)# ntp trusted-key 1
SW-CORE-01(config)# ntp server 10.10.0.5 key 1

H3C Comware

H3C Comware
[H3C] ntp-service authentication enable
[H3C] ntp-service authentication-keyid 1 authentication-mode md5 cipher Ntp@12345
[H3C] ntp-service reliable authentication-keyid 1
[H3C] ntp-service unicast-server 10.10.0.5 authentication-keyid 1
华为/H3C 语法几乎一致(authentication-keyid + reliable + 引用 keyid);思科是 ntp authentication-key + ntp authenticate + ntp trusted-key 三步,服务器命令再挂 key 号。

易错点

  • 两端 keyid 与密码必须一致,且服务端要标记 reliable,否则同步状态一直停在校验失败
  • 服务端更换密钥后客户端未同步更新,表现为“同步过又失同步”,排查时先看两侧密钥配置

数据来源与参考

  • 华为产品文档:NTP 安全认证
  • Cisco IOS NTP 认证配置
  • H3C Comware 7 NTP 认证

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌