思科BFD配置&详细解释 您所在的位置:网站首页 思科交换机怎么配置静态路由 思科BFD配置&详细解释

思科BFD配置&详细解释

2024-07-04 11:52| 来源: 网络整理| 查看: 265

文章目录 前言一、静态路由&关联BFD1.图示2.BFD&静态路由配置3.使用BFD协议达到双出口冗余 二、OSPF路由&关联BFD1.图示2.配置说明 总结

前言

BFD(Bidirectional Forwarding Detection,双向转发检测)协议提供一种轻负载、快速检测两台邻接路由器之间转发路径连通状态的方法。协议邻居通过该方式可以快速检测到转发路径的连通故障,加快启用备份转发路径,提升现有网络性能。 通过cisco路由器能使BFD特性使得路由切换达到毫秒级 《参考白皮书》-来自思科官方文档

一、静态路由&关联BFD

书中关于BFD关联静态路由"Example: Configuring BFD Support for Static Routing提及到:BFD必须双向配置 " In the following example, the network consists of Device A and Device B. Serial interface 2/0 on Device A is connected to the same network as serial interface 2/0 on Device B. In order for the BFD session to come up, Device B must be configured.

#BRD配置命令 router(config-if)#bfd interval {50-9999 in milliseconds} min_rx {50-9999 in millicseconds} multiplier {3-50} router(config)#ip route static bfd {interface type} {Interface number} {gateway address} router(config)#ip route {network address} {network mask} {interface(which bfd enabled)} {next-hop address} ----------------------------------- ©著作权归作者所有:来自51CTO博客作者起司网络狗的原创作品,如需转载,请与作者联系,否则将追究法律责任 双向链路检测(BFD)之静态路由篇 https://blog.51cto.com/u_14851874/2506259 1.图示

图中使用Serial线路连接,为什么使用Serial 线路连接?

因为Serial线路不像MSTP、以太网线路,一端down,另一端也会down 在这里插入图片描述

2.BFD&静态路由配置 R1 interface Serial 1/1 ip address 10.201.201.1 255.255.255.0 bfd interval 500 min_rx 500 multiplier 5#接口下调用bfd参数,bfd 消失。接口down ip route static bfd Serial 1/1 10.201.201.2# bfd track 路由,当bfd down 时,此路由消失,建立bfd 邻居关系 ip route 10.201.201.2 255.255.255.255 Serial1/1 10.201.201.2#路由配置 R2 interface Serial 1/1 ip address 10.201.201.2 255.255.255.0 bfd interval 500 min_rx 500 multiplier 5#接口下调用bfd参数 ip route static bfd Serial 1/1 10.201.201.1# 关联探测 ip route 10.201.201.1 255.255.255.255 Serial1/1 10.201.201.1#路由配置 3.使用BFD协议达到双出口冗余

在这里插入图片描述 R1,R2,R4之间运行OSPF路由协议,R3配置8.8.8.8的路由

R3 interface Ethernet0/0 ip address 13.1.1.3 255.255.255.0 bfd interval 500 min_rx 500 multiplier 3 end interface Ethernet0/1 ip address 23.2.2.3 255.255.255.0 bfd interval 500 min_rx 500 multiplier 3 end ip route static bfd Ethernet0/0 13.1.1.1#探测 ip route static bfd Ethernet0/1 23.2.2.2#探测 ip route 0.0.0.0 0.0.0.0 Ethernet0/0 13.1.1.1#路由 ip route 0.0.0.0 0.0.0.0 Ethernet0/1 23.2.2.2#路由 R1 ! interface Ethernet0/0 ip address 13.1.1.1 255.255.255.0 bfd interval 500 min_rx 500 multiplier 3 end ip route static bfd Ethernet0/0 13.1.1.3 unassociate ##这里说明一下unassociate这个参数,在正常情况下需要有一条静态路由的关联到接口上时才能生效,但是有了这个参数就可以在没有任何路由的情况下生效。这里只做了互联网连接运营商无法知道也不能知道任何内部的路由,因此需要做这条参数

双向链路检测(BFD)之静态路由篇-51CTO博客

二、OSPF路由&关联BFD 1.图示

在这里插入图片描述

2.配置说明

图中配置为ospf 全互联状态,在整个ospf 1 area 0 中,使用接口加入ospf的配置方式

R2 interface Loopback0 ip address 2.2.2.2 255.255.255.255 ip ospf 1 area 0 interface Ethernet0/0 ip address 23.1.1.2 255.255.255.0 ip ospf 1 area 0 interface Ethernet0/1 ip address 28.1.1.2 255.255.255.0 ip ospf 1 area 0 R3 interface Loopback0 ip address 3.3.3.3 255.255.255.255 ip ospf 1 area 0 interface Ethernet0/0 ip address 23.1.1.3 255.255.255.0 ip ospf 1 area 0 interface Ethernet0/1 ip address 37.1.1.3 255.255.255.0 ip ospf 1 area 0 bfd interval 50 min_rx 50 multiplier 3 interface Ethernet0/2 R7 interface Loopback0 ip address 7.7.7.7 255.255.255.255 ip ospf 1 area 0 interface Ethernet0/0 ip address 37.1.1.7 255.255.255.0 ip ospf 1 area 0 bfd interval 50 min_rx 50 multiplier 3 interface Ethernet0/1 ip address 78.1.1.7 255.255.255.0 ip ospf 1 area 0 bfd interval 50 min_rx 50 multiplier 3 interface Ethernet0/2 no ip address shutdown interface Ethernet0/3 no ip address shutdown bfd all-interfaces R8 interface Loopback0 ip address 8.8.8.8 255.255.255.255 ip ospf 1 area 0 interface Ethernet0/0 ip address 28.1.1.8 255.255.255.0 ip ospf 1 area 0 interface Ethernet0/1 ip address 78.1.1.8 255.255.255.0 ip ospf 1 area 0 bfd interval 50 min_rx 50 multiplier 3 interface Ethernet0/2 no ip address shutdown interface Ethernet0/3 no ip address shutdown bfd all-interfaces

现在R7trace R2(2.2.2.2)发现走的是负载的状态 在这里插入图片描述 为达到实验效果:先配置R7使其走一边

R7 interface ethernet 0/0 ip ospf cost 200#增大cost 、使其次优 #cost更改方法:数据的出方向和路由的入方向

更改cost发现,R7去往2.2.2.2 走eth0/1 在这里插入图片描述现在在R7,R3,R8上查看bfd neighbor 在这里插入图片描述 在这里插入图片描述 在这里插入图片描述 现在我们将R8eth0/1断掉,查看路径是否更改、bfd是否down 、邻居是否down、以及R7接口是否、现在可以R7长pingR2,来检验BFD检测速度。

此时发现,R8的 BFD neighbor down 接口down,与R7的邻居也down 在这里插入图片描述

在这里插入图片描述 我们来看R7 bfd down ,接口未down。并且邻居消失 在这里插入图片描述

接口未down 与静态路由不大一样。我记得静态路由的话接口会down。可能是因为协议的处理逻辑不一样,静态路由要消失的话,需要接口消失。而动态路由消失邻居消失就可以了

在这里插入图片描述 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Y13yrzFG-1667303110359)(https://img-youblog.csdnimg.cn/abfa82d0c40e416b8ba99fcb6289dd04.png)] 此时,R7长ping R2产生了路径切换,仅仅丢3个包,可以说是无感知了,不愧是高级协议,真棒!恢复R8eth0/1,R7选路又恢复eth0/1.,侧面验证了cost越小越优先。在这里插入图片描述

总结

ospf 与bfd关联,需要在接口下配置bfd 时间参数,还要在进程下启用该接口的bfd

int eth0/1 bfd interval 500 min_rx 500 multiplier 3 ip ospf bfd 或者router ospf 进程下 bfd all-interfaces

在这里插入图片描述



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有