首页/网络/网络设备配置速查/OSPF 区域认证配置(simple / MD5)
路由(静态 / OSPF)62 条

OSPF 区域认证配置(simple / MD5)

区域认证 = 整个区域统一口令:本区域所有路由器同模式同密钥才建邻接;密钥按区域配一次,不需要每接口重复。

网络设备配置速查网络更新于 2026-10-12
场景区域安全加固、防止非法设备接入 OSPF
适用全部三层设备
命令族authentication-mode / area authentication + key / authentication-mode

华为 VRP

华为 VRP
[Huawei-ospf-1] area 0
[Huawei-ospf-1-area-0.0.0.0] authentication-mode md5 1 cipher Huawei@123
! simple 模式:authentication-mode simple cipher Huawei@123

思科 IOS

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

H3C Comware

H3C Comware
[H3C-ospf-1] area 0
[H3C-ospf-1-area-0.0.0.0] authentication-mode md5 1 cipher H3C@123
思科的区域认证要配两段:区域里声明模式 + 接口上放密钥;华为/H3C 在区域视图一次配完密钥。区域认证对区域内所有接口生效,接口认证优先级更高(两者可共存,匹配规则取接口)。

易错点

  • 模式不一致(一端 simple 一端 md5):邻居卡 INIT
  • MD5 密钥或 key-id 不一致:同样建不起来

数据来源与参考

  • 华为 OSPF 区域认证
  • Cisco area authentication
  • H3C OSPF 区域认证

相关工具

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