BFD----双向链路检测机制

BFD----双向链路检测机制

       实现毫秒级切换线路

       是一种全网统一的测试机制,用于快速检测、监控网络中链路或者IP路由的转发联通状况

BFD本质上是为了测试链路的连通性,发送与ping类似的报文,即BFD报文,会有个目的IP,若失联则断。

在静态路由中使用

配置IP地址:

R1:

int g0/0/0

ip address 10.1.12.2 24

int g0/0/1

ip ad 10.1.23.2 24

R2:

int g0/0/0

ip ad 10.1.12.1 24

int g0/0/1

ip address 10.1.134.1 24

R3:

int g0/0/0

ip ad 10.1.23.1 24

int g0/0/1

ip address 10.1.134.2 24

R4:

int g0/0/0

ip ad 10.1.134.3 24

int l0

ip ad 10.9.9.1 24

配置静态路由

R1:

ip route-static 10.9.9.0 24 10.1.12.1

ip route-static 10.9.9.0 24 10.1.23.1 preference 80

R2:

ip route-static 0.0.0.0 0 10.1.134.3

R3:

ip route-static 0.0.0.0 0 10.1.134.3

R4:

ip route-static 10.1.12.0 24 10.1.134.1

ip route-static 10.1.23.0 24 10.1.134.2

查看R1路由表

可以看到去往10.9.9.0网关为10.1.12.1,即从左边走

进入交换机 将于R相连的端口关闭

SW1:

int g0/0/1

shutdown

再查看R1路由表

发现去往10.9.9.0 24的网关变成10.1.23.1,即走右边

再次来到SW1,将SW1的G0/0/2接口关掉,与路由器直连的端口打开

SW1:

int g0/0/1

undo shutdown

int g0/0/2

shutdown

来到R1查看路由表

发现并没有切换,但10.1.12.1不通

为了使路由器感知到,需要使用BFD

BFD应用:需要一个标识符来判断是不是要回包

local:本地 remote:远端

盒式交换机,框式交换机

R1:

bfd

q

bfd aa bind peer-ip 10.1.12.1

discriminator local 10

discriminator remote 20

commit

R2:

bfd

q

bfd bb bind peer-ip 10.1.12.2

discriminator remote 10

discriminator local 20

commit

来到R1 发现启动成功

在R1上写静态路由

ip route-static 10.9.9.0 24 10.1.12.1 track bfd-session aa

配置完成

进入SW1将G0/0/2 shutdown

SW1:

int g0/0/2

shutdown

回到R1发现BFD状态变为Down

同时R1的网关也切换过来了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值