组网需求 如图6-23所示,RouterA和RouterB之间通过三层物理链路直连。用户希望可以实现设备间链路故障的快速检测。 图6-23 配置三层物理链路单跳检测组网图
配置思路采用如下思路配置BFD单跳检测: 在RouterA和RouterB上分别配置BFD会话,实现RouterA和RouterB间链路的检测。
操作步骤 配置RouterA和RouterB的直连接口IP地址 # 配置RouterA的接口IP地址。
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 10.1.1.1 24 [RouterA-GigabitEthernet1/0/0] quit # 配置RouterB的接口IP地址。
<Huawei> system-view [Huawei] sysname RouterB [RouterB] interface gigabitethernet 1/0/0 [RouterB-GigabitEthernet1/0/0] ip address 10.1.1.2 24 [RouterB-GigabitEthernet1/0/0] quit 配置BFD单跳检测 # 在RouterA上使能BFD,并配置与RouterB之间的BFD Session。需要在BFD Session中绑定接口。
[RouterA] bfd [RouterA-bfd] quit [RouterA] bfd atob bind peer-ip 10.1.1.2 interface gigabitethernet 1/0/0 [RouterA-bfd-session-atob] discriminator local 1 [RouterA-bfd-session-atob] discriminator remote 2 [RouterA-bfd-session-atob] commit [RouterA-bfd-session-atob] quit # 在RouterB上使能BFD,并配置与RouterA之间的BFD Session。需要在BFD Session中绑定接口。
[RouterB] bfd [RouterB-bfd] quit [RouterB] bfd btoa bind peer-ip 10.1.1.1 interface gigabitethernet 1/0/0 [RouterB-bfd-session-btoa] discriminator local 2 [RouterB-bfd-session-btoa] discriminator remote 1 [RouterB-bfd-session-btoa] commit [RouterB-bfd-session-btoa] quit 验证配置结果 # 配置完成后,在RouterA和RouterB上执行display bfd session all verbose命令,可以看到建立了一个单跳(one hop)的BFD Session,且状态为Up。
# 以RouterA上的显示为例。
[RouterA] display bfd session all verbose -------------------------------------------------------------------------------- Session MIndex : 64 (One Hop) State : Up Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(GigabitEthernet1/0/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 NextHop Ip Address : 10.1.1.2 Bind Interface : GigabitEthernet1/0/0 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 : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Active Multi : 3 DSCP : - Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : - 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 : 1/0 配置文件 RouterA的配置文件
# sysname RouterA # bfd # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 # bfd atob bind peer-ip 10.1.1.2 interface GigabitEthernet1/0/0 discriminator local 1 discriminator remote 2 commit # return RouterB的配置文件
# sysname RouterB # bfd # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 # bfd btoa bind peer-ip 10.1.1.1 interface GigabitEthernet1/0/0 discriminator local 2 discriminator remote 1 commit # return
|