首页/网络/网络设备配置速查/OSPF 接口认证配置(逐接口精细控制)
本包目录(508 条)
设备开局与基础配置61 条接口与链路73 条VLAN 与二层交换60 条
路由(静态 / OSPF)62 条
ACL 与安全65 条NAT 与出口31 条DHCP 与地址服务32 条堆叠、高可用与备份升级52 条设备排障72 条

OSPF 接口认证配置(逐接口精细控制)

接口认证只作用于单个接口,优先级高于区域认证;链路两端必须模式、密钥、Key ID 完全一致,是跨区域互联最常用的认证方式。

网络设备配置速查网络更新于 2026-10-12
场景单条链路认证、跨厂商对接不同密钥
适用全部三层设备
命令族ospf authentication-mode / ip ospf authentication + key / ospf authentication-mode

华为 VRP

华为 VRP
[Huawei-GigabitEthernet0/0/1] ospf authentication-mode md5 1 cipher Huawei@123
! 不认证:undo ospf authentication-mode

思科 IOS

思科 IOS
SW-CORE-01(config-if)# ip ospf authentication message-digest
SW-CORE-01(config-if)# ip ospf message-digest-key 1 md5 Cisco@123
! 明文口令:ip ospf authentication + ip ospf authentication-key

H3C Comware

H3C Comware
[H3C-GigabitEthernet1/0/1] ospf authentication-mode md5 1 cipher H3C@123
排查口诀:一端有认证一端没有=邻居卡 INIT;模式不一致=卡 INIT;密钥/Key-id 不一致=卡 INIT/2-WAY。display ospf error / show logging 能看到认证失败计数。

易错点

  • Key ID 写错(1 vs 2):同一密码也建不起来
  • 接口认证和区域认证混用且不一致:以接口为准,别想当然

数据来源与参考

  • 华为 OSPF 接口认证
  • Cisco ip ospf authentication
  • H3C OSPF 接口认证

相关工具

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