双向转发检测BFD(Bidirectional Forwarding Detection)是一种全网统一的检测机制,用于快速检测、
监控网络中链路或者IP路由的转发连通情况。此处列举了BFD与静态路由联动配置,以及BFD与ospf联动配置。网络
(1)ip地址的配置session
R1: sys sysn R1 inter g0/0/1 ip address 10.0.13.1 24 inter g0/0/0 ip address 10.0.12.1 24 quit R2: sys sysn R2 inter g0/0/0 ip address 10.0.13.13 24 quit R3: sys sysn R3 inter g0/0/0 ip address 10.0.12.12 24 quit
(2)在R2和R3上配置静态路由实现通讯ide
R2: ip route-static 10.0.12.0 24 10.0.13.1 R3: ip route-static 10.0.13.0 24 10.0.12.1
(3)在R1和R2路径上启用BFD配置,检测R1到R2接口ui
R1: [R1]bfd //启用BFD配置 [R1-bfd]quit [R1]bfd 1 bind peer-ip 10.0.13.13 source-ip 10.0.13.1 auto //建立BFD会话绑定信息, 并进入BFD会话视图。 [R1-bfd-session-1]commit //提交BFD会话配置 [R1-bfd-session-1]quit R2: [R2]bfd [R2-bfd]quit [R2]bfd 1 bind peer-ip 10.0.13.1 source-ip 10.0.13.13 auto [R2-bfd-session-1]commit [R2-bfd-session-1]quit
(4)检查BFD会话信息code
[R1]display bfd session all
(5)在R1上配置静态路由并联动BFD:blog
[R1] ip route-static 0.0.0.0 0.0.0.0 10.0.13.13 track bfd-session 1'
此时,静态路由与BFD的联动已配置完成,bfd能够快速检测、监控网络中链路或者IP路由的转发连通情况。接口
(1)删除静态路由、bfdip
R1: undo ip route-static 0.0.0.0 0.0.0.0 10.0.13.13 undo ip route-static 0.0.0.0 0.0.0.0 10.0.12.12 undo bfd 1 R2: undo ip route-static 10.0.12.0 255.255.255.0 10.0.13.1 undo bfd 1 R3: undo ip route-static 10.0.13.0 255.255.255.0 10.0.12.1 undo bfd 1
(2)配置ospf协议实现路由通讯路由
R1: ospf 1 area 0.0.0.0 network 10.0.12.0 0.0.0.255 network 10.0.13.0 0.0.0.255 return R2: sys ospf 1 area 0.0.0.0 network 10.0.13.0 0.0.0.255 return R3: sys ospf 1 area 0.0.0.0 network 10.0.12.0 0.0.0.255 area 0.0.0.1 return
(3)配置bfd与ospf联动
配置 BFD session须要在系统全局下开启BFD,而且在OSPF视图下启用联动BFD。it
R1: sys bfd // 启用bfd quit ospf 1 bfd all-interfaces enable //在osp视图下启用联动bfd return R2: sys bfd quit ospf 1 bfd all-interfaces enable return
(4)
dis bfd session all 查看bfd会话