华为的BFD:双向转发检查
全网统一的快速定位故障的检测机制
这种机制与介质无关,协议无关
BFD 基于UDP报文封装 端口号3784
报文周期1000ms
BFD 需要建立连接会话:依靠上层应用建立的关系
@静态建立会话-手动
@动态建立会话-自动
配置思路:
1,建立物理链路连通
2,全局启动BFD功能
3,建立BFD会话连接
--配置本端标识符
--配置远端标识符
4,激活BFD配置
5,将BFD和响应应用结合起来
display bfd session all
===========================================================
AR1
#启用BFD
bfd
quit
#创建本端IP与对端IP的BFD会话
bfd 1 bind peer-ip 192.168.1.253(对端IP) source-ip 192.168.1.252(本地IP)
discriminator local 16 //本地标识符
discriminator remote 17 //对端标识符
commit //激活BFD配置
#配合VRRP使用
interface GigabitEthernet0/0/1
ip address 192.168.1.252 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254
vrrp vrid 1 priority 200
vrrp vrid 1 track bfd-session 16 //在VRRP里跟踪BFD会话的本地标识符
vrrp vrid 1 authentication-mode md5 12345
#
-----------------------------------------------------------
AR2
#启用BFD
bfd
quit
#
bfd 1 bind peer-ip 192.168.1.252 source-ip 192.168.1.253
discriminator local 17
discriminator remote 16
commit
#配合VRRP使用
interface GigabitEthernet0/0/1
ip address 192.168.1.253 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254
vrrp vrid 1 priority 200
vrrp vrid 1 track bfd-session 17
vrrp vrid 1 authentication-mode md5 12345
#
===========================================================
BFD与静态路由结合使用
#启用BFD
bfd
quit
#
bfd 1 bind peer-ip 192.168.1.252 source-ip 192.168.1.253
discriminator local 17
discriminator remote 16
commit
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 track bfd-session 1
CISCO的BFD:双向转发检查
作用:毫秒级故障检查,通常结合三层协议(如静态路由、vrrp、ospf、BGP等)实现链路故障快速检查
配置思路:
R1
<Huawei>system-view //进入全局模式
[Huawei]sysname R1 //改名
[R1]undo info-center enable //关闭信息告警提示
[R1]interface LoopBack 0 //进入LoopBack 0接口
[R1-LoopBack0]ip address 1.1.1.1 24 //设置IP地址
[R1-LoopBack0]interface g0/0/0 //进入接口
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24 //设置IP地址
[R1-GigabitEthernet0/0/0]interface g0/0/1 //进入接口
[R1-GigabitEthernet0/0/1]ip address 21.1.1.1 24 //设置IP地址
[R1-GigabitEthernet0/0/1]quit //退出
[R1]ip route-static 2.2.2.0 255.255.255.0 21.1.1.2 //配置静态路由
[R1]ip route-static 2.2.2.0 255.255.255.0 12.1.1.2 preference 70 //配置静态路由及优先级(默认为60)
R2
<Huawei>system-view //进入全局模式
[Huawei]sysname R2 //改名
[R2]undo info-center en //关闭信息告警提示
[R2]interface LoopBack 0 //进入LoopBack 0接口
[R2-LoopBack0]ip address 2.2.2.2 24 //设置IP地址
[R2-LoopBack0]interface g0/0/0 //进入接口
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24 //设置IP地址
[R2-GigabitEthernet0/0/0]interface g0/0/1 //进入接口
[R2-GigabitEthernet0/0/1]ip address 21.1.1.2 24 //设置IP地址
[R2-GigabitEthernet0/0/1]quit //退出
[R2]ip route-static 1.1.1.0 255.255.255.0 21.1.1.1 //配置静态路由
[R2]ip route-static 1.1.1.0 255.255.255.0 12.1.1.1 preference 70 //配置静态路由以及优先级(默认为60)
R1
R1
[R1]dis ip routing-table //查看路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 LoopBack0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.0/24 Static 60 0 RD 21.1.1.2 GigabitEthernet 默认优先级的线路
0/0/1
12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet
0/0/0
12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
21.1.1.0/24 Direct 0 0 D 21.1.1.1 GigabitEthernet
0/0/1
21.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
21.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R1]
R1
[R1]bfd //全局使能BFD
[R1-bfd]quit //退出
[R1]bfd 1 bind peer-ip 21.1.1.2 source-ip 21.1.1.1 //配置BFD组1
[R1-bfd-session-1]discriminator local 1 //本地标识1(标识需要相互堆成)
[R1-bfd-session-1]discriminator remote 2 //对端标识2
[R1-bfd-session-1]commit //确认提交
[R1-bfd-session-1]quit //退出
[R1]ip route-static 2.2.2.0 24 21.1.1.2 track bfd-session 1 //静态路由调用BFD
R2
[R2]bfd //全局使能BFD
[R2-bfd]quit // 退出
[R2]bfd 1 bind peer-ip 21.1.1.1 source-ip 21.1.1.2 //配置BFD组1
[R2-bfd-session-1]discriminator local 2 //本地标识2(标识需要相互堆成)
[R2-bfd-session-1]discriminator remote 1 //对端标识1
[R2-bfd-session-1]commit //确认提交
[R2-bfd-session-1]quit //退出
[R2]ip route-static 1.1.1.0 24 21.1.1.1 track bfd-session 1 //静态路由调用BFD
R1
[R1]dis ip routing-table //查看路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 LoopBack0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.0/24 Static 70 0 RD 12.1.1.2 GigabitEthernet //线路已切换过来
0/0/0
12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet
0/0/0
12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
21.1.1.0/24 Direct 0 0 D 21.1.1.1 GigabitEthernet
0/0/1
21.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
21.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R1]
R1
[R1]dis bfd session all //查看BFD信息
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
1 2 21.1.1.2 Down S_IP_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 0/1
[R1]
[R1]dis bfd session all verbose //查看BFD详细信息
--------------------------------------------------------------------------------
Session MIndex : 256 (Multi Hop) State : Down 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 : 21.1.1.2
Bind Interface : -
Track Interface : -
Bind Source IP Address : 21.1.1.1
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 10500 Actual Rx Interval (ms): 10500
Local Detect Multi : 3 Detect Interval (ms) : -
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 254
Proc Interface Status : Disable Process PST : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : Control Detection Time Expired
Bind Application : No Application Bind
Session TX TmrID : 1036 Session Detect TmrID : -
Session Init TmrID : - Session WTR TmrID : -
Session Echo Tx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 0/1
[R1]
发表评论 取消回复