BFD(Bidirectional ForwardingDetctcion)用于快速检测系统之间的发送和接收两个方向的通信故障,并在出现故障时通知上层应用。
静态BFD单跳检测的主要配置任务如下。
- 使能设备上的全局BFD功能。
- (可选)配置BFD缺省组播IP地址
- 创建BFD会话的绑定信息,建立BFD组播会话。
- 配置BFD会话的本端和远端标识符
单跳检测二层链路配置示例
bfd
bfd test bind peer-ip default-ip interfaceGigabitEthernet8/0/0
discriminator local 1
discriminator remote 2
commit
RouterB配置
bfd test bind peer-ipdefault-ip interface GigabitEthernet8/0/0
discriminatorlocal 2
discriminatorremote 1
commit
[RouterA]display bfd sessionall verbose
--------------------------------------------------------------------------------
Session MIndex : 256 (One Hop) State : Up Name : test
--------------------------------------------------------------------------------
LocalDiscriminator : 1 Remote Discriminator : 2
SessionDetect Mode : AsynchronousMode Without Echo Function
BFD BindType :Interface(GigabitEthernet8/0/0)
Bind SessionType :Static
Bind Peer IPAddress : 224.0.0.184
NextHop IpAddress : 224.0.0.184
BindInterface : GigabitEthernet8/0/0
FSM Board Id : 0 TOS-EXP : 7
Min TxInterval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual TxInterval (ms): 1000 Actual Rx Interval (ms): 1000
Local DetectMulti : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
DestinationPort :3784 TTL : 255
ProcInterface Status : Disable Process PST : Disable
WTR Interval(ms) : -
Active Multi : 3
Last LocalDiagnostic : No Diagnostic
BindApplication : No Application Bind
Session TXTmrID : - Session Detect TmrID : -
Session InitTmrID : - Session WTR TmrID : -
Session EchoTx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
SessionDescription : -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number :1/0
对RouterAg8/0/0执行shutdown
[RouterA]display bfd sessionall verbose
--------------------------------------------------------------------------------
Session MIndex : 256 (One Hop)State : Down Name : test
--------------------------------------------------------------------------------
LocalDiscriminator : 1 Remote Discriminator : 2
SessionDetect Mode : AsynchronousMode Without Echo Function
BFD BindType :Interface(GigabitEthernet8/0/0)
Bind SessionType :Static
Bind Peer IPAddress : 224.0.0.184
NextHop IpAddress : 224.0.0.184
BindInterface : GigabitEthernet8/0/0
FSM Board Id : 0 TOS-EXP : 7
Min TxInterval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual TxInterval (ms): 11999 Actual Rx Interval (ms): 11999
Local DetectMulti : 3 Detect Interval (ms) : -
Echo Passive : Disable Acl Number : -
DestinationPort :3784 TTL : 255
ProcInterface Status : Disable Process PST : Disable
WTR Interval(ms) : -
Active Multi : 3
Last LocalDiagnostic : Control Detection Time Expired
BindApplication : No Application Bind
Session TXTmrID :1035 SessionDetect TmrID : -
Session InitTmrID : - Session WTR TmrID : -
Session EchoTx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
SessionDescription : -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number :0/1
————————————————————————————————————————
VLANIF接口单跳检测配置
本示例中是检测三层VLANIF接口的状态,所以在创建BFD会话绑定信息时要绑定对端的IP地址(不使用BFD组播地址),同时也是单跳检测,所以也要指定出接口
R1配置
interfaceVlanif100
ip address12.1.1.1 255.255.255.0
#
interfaceEthernet8/0/0
portlink-type access
port defaultvlan 100
bfd test bind peer-ip 12.1.1.2interface Vlanif100
discriminatorlocal 1
discriminatorremote 2
R2配置
interfaceVlanif100
ip address12.1.1.2 255.255.255.0
#
interfaceEthernet8/0/0
portlink-type access
port defaultvlan 100
bfd test bind peer-ip 12.1.1.1interface Vlanif100
discriminatorlocal 2
discriminatorremote 1
commit
————————————————————————————————————————————
BFD多跳检测配置示例
多跳检测,不指定出接口,但要指定对端IP地址
bfd test bind peer-ip 23.1.1.3
discriminator local1
discriminatorremote 3
commit
R3配置
bfd test bind peer-ip 12.1.1.1
discriminator local3
discriminatorremote 1
commit
[R1]display bfd session allverbose
--------------------------------------------------------------------------------
Session MIndex : 256 (Multi Hop) State : Up Name : test
--------------------------------------------------------------------------------
LocalDiscriminator : 1 Remote Discriminator : 3
SessionDetect Mode : AsynchronousMode Without Echo Function
BFD BindType : Peer IP Address
Bind SessionType :Static
Bind Peer IPAddress : 23.1.1.3
BindInterface : -
TrackInterface : -
FSM Board Id : 0 TOS-EXP : 7
Min TxInterval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual TxInterval (ms): 1000 Actual Rx Interval (ms): 1000
Local DetectMulti : 3 Detect Interval (ms) : 3000
Echo Passive : Disable Acl Number : -
DestinationPort :3784 TTL : 254
ProcInterface Status : Disable Process PST : Disable
WTR Interval(ms) : -
Active Multi : 3
Last LocalDiagnostic : No Diagnostic
BindApplication : No Application Bind
Session TXTmrID : - Session Detect TmrID : -
Session InitTmrID : - Session WTR TmrID : -
Session EchoTx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
SessionDescription : -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number :1/0
————————————————————————————————————————————————————
BGD状态与接口状态联动配置示例
R1和R2网络层直连,链路中间存在二层传输设备SW1和SW2,用户希望两端设备能够快速感知到链路故障,触发路由快速收敛。
[R1]display bfd session allverbose
--------------------------------------------------------------------------------
Session MIndex : 256 (One Hop) State : Up Name : test
--------------------------------------------------------------------------------
Local Discriminator : 1 RemoteDiscriminator : 2
Session Detect Mode : Asynchronous Mode WithoutEcho Function
BFD Bind Type : Interface(Ethernet4/0/0)
Bind Session Type : Static
Bind Peer IP Address :224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface :Ethernet4/0/0
FSM Board Id : 0 TOS-EXP : 7
Min Tx Interval (ms) : 1000 Min Rx Interval (ms) : 1000
Actual Tx Interval (ms): 14499 Actual RxInterval (ms): 14499
Local Detect Multi : 3 DetectInterval (ms) : 43497
Echo Passive : Disable Acl Number : -
Destination Port : 3784 TTL : 255
ProcInterface 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 : 1052 Session Detect TmrID : -
Session Init TmrID : 1053 Session WTR TmrID : -
Session Echo Tx TmrID : -
Jun 27 2017 09:29:55-08:00 R1 �D/4/STACHG_TOUP(l)[35]:BFDsession changed t
o Up. (SlotNumber=0, Discriminator=16777216,FormerStatus=Init, Applications=Non
e, BindInterfaceName=Ethernet4/0/0, ProcessPST=False) PDT Index :
FSM-0 | RCV-0 | IF-0 | TOKEN-0
Session Description : -
--------------------------------------------------------------------------------
TotalUP/DOWN Session Number : 1/0
Proc InterfaceStatus:Disable,没有配置process-interface-status命令
ProcessPST:Disable没有通过process-pst命令修改端口状态表PST功能。
___________________________________________________________________________
单臂回声功能配置示例
R1支持BFD功能,R2不支持BFD功能
R1上的配置
bfd test bind peer-ip 12.1.1.2interface GigabitEthernet0/0/0 one-arm-echo
discriminatorlocal 1
min-echo-rx-interval100
commit
[R1]display bfd sessionall verbose
--------------------------------------------------------------------------------
Session MIndex : 256 (One Hop) State : Up Name : test
--------------------------------------------------------------------------------
LocalDiscriminator : 1 Remote Discriminator : -
SessionDetect Mode : AsynchronousOne-arm-echo Mode
BFD BindType :Interface(GigabitEthernet0/0/0)
Bind SessionType :Static
Bind Peer IPAddress : 12.1.1.2
NextHop IpAddress : 12.1.1.2
BindInterface : GigabitEthernet0/0/0
FSM Board Id : 0 TOS-EXP : 7
Echo RxInterval (ms) : 100
Actual TxInterval (ms): 100 Actual Rx Interval (ms): 100
Local DetectMulti : 3 Detect Interval (ms) : 300
Echo Passive : Disable Acl Number : -
DestinationPort :3784 TTL : 255
ProcInterface Status : Disable Process PST : Disable
WTR Interval(ms) : -
Active Multi : 3
Last LocalDiagnostic : Control Detection Time Expired
BindApplication : No Application Bind
Session TXTmrID : - Session Detect TmrID : -
Session InitTmrID : - Session WTR TmrID : -
Session EchoTx TmrID : -
PDT Index : FSM-0 | RCV-0 | IF-0 | TOKEN-0
SessionDescription : -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number :1/0