BFD技术[亲测有效]

BFD技术[亲测有效]BFD技术与静态路由BFD:BidirectionalForwardingDetection,双向转发检查作用:毫秒级故障检查,通常结合三层协议(如静态路由、vrrp、ospf、BGP等)实现链路故障快速检查。R1: <Huawei>sys Entersystemview,returnuserviewwithCtrl+Z. [Huawei]uninen Info:Informationcenterisdisabled. [Huawei]sysnam

大家好,欢迎来到IT知识分享网。

BFD技术与静态路由

BFD:Bidirectional Forwarding Detection,双向转发检查
作用:毫秒级故障检查,通常结合三层协议(如静态路由、vrrp、ospf、BGP等)实现链路故障快速检查。
在这里插入图片描述

R1:
	<Huawei>sys
	Enter system view, return user view with Ctrl+Z.
	[Huawei]un in en
	Info: Information center is disabled.
	[Huawei]sysname R1
	[R1]int g0/0/1
	[R1-GigabitEthernet0/0/1]ip addr 12.1.1.1 24
	[R1-GigabitEthernet0/0/1]int g0/0/0
	[R1-GigabitEthernet0/0/0]ip addr 21.1.1.1 24
	[R1-GigabitEthernet0/0/0]int loopback 0
	[R1-LoopBack0]ip addr 1.1.1.1 24
	[R1-LoopBack0]quit
	[R1]ip route-static 2.2.2.0 24 12.1.1.2
	[R1]ip route-static 2.2.2.0 24 21.1.1.2 preference 70
	
R2:
	<Huawei>sys	
	<Huawei>system-view 
	Enter system view, return user view with Ctrl+Z.
	[Huawei]un in en
	Info: Information center is disabled.
	[Huawei]sysname R2
	[R2]int g0/0/1
	[R2-GigabitEthernet0/0/1]ip addr 12.1.1.2 24
	[R2-GigabitEthernet0/0/1]int g0/0/0
	[R2-GigabitEthernet0/0/0]ip addr 21.1.1.2 24
	[R2-GigabitEthernet0/0/0]int loopback 0
	[R2-LoopBack0]ip addr 2.2.2.2 24
	[R2-LoopBack0]quit
	[R2]ip route-static 1.1.1.0 24 12.1.1.1
	[R2]ip route-static 1.1.1.0 24 21.1.1.1 preference 70

一般来说我们的链路不是上面的样子,而是像下图这样
在这里插入图片描述
如果说我们没有配置BFD技术的话,发生了下图这样的链路错误
在这里插入图片描述
如果出现以上的链路故障的话,我们在来测试1.1.1.1与2.2.2.2的通信

[R1]
	ping -a 1.1.1.1 2.2.2.2
    PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out
	--- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss
    
[R1]ping -a 1.1.1.1 2.2.2.2
    PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out
	--- 2.2.2.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

这时候我们就需要配置BFD技术了

R1:
	[R1]bfd
	[R1-bfd]quit
	[R1]bfd 1 bind peer-ip 12.1.1.2 source-ip 12.1.1.1
	[R1-bfd-session-1]discriminator local 1
	[R1-bfd-session-1]discriminator remote 2
	[R1-bfd-session-1]commit 
	[R1-bfd-session-1]quit
	[R1]ip route-static 2.2.2.0 24 12.1.1.2 track bfd-session 1
	Info: Succeeded in modifying route.
	
R2:
	[R2]bfd
	[R2-bfd]quit
	[R2]bfd 1 bind peer-ip 12.1.1.1 source-ip 12.1.1.2
	[R2-bfd-session-1]discriminator local 2
	[R2-bfd-session-1]discriminator remote 1
	[R2-bfd-session-1]commit
	[R2]ip route-static 1.1.1.0 24 12.1.1.1 track bfd-session 1
	Info: Succeeded in modifying route.

此时我们再次出现链路故障的话,也是丢了几个包而已
在这里插入图片描述
此时我们再看我们的bfd检测就发现下面那条路由已经down了

[R1]display bfd session all 
--------------------------------------------------------------------------------
Local Remote     PeerIpAddr      State     Type        InterfaceName            
--------------------------------------------------------------------------------

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

通过这条命令查看bfd的详细信息

[R1]display bfd session all verbose 

以上就是关于BFD与静态路由联动的实验!

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/24689.html

(0)

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信