华为路由器交换机BFD配置步骤

一、静态BFD单跳和多跳检测

     BFD单跳检测:两个直连系统进行ip连通性检测;BFD会话必须绑定本端出接口和对端IP地址

     BFD多跳检测:两个系统之间的任意路径检测;BFD会话绑定对端IP地址

1、静态BFD单跳检测配置(设备两端同时配置):
     配置前需先配置链路层参数,使接口的链路协议状态为UP,路由可达,如果是三层接口(包括子接口)还需配置IP地址。二层接口和三层接口配置方法有些区别

1、全局使能BFD
    [router 1]bfd

 2、配置BFD组播 IP地址(可选)。
    默认值为224.0.0.184。仅当对端设备无法配置IP地址(如二层设备)时采用。   如果BFD检测路径上存在重叠的BFD会话(如三层接口通过具有BFD功能的二层交换设备连接),必须配置不同的缺省组播IP地址,以免BFD报文被错误转发。如果已经配置了缺省组播地址的BFD会话,则不能更改缺省组播地址。
  [router 1-bfd]default-ip-address 224.0.0.184

 3、创建BFD会话绑定信息 (区别不同的BFD会话)
 [Huawei]bfd test 
 [Huawei-bfd-session-test]
 3.1对于三层接口创建IP连通性
    [router 1]bfd 1 bind peer-ip 10.1.1.254 interface GigabitEthernet 0/0/2(本端接口) source-ip  10.1.1.1 
 3.2对于二层接口创建检测链路物理状态
    [router 1]bfd 2 bind peer-ip default-ip  interface GigabitEthernet 0/0/2

 4、配置BFD会话本地标识符 
   [Huawei-bfd-session-001]discriminator local 100

 5、配置BFD会话远端标识符
    [Huawei-bfd-session-001]discriminator remote 101

 6、提交BFD会话配置 
    [Huawei-bfd-session-001]commit


 2、静态BFD 多跳配置检测
    多跳检测需要三层接口来实现,不能连接二成设备。所以不需要配置缺省组播IP地址,无需指定本地出接口,只需要绑定对端IP地址和保证路由可达。
 具体配置步骤:

 1、全局使能BFD
 [Huawei]bfd 
 [Huawei-bfd]

 2、绑定对端IP地址
 [Huawei]bfd test bind peer-ip 1.1.1.1
 [Huawei-bfd-session-test]

 3、设置BFD会话的本地标识符
 [Huawei-bfd-session-test]discriminator local ?
   INTEGER<1-8191>  Discriminator value

 4、设置BFD会话的远端标识符
 [Huawei-bfd-session-test]discriminator remote ?
   INTEGER<1-8191>  Discriminator value

 5、提交BFD会话
 [Huawei-bfd-session-test]commit

 二、静态标识符自协商BFD
    如果对端采用动态BFD,而本端要与之互通,又要能够实现BFD检测静态路由,则必须配置静态标识符自协商BFD。本功能主要用于检测采用静态路由实现三层互通的网络中。必须配置源IP地址和指定对端IP地址。

    [Huawei]bfd test bind peer-ip 1.1.1.1 interface GigabitEthernet 0/0/1 source-ip 2.2.2.2 auto

 三、静态BFD单臂回声功能
     通过BFD报文的环回操作来检测转发链路的连通性,主要应用于两台直连设备中只有一台设备支持BFD,另一台不支持BFD但支持基本的网络转发的情形下。所以单臂回声功能只适用于BFD单跳检测。
     单臂回声功能相连的两台设备必须通过三层接口相连,且正确配置IP地址。
     
     [Huawei]bfd test bind peer-ip 1.1.1.1 interface GigabitEthernet 0/0/1 one-arm-echo

 四、静态BFD与接口/子接口状态联动
     指当BFD会话的状态变化时,直接修改接口或子接口的BFD状态。与接口或子接口状态联动的功能仅针对绑定了出接口,且使用缺省组播IP地址进行检测的单跳检测BFD会话。
     具体配置:
     
 1、全局使能BFD会话
     [Huawei]bfd

 2、设置BFD缺省组播地址 (可选)
     [Huawei-bfd]default-ip-address ?
           IP_ADDR<X.X.X.X>  Default multicast address 224.0.0.107-224.0.0.250

 3、设置BFD会话绑定
     [Huawei]bfd test bind peer-ip default-ip  interface GigabitEthernet 0/0/1(本端出接口)

 4、设置BFD会话的本地标识符
 [Huawei-bfd-session-test]discriminator local ?
   INTEGER<1-8191>  Discriminator value

 5、设置BFD会话的远端标识符
 [Huawei-bfd-session-test]discriminator remote ?
   INTEGER<1-8191>  Discriminator value

 6、与接口/子接口联动
 [Huawei-bfd-session-test]process-interface-status ? #与接口联动
   sub-if  Relating sub interface flag #与子接口联动
   <cr>    Please press ENTER to execute command

 7、提交BFD会话
 [Huawei-bfd-session-test]commit


 五、调整BFD参数

 1、设置BFD报文发送间隔(默认1000ms)
 [Huawei]bfd test
 [Huawei-bfd-session-test]min
 [Huawei-bfd-session-test]min-tx-interval ?
   INTEGER<10-2000>  Minimum receive interval in milliseconds, default is 1000ms

 2、设置BFD报文接收间隔
 [Huawei-bfd-session-test]min-rx-interval

 3、设置本地检测倍数
 [Huawei-bfd-session-test]detect-multiplier ?
   INTEGER<3-50>  Detect multiplier, default is 3

 4、设置BFD会话等待恢复时间 
 [Huawei-bfd-session-test]wtr ?
   INTEGER<1-60>  Wait to restore time in minute, default value is 0(immediately)
                  minute. The value will be effective when starting WTR next time

 5、设置BFD会话延迟UP时间 
 [Huawei-bfd]delay-up ?
   INTEGER<1-600>  Specify the Delay-Up interval. The value ranges from 1 to 600,
                   in seconds. The default value is 0, indicating that the BFD   
                   session will be Up immediately
 6、设置BFD报文的生存时间 
 [Huawei-bfd]peer-ip 1.1.1.1 24 ttl ?
   multi-hop   Multi-hop #多跳会话类型
   single-hop  Single-hop 单跳会话类型
 [Huawei-bfd]peer-ip 1.1.1.1 24 ttl single-hop ?
   INTEGER<1-255>  Basic ttl value