思科BFD配置案例-静态路由快速切换

通过cisco路由器的BFD特性使得静态路由切换达到毫秒级,模拟器测试当出现故障只丢1个包。

拓扑:


R1、R2、R3之间使用OSPF实现完全收敛,配置就不写了,R4的loopback口4.1.1.1来pingR1的loopback口1.1.1.1,在R2与R4之间和R3与R4之间使用静态路由+BFD,实现快速收敛;

关键配置:

R2上:

interface Ethernet0/1
 ip address 24.1.1.2 255.255.255.0
 bfd interval 50 min_rx 50 multiplier 3 接口下配置BFD的发送间隔,最小接收间隔,Hello包最大容错;
ip route static bfd Ethernet0/1 24.1.1.4 接口与BFD联动,必须配置
ip route 4.1.1.0 255.255.255.0 Ethernet0/1 24.1.1.4 静态路由指向R4的loopback


R3上:

interface Ethernet0/1
 ip address 34.1.1.3 255.255.255.0
 bfd interval 50 min_rx 50 multiplier 3  与R2一样
ip route static bfd Ethernet0/1 34.1.1.4 与R2一样,接口与BFD联动,指向R4
ip route 4.1.1.0 255.255.255.0 Ethernet0/1 34.1.1.4


R4上:

interface Ethernet0/0
 ip address 24.1.1.4 255.255.255.0
 bfd interval 50 min_rx 50 multiplier 3 与R2和R3的参数要保持一致,否则协商不会成功;
!
interface Ethernet0/1
 ip address 34.1.1.4 255.255.255.0
 bfd interval 50 min_rx 50 multiplier 3 与R2和R3的参数要保持一致,否则协商不会成功;
ip route static bfd Ethernet0/0 24.1.1.2 接口与BFD联动,指向R2
ip route static bfd Ethernet0/1 34.1.1.3 接口与BFD联动,指向R3
ip route 0.0.0.0 0.0.0.0 Ethernet0/0 24.1.1.2 100 控制metric为100,默认走R2
ip route 0.0.0.0 0.0.0.0 Ethernet0/1 34.1.1.3 200 控制metric为200,当R2出现故障走R3

BFD协商成功后能够看到邻居状态:

R4#show bfd neighbors 

NeighAddr                         LD/RD    RH/RS     State     Int
24.1.1.2                           1/2     Up        Up        Et0/0
34.1.1.3                           2/2     Up        Up        Et0/1


R4路由

R4#show ip route
Gateway of last resort is 24.1.1.2 to network 0.0.0.0

S*    0.0.0.0/0 [100/0] via 24.1.1.2, Ethernet0/0 能够看到这时的默认路由走R2
      4.0.0.0/32 is subnetted, 1 subnets
C        4.1.1.1 is directly connected, Loopback0
      24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        24.1.1.0/24 is directly connected, Ethernet0/0
L        24.1.1.4/32 is directly connected, Ethernet0/0
      34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        34.1.1.0/24 is directly connected, Ethernet0/1
L        34.1.1.4/32 is directly connected, Ethernet0/1


这时如果R2的e 0/1接口down掉,R4的默认路由就会立刻切换到R3上,BFD实验完成;


PS.GNS3貌似有bug,两台路由器只要协商BFD就立刻当机,IOU中没有这个问题,另外BFD还可以与各种路由协议联动,都能够实现毫秒级切换,若网络对稳定性要求极高则需要部署,但BFD对硬件资源需求较高,低端路由器不建议部署;





你可能感兴趣的:(思科BFD配置案例-静态路由快速切换)