配置BFD多跳检测示例
BFD简介
双向转发检测BFD(Bidirectional Forwarding Detection)是一种全网统一的检测机制,用于快速检测、监控网络中链路或者IP路由的转发连通状况。
为了减小设备故障对业务的影响,提高网络的可靠性,网络设备需要能够尽快检测到与相邻设备间的通信故障,以便及时采取措施,保证业务继续进行。在现有网络中,有些链路通常通过硬件检测信号,如SDH告警,检测链路故障,但并不是所有的介质都能够提供硬件检测。此时,应用就要依靠上层协议自身的Hello报文机制来进行故障检测。上层协议的检测时间都在1秒以上,这样的故障检测时间对某些应用来说是不能容忍的。在三层网络中,Hello报文检测机制无法针对所有路由来检测故障,如:静态路由。这对系统间互联互通定位故障造成困难。
BFD协议就是在这种背景下产生的,BFD提供了一个通用的标准化的介质无关和协议无关的快速故障检测机制。具有以下优点:
- 对相邻转发引擎之间的通道提供轻负荷、快速故障检测。这些故障包括接口、数据链路,甚至有可能是转发引擎本身。
- 用单一的机制对任何介质、任何协议层进行实时检测。发连通状况。
BFD可以实现快速检测并监控网络中链路或IP路由的转发连通状态,改善网络性能。相邻系统之间通过快速检测发现通信故障,可以更快地帮助用户建立起备份通道以便恢复通信,保证网络可靠性。
配置BFD多跳检测示例
如下图所示,Switch1和Switch3为非直连设备,通过配置静态路由互通。用户希望可以实现对设备间链路故障的快速检测。
配置BFD多跳检测组
采用如下思路配置BFD多跳检测:
在Switch1和Switch3上分别配置BFD会话,实现Switch1到Switch3间多跳路径的检测。
Switch1配置如下:
1.配置Switch1的网络接口IP
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname Switch1
[Switch1]vlan batch 10
[Switch1]interface GigabitEthernet 0/0/1
[Switch1-GigabitEthernet0/0/1]port link-type hybrid
[Switch1-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[Switch1-GigabitEthernet0/0/1]port hybrid untagged vlan 10
[Switch1-GigabitEthernet0/0/1]undo shutdown
[Switch1-GigabitEthernet0/0/1]quit
[Switch1]interface vlanif 10
[Switch1-Vlanif10]ip address 10.1.1.1 24
[Switch1-Vlanif10]quit
2.配置静态路由使Switch1、Switch3之间有可达路由
[Switch1]ip route-static 10.2.1.0 24 10.1.1.2
3.配置多跳BFD检测
配置在Switch1与Switch3之间的BFD会话
[Switch1]bfd atoc bind peer-ip 10.2.1.2
[Switch1-bfd-session-atoc]dis
[Switch1-bfd-session-atoc]discriminator local 10
[Switch1-bfd-session-atoc]discriminator remote 20
[Switch1-bfd-session-atoc]commit
[Switch1-bfd-session-atoc]quit
4.验证配置结果
配置完成后,在SwitchA和SwitchC上执行display bfd session all verbose命令,可以看到建立了一个BFD会话,且状态为Up。
[Switch1]display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 256 (Multi Hop) State : Up Name : atoc
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Peer IP Address
Bind Session Type : Static
Bind Peer IP Address : 10.2.1.2
Bind Interface : -
Track Interface : -
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 : -
Destination Port : 3784 TTL : 254
Proc Interface Status : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : Control Detection Time Expired
Bind Application : No Application Bind
Session TX TmrID : 1037 Session Detect TmrID : 1038
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 : 1/0
Switch2配置如下:
1.配置0/0/1与0/0/2接口IP
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname Switch2
[Switch2]vlan batch 10 20
[Switch2]interface gigabitethernet 0/0/1
[Switch2-GigabitEthernet0/0/1]port link-type hybrid
[Switch2-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[Switch2-GigabitEthernet0/0/1]port hybrid untagged vlan 10
[Switch2-GigabitEthernet0/0/1]undo shutdown
[Switch2-GigabitEthernet0/0/1]quit
[Switch2]interface gigabitethernet 0/0/2
[Switch2-GigabitEthernet0/0/2]port link-type hybrid
[Switch2-GigabitEthernet0/0/2]port hybrid pvid vlan 20
[Switch2-GigabitEthernet0/0/2]port hybrid untagged vlan 20
[Switch2-GigabitEthernet0/0/2]undo shutdown
[Switch2-GigabitEthernet0/0/2]quit
[Switch2]interface vlanif 10
[Switch2-Vlanif10]ip address 10.1.1.2 24
[Switch2-Vlanif10]quit
[Switch2]interface vlanif 20
[Switch2-Vlanif20]ip address 10.2.1.1 24
[Switch2-Vlanif20]quit
Switch3配置如下:
1.配置Switch3的网络接口IP
<Huawei>system-view
[Huawei]undo info-center enable
[Huawei]sysname Switch3
[Switch3]vlan batch 20
[Switch3]interface gigabitethernet 0/0/2
[Switch3-GigabitEthernet0/0/2]port link-type hybrid
[Switch3-GigabitEthernet0/0/2]port hybrid pvid vlan 20
[Switch3-GigabitEthernet0/0/2]port hybrid untagged vlan 20
[Switch3-GigabitEthernet0/0/2]undo shutdown
[Switch3-GigabitEthernet0/0/2]quit
[Switch3]interface vlanif 20
[Switch3-Vlanif20]ip address 10.2.1.2 24
[Switch3-Vlanif20]quit
2.配置静态路由使Switch3、Switch1之间有可达路由
[Switch3]ip route-static 10.1.1.0 24 10.2.1.1
3.配置多跳BFD检测
[Switch3]bfd atoc bind peer-ip 10.1.1.1
[Switch3-bfd-session-atoc]discriminator local 20
[Switch3-bfd-session-atoc]discriminator remote 10
[Switch3-bfd-session-atoc]commit
[Switch3-bfd-session-atoc]quit
4.验证配置结果
[Switch3]display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 256 (Multi Hop) State : Up Name : atoc
--------------------------------------------------------------------------------
Local Discriminator : 20 Remote Discriminator : 10
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Peer IP Address
Bind Session Type : Static
Bind Peer IP Address : 10.1.1.1
Bind Interface : -
Track Interface : -
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 : -
Destination Port : 3784 TTL : 254
Proc Interface Status : Disable
WTR Interval (ms) : -
Active Multi : 3
Last Local Diagnostic : No Diagnostic
Bind Application : No Application Bind
Session TX TmrID : 1035 Session Detect TmrID : 1036
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 : 1/0