华为
[huawei]ospf 10 router-id 1.1.1.1 //创建ospf进程,本地有效area 1 // 进入区域1network 192.168.1.0 0.0.0.255 // 宣告网段,使用反掩码stub // 配置为stub区域stub no-summary // 配置为Totally Stub 完全末节区域。在ABR上配置,其他路由器配置stub区域即可nssa // 配置为nssa区域nssa no-summary // 配置为Totally NSSA abr-summary 192.168.0.0 16 // 在ABR上进行区域内路由汇总,配置路由聚合前,必须执行network命令指定需要聚合的网段。authentication-mode simple plain test // 设置报文加密peer 1.1.1.2 // 用于NBMA网络中指定邻居import-route direct type 1 cost 100 // 引入直连路由,类型为1。 cost为100.其他路由同理asbr-summary 66.1.0.0 16 // 在引入的外部路由上做路由汇总asbr-summary 66.1.0.0 16 tag 66 // 给汇总的外部路由打tag
[huawei-g0/0]ospf ena 10 ar 0 // 在接口下开启ospf,优先级高于network。在华三中:ospf 10 ar 0ospf timer hello 10 // 修改报文发送 或 修改超时时间ospf network-type p2p // 修改网络类型ospf dr-priority 150 // 修改dr选举优先级silent-interface GigabitEthernet 0/0/0 // 设置静默接口ospf authentication-mode simple plain test // 在接口上配置ospf报文加密[huawei]display ospf peer // 查看ospf邻居display ospf lsdb // 查看ospf数据库display ospf lsdb router 1.1.1.1 // 查看1类LSA详细信息display ospf lsdb network 1.1.1.0 // 查看2类LSA详细信息...dis ospf interface g0/0/0 // 查看ospf接口信息dis ospf peer verbose // 查看详细的OSPF邻居信息
锐捷
router ospf 20 # 进程号
router-id 11.1.0.1 # router id
redistribute connected metric-type 1 subnets # 引入直连路由到ospf,类型为1
network 11.1.1.1 0.0.0.3 ar 0 # 宣告网段
pass vlan 10 # 业务vlan内不出现协议报文
area 2 stub # 区域2为stub区域
area 3 stub no-summary # 区域2为totally stub区域
// 路由汇总,只能在ABR或ASBR上操作
area 2 range 10.4.0.0 255.255.0.0 // 汇总域内路由(area后面加的区域,必须是该路由起源的区域)
summary-address 10.1.0.0 255.255.0.0 // ospf对外部路由做汇总,只能在外部路由重分发进来的ASBR路由器上,对外部路由做汇总。int gi0/1
ip ospf network point-to-point // 修改网络类型为p2p 加快网络收敛
// ospf与bfd联动
bfd interval 500 min_rx 500 multiplier 3 // 500m间隔,超过3s没收到即为失联
no bfd echo // 切换bfd模式(echo对接异厂商设备时容易出问题)
ip ospf bfd // ospf与bfd联动
故障排查
邻接关系正常, 学不到路由
检查双方配置,MA 类型和 P2P 类型可以建立邻接,但学不到路由。
路由学习正常,无法建立邻接
检查双方配置,P2MP 和 P2P 类型可以学到路由,但无法建立邻接关系。
解决:修改 p2mp 的 hello 时间,与 p2p 保持一致。(P2MP 默认的 hello 报文是 30s)