华为CE交接机-配置BFD状态与子接口状态联动

配置BFD状态与子接口状态联动

组网需求

在大规模城域以太网等组网环境中,子接口上需要配置大量VLAN业务,对可靠性要求也很高,这时可以建立BFD会话检测主接口链路的连通性,并配置BFD状态与子接口状态联动功能(如图1所示),以提高子接口上业务的可靠性,同时节约会话资源。

图1 配置BFD状态与子接口状态联动

华为CE交接机-配置BFD状态与子接口状态联动

本例中interface1代表100GE1/0/1,interface1.1代表100GE1/0/1.1。

华为CE交接机-配置BFD状态与子接口状态联动

配置思路

采用如下思路配置BFD状态与子接口状态联动:

  1. 配置DeviceA和DeviceB接口的IP地址。

  2. 在DeviceA和DeviceB上使能全局BFD功能,并配置单跳BFD会话。

  3. 配置BFD会话与子接口状态联动。

操作步骤

  1. 配置DeviceA和DeviceB的主接口IP地址,并创建子接口。
    # 配置DeviceA。

    <HUAWEI> system-view
    [~HUAWEI] sysname DeviceA
    [*HUAWEI] commit
    [~DeviceA] interface 100ge 1/0/1
    [~DeviceA-100GE1/0/1] undo portswitch
    [*DeviceA-100GE1/0/1] ip address 10.1.1.1 24
    [*DeviceA-100GE1/0/1] quit
    [*DeviceA] interface 100ge 1/0/1.1
    [*DeviceA-100GE1/0/1.1] ip address 10.2.1.1 24
    [*DeviceA-100GE1/0/1.1] dot1q termination vid 10
    [*DeviceA-100GE1/0/1.1] quit
    [*DeviceA] commit

    # 配置DeviceB。

    <HUAWEI> system-view
    [~HUAWEI] sysname DeviceB
    [*HUAWEI] commit
    [~DeviceB] interface 100ge 1/0/1
    [~DeviceB-100GE1/0/1] undo portswitch
    [*DeviceB-100GE1/0/1] ip address 10.1.1.2 24
    [*DeviceB-100GE1/0/1] quit
    [*DeviceB] interface 100ge 1/0/1.1
    [*DeviceB-100GE1/0/1.1] ip address 10.2.1.2 24
    [*DeviceB-100GE1/0/1.1] dot1q termination vid 10
    [*DeviceB-100GE1/0/1.1] quit
    [*DeviceB] commit
  2. 配置BFD单跳检测。
    # 配置DeviceA。

    [~DeviceA] bfd
    [*DeviceA-bfd] quit
    [*DeviceA] bfd pissub bind peer-ip default-ip interface 100ge 1/0/1
    [*DeviceA-bfd-session-pissub] discriminator local 1
    [*DeviceA-bfd-session-pissub] discriminator remote 2
    [*DeviceA-bfd-session-pissub] quit
    [*DeviceA] commit
    # 配置DeviceB。

    [~DeviceB] bfd
    [*DeviceB-bfd] quit
    [*DeviceB] bfd pissub bind peer-ip default-ip interface 100ge 1/0/1
    [*DeviceB-bfd-session-pissub] discriminator local 2
    [*DeviceB-bfd-session-pissub] discriminator remote 1
    [*DeviceB-bfd-session-pissub] quit
    [*DeviceB] commit
  3. 配置BFD会话与子接口状态联动。
    # 配置DeviceA。

    [~DeviceA] bfd pissub 
    [*DeviceA-bfd-session-pissub] process-interface-status sub-if
    [*DeviceA-bfd-session-pissub] quit
    [*DeviceA] commit
    # 配置DeviceB。

    [~DeviceB] bfd pissub
    [*DeviceB-bfd-session-pissub] process-interface-status sub-if
    [*DeviceB-bfd-session-pissub] quit
    [*DeviceB] commit

检查配置结果

# 配置完成后,在DeviceA和DeviceB上查看BFD会话详细信息。以DeviceA的显示结果为例。

[~DeviceA] display bfd session all verbose
(w): State in WTR 
(*): State is invalid  Total UP/DOWN Session Number : 1/0
------------------------------------------------------------------------------
  Name : pissub                       (Single Hops) State : Up     
------------------------------------------------------------------------------
  Local Discriminator    : 1                Remote Discriminator    : 2
  Session Detect Mode    : Asynchronous Mode Without Echo Function
  BFD Bind Type          : Interface(100GE1/0/1)
  Bind Session Type      : Static
  Bind Peer IP Address   : 224.0.0.184
  Bind Interface         : 100GE1/0/1
  FSM Board ID           : 1               TOS-EXP                : 7
  Min Tx Interval (ms)   : 1000      Min Rx Interval (ms)   : 1000
  Actual Tx Interval (ms): 1000             Actual Rx Interval (ms): 1000
  WTR Interval (ms)      : -                Detect Interval (ms)   : 3000
  Local Detect Multi     : 3                Active Multi           : -
  Echo Passive           : Disable          Acl Number             : - 
  Destination Port       : 3784             TTL                    : 255 
  Proc Interface Status  : Disable          Process PST            : Disable    
  Config PST             : Disable    
  Active Multi           : 3
  Last Local Diagnostic  : No Diagnostic
  Bind Application       : No Application Bind
  Session Description    : - 
------------------------------------------------------------------------------

可以看出,DeviceA上建立了一个单跳(Single Hops)的BFD会话,状态为Up。

# 对DeviceB的100GE1/0/1接口执行shutdown操作。

[~DeviceB] interface 100ge 1/0/1
[~DeviceB-100GE1/0/1] shutdown
[~DeviceB-100GE1/0/1] quit
[*DeviceB] commit

# 在DeviceA上查看100GE1/0/1.1接口的状态。

[~DeviceA] display interface 100ge 1/0/1.1
100GE1/0/1.1 current state : DOWN (ifindex: 33)
Line protocol current state : DOWN (Main BFD status down)
...

可以看出,DeviceA上100GE1/0/1.1接口的状态为DOWN(Main BFD status down)。

# 在DeviceA上查看BFD会话详细信息。

[~DeviceA] display bfd session all verbose
(w): State in WTR  (*): State is invalid
  Total UP/DOWN Session Number : 0/1
------------------------------------------------------------------------------
  Name : pissub                       (Single Hops) State : Down     
------------------------------------------------------------------------------
  Local Discriminator    : 1                Remote Discriminator    : 2
  Session Detect Mode    : Asynchronous Mode Without Echo Function
  BFD Bind Type          : Interface(100GE1/0/1)
  Bind Session Type      : Static
  Bind Peer IP Address   : 224.0.0.184
  Bind Interface         : 100GE1/0/1
  FSM Board ID           : 1               TOS-EXP                : 7
  Min Tx Interval (ms)   : 1000      Min Rx Interval (ms)   : 1000
  Actual Tx Interval (ms): 1000             Actual Rx Interval (ms): 1000
  WTR Interval (ms)      : 0                Detect Interval (ms)   : 3000
  Local Detect Multi     : 3                Active Multi           : -
  Echo Passive           : Disable          Acl Number             : - 
  Destination Port       : 3784             TTL                    : 255 
  Proc Interface Status  : Disable          Process PST            : Disable    
  Config PST             : Disable    
  Active Multi           : 3
  Last Local Diagnostic  : Control Detection Time Expired
  Bind Application       : No Application Bind
  Session Description    : - 
------------------------------------------------------------------------------

可以看出,DeviceA上BFD会话状态为Down。

配置脚本

  • DeviceA

    #
    sysname DeviceA
    #
    bfd
    #
    interface 100GE1/0/1
     undo portswitch
     ip address 10.1.1.1 255.255.255.0
    #
    interface 100GE1/0/1.1
     ip address 10.2.1.1 255.255.255.0
     encapsulation dot1q-termination
    #
    bfd pissub bind peer-ip default-ip interface 100GE1/0/1
     discriminator local 1
     discriminator remote 2
     process-interface-status sub-if
    #
    return
  • DeviceB

    #
    sysname DeviceB
    #
    bfd
    #
    interface 100GE1/0/1
     undo portswitch
     ip address 10.1.1.2 255.255.255.0
    #
    interface 100GE1/0/1.1
     ip address 10.2.1.2 255.255.255.0
     encapsulation dot1q-termination
    #
    bfd pissub bind peer-ip default-ip interface 100GE1/0/1
     discriminator local 2
     discriminator remote 1
     process-interface-status sub-if
    #
    return
上一篇 LDP 邻居震荡排查步骤
下一篇 Apache 虚拟主机独立日志配置教程