Loading... ## 实训目的 · 掌握配置OSPF路由与直连BFD联动的方法。 ## 实训背景 BFD(Bidirectional Forwarding Detection,双向转发检测)协议提供一种轻负载、快速检测两台邻接路由器之间转发路径连通状态的方法。邻居通过该方式可以快速检测到转发路径的连通故障,加快启用备份转发路径,提升现有网络性能。 BFD提供的检测机制与所应用的接口介质类型、封装格式、以及关联的上层协议如OSPF、BGP、RIP等无关。BFD在两台路由器之间建立会话,通过快速发送检测故障消息给正在运行的路由协议,以触发路由协议重新计算路由表,大大减少整个网络的收敛时间。BFD本身没有发现邻居的能力,需要上层协议通知与哪个邻居建立会话。 ## 实训拓扑 ![image.png](https://cdn.gta5pdx.cn/usr/uploads/2022/06/847182255.png) 实验所需设备: 环境:EVE-NG-5.0.8 设备:3台路由器,1台二层交换机 ## 实训步骤 ##### 步骤1:基本配置。 R1:![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/3089388515.png) R2:![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/1591919760.png) R3:![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/2120913823.png) ##### 步骤2:接口bfd的会话参数。 ``` R1(config)#int g0/0 R1(config-if)#bfd interval 50 min_rx 50 multiplier 3 //在接口上使能bfd,修改BFD控制报文的最小发送时间间隔和最小接收时间间隔为50毫秒,检测超时倍数为3。 R1(config-if)#int g0/1 R1(config-if)#bfd interval 50 min_rx 50 multiplier 3 R2(config)#int range g0/0-1 R2(config-if-range)#bfd interval 50 min_rx 50 multiplier 3 R3(config)#int range g0/0-1 R3(config-if-range)#bfd interval 50 min_rx 50 multiplier 3 ``` ##### 步骤3:配置OSPF ``` R1(config)#router ospf 1 //ospf进程号1 R1(config-router)#router-id 1.1.1.1 //配置router-id R1(config-router)#network 192.168.10.0 0.0.0.255 area 0 //宣告直连网段 R1(config-router)#network 192.168.30.0 0.0.0.255 area 0 R1(config-router)#bfd all-interfaces //在与 OSPF 路由进程关联的所有接口上全局启用 BFD R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 192.168.10.0 0.0.0.255 area 0 R2(config-router)#network 192.168.20.0 0.0.0.255 area 0 R2(config-router)#bfd all-interfaces R3(config)#router ospf 1 R3(config-router)#router-id 3.3.3.3 R3(config-router)#network 192.168.20.0 0.0.0.255 area 0 R3(config-router)#network 192.168.30.0 0.0.0.255 area 0 R3(config-router)#bfd all-interfaces ``` ##### 步骤4:通过show bfd neighbers命令查询BFD邻居状态。 ![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/3192755554.png) ``` R1#show ip route ``` ![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/4075366626.png) 查看完成之后开始测试bfd,将R3的g0/0口进行shutdown ![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/907685897.png) 在R1上重新查看ospf邻居关系,发现邻居关系变化变得非常快、更加敏感 ![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/1978740671.png) ![](https://cdn.gta5pdx.cn/usr/uploads/2022/06/4259867324.png) 最后修改:2022 年 06 月 10 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏