ensp-BFD实验

简介

BFD:BFD:BidirectionalForwarding Detection,双向转发检查 作用:毫秒级故障检查,通常结合三层协议(如静态路由、vrrp、ospf、BGP等)实现链路故障快速检查

简单实验拓扑

在这里插入图片描述

AR1:

[AR1]ip route-static 2.2.2.0 24 12.1.1.2
[AR1]ip route-static 2.2.2.0 24 21.1.1.2 preference 70

AR2:

[AR2]ip route-static 1.1.1.0 24 12.1.1.1
[AR2]ip route-static 1.1.1.1 24 21.1.1.1 preference 70
[AR1]ping -a 1.1.1.1 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=470 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=60 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/130/470 ms

R1:

[AR1]bfd
[AR1]bfd 1 bind peer-ip 12.1.1.2 source-ip 12.1.1.1
[AR1-bfd-session-1]discriminator local 1 #配置本地标识
[AR1-bfd-session-1]discriminator remote 2 #配置远端标识
[AR1-bfd-session-1]comm	
[AR1-bfd-session-1]commit  #提交

R2:

bfd
bfd 1 bind peer-ip 12.1.1.1 source-ip 12.1.1.2  
 	discriminator local 2
	discriminator remote 1 
    commit 

在静态路由上配置bfd:
R1:

[AR1]ip route-static 2.2.2.0 24 12.1.1.2 track bfd-session 1

R2:

[AR2]ip route-static 1.1.1.0 24 12.1.1.1 track bfd-session 1
1
查看bfd信息
[AR1]dis bfd session all
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------

1     2          12.1.1.2        Up        S_IP_PEER         -                  
--------------------------------------------------------------------------------
     Total UP/DOWN Session Number : 1/0

查看更加详细的bfd信息:

[AR1]dis bfd session all verbose 
--------------------------------------------------------------------------------
Session MIndex : 256       (Multi Hop) State : Up        Name : 1              
--------------------------------------------------------------------------------
  Local Discriminator    : 1                Remote Discriminator   : 2         
  Session Detect Mode    : Asynchronous Mode Without Echo Function             
  BFD Bind Type          : Peer IP Address                                     
  Bind Session Type      : Static                                              
  Bind Peer IP Address   : 12.1.1.2                                            
  Bind Interface         : -                                                   
  Track Interface        : -                                                   
  Bind Source IP Address : 12.1.1.1                                            
  FSM Board Id           : 0                TOS-EXP                : 7         
  Min Tx Interval (ms)   : 1000             Min Rx Interval (ms)   : 1000      
  Actual Tx Interval (ms): 1000             Actual Rx Interval (ms): 1000      
  Local Detect Multi     : 3                Detect Interval (ms)   : 3000      
  Echo Passive           : Disable          Acl Number             : -         

ospf 调用bfd 加快收敛

前言:ospf默认的hello报文是10秒钟发一次,检测到故障是40秒也就是需要四十秒才能将那个有问题的路由清除,在ospf上调用bfd可以起到快速收敛的作用

实验拓扑:

在这里插入图片描述

AR1:

[AR1]ospf 1
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 1.1.1.0 0.0.0.255
[AR1]ospf 1
[AR1-ospf-1]bfd all-interfaces enable

AR2:

[AR2]ospf 1
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]net	
[AR2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255 
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[AR2]ospf 1
[AR2-ospf-1]bfd all-interfaces enable

如果我们把右边的网线断开,如果通过ospf去收敛的话需要几十秒,但是通过调用bfd几秒就可以收敛完成

[AR1]dis ospf peer brief 

	 OSPF Process 1 with Router ID 12.1.1.1
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             12.1.1.2         Full        
 ----------------------------------------------------------------------------
  • 3
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值