【静态路由-创建BFD】
[R1] bfd //开启BFD
[R1] bfd 1 bind peer-ip 10.0.12.2 source-ip 10.0.12.1 auto
//创建进程1
[R1-bfd-session-1] commit
[R2]bfd
[R2]bfd 1 bind peer-ip 10.0.12.1
source-ip 10.0.12.2 auto
[R2-bfd-session-1]commit
【静态路由-引用BFD与静态路由联动】
[R2] ip route-static 10.0.0.0 8
10.0.12.1 //指向R1
[R3] ip route-static 10.0.0.0 8
10.0.13.1 //指向R1
[R1] ip route-static 0.0.0.0 0.0.0.0
10.0.12.2 track bfd-session 1 //引用BFD
[R1] ip route-static 0.0.0.0 0.0.0.0
10.0.13.2 preference 100 //把备用路由优先值调高,高的不优先
==============================================================
【BFD 与 OSPF 联动】
[R1]bfd //全局开启
[R1]ospf
[R1-ospf-1] bfd all
[R1-ospf-1] bfd all-interfaces enable
//所有接口开启BFD联动
debug ospf bfd //观察日志
===================================================
【动态路由-创建BFD】
[R1] bfd //开启BFD
[R1-bfd] bfd 1 bind peer-ip 192.168.45.2 source-ip 10.0.12.1
auto
[R1-bfd-session-1] commit
[R2] bfd
[R2-bfd]bfd 1 bind peer-ip 10.0.12.1
source-ip 192.168.45.2 auto
[R2-bfd-session-1]commit
【动态路由-引用BFD与VRRP联动】
[R2-GigabitEthernet0/0/0] vrrp vrid 45
track bfd-session session-name 1 reduce
60
=================================================
[R1] display bfd session all
//查看所有BFD会话
[R1] display ip routing-table 0.0.0.0
0.0.0.0 verbose //查看某条路由详细信息
实验结果:主链路(R1~R2)故障后自动切换到
备用链路(R1~R3),主路恢复正常后会抢回来!
来源:https://www.cnblogs.com/walkersss/p/11912877.html