小乔 发表于 2023-11-7 21:42:26

配置VLANIF接口BFD单跳检

组网需求如图6-22所示,RouterA和RouterB通过VLANIF接口实现三层互通。用户希望可以实现设备间链路故障的快速检测。图6-22配置VLANIF接口BFD单跳检测组网图
https://download.huawei.com/mdl/image/download?uuid=f87fa9a3355a4f8c966763f74fc75fab


配置思路采用如下思路配置BFD单跳检测:在RouterA和RouterB上分别配置BFD会话,实现RouterA和RouterB间链路的检测。

操作步骤操作步骤
在RouterA和RouterB上创建VLAN,将Eth2/0/0接口配置为hybrid接口并加入VLAN(略)。
为VLANIF接口配置IP地址,使RouterA和RouterB之间实现三层互通(略)。
配置BFD单跳检测。
# 使能RouterA上的BFD功能并配置RouterA上的BFD会话。


<Huawei> system-view
sysname RouterA
bfd
quit
bfd atob bind peer-ip 10.1.1.6 interface vlanif 100
discriminator local 1
discriminator remote 2
commit
quit
# 使能RouterB上的BFD功能并配置RouterB上的BFD会话。


<Huawei> system-view
sysname RouterB
bfd
quit
bfd btoa bind peer-ip 10.1.1.5 interface vlanif 100
discriminator local 2
discriminator remote 1
commit
quit
验证配置结果。
# 配置完成后,在RouterA和RouterB上执行display bfd session all verbose命令,可以看到建立了一个单跳检测的BFD会话,且会话状态为Up。以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(Vlanif100)                                 
Bind Session Type      : Static                                             
Bind Peer IP Address   : 10.1.1.6                                          
NextHop Ip Address   : 10.1.1.6                                          
Bind Interface         : Vlanif100                                             
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的Eth2/0/0接口执行shutdown操作,模拟链路故障。


interface ethernet 2/0/0
shutdown
quit
# 配置完成后,在RouterA和RouterB上执行display bfd session all verbose命令,可以看到建立了一个单跳检测的BFD会话,且会话状态为Down。以RouterA上的显示为例:


display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 64      (One Hop) State : Down      Name : atob
--------------------------------------------------------------------------------
Local Discriminator    : 1                Remote Discriminator   : 2         
Session Detect Mode    : Asynchronous Mode Without Echo Function            
BFD Bind Type          : Interface(Vlanif100)                                 
Bind Session Type      : Static                                             
Bind Peer IP Address   : 10.1.1.6                                             
NextHop Ip Address   : 10.1.1.6
Bind Interface         : Vlanif100                                          
FSM Board Id         : 0                TOS-EXP                : 7         
Min Tx Interval (ms)   : 1000             Min Rx Interval (ms)   : 1000      
Actual Tx Interval (ms): 13000            Actual Rx Interval (ms): 13000      
Local Detect Multi   : 3                Detect Interval (ms)   : 39000      
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: Control Detection Time Expired                     
Bind Application       : No Application Bind                                 
Session TX TmrID       : 16897            Session Detect TmrID   : -         
Session Init TmrID   : 16898            Session WTR TmrID      : -         
Session Echo Tx TmrID: -                                                   
PDT Index            : FSM-0 | RCV-0 | IF-0 | TOKEN-0                                       
Session Description    : -                                                   
--------------------------------------------------------------------------------
                                                                              
   Total UP/DOWN Session Number : 0/1
配置文件
RouterA的配置文件


#
sysname RouterA
#
vlan batch 100
#
bfd
#
interface Vlanif100
ip address 10.1.1.5 255.255.255.0
#
interface Ethernet2/0/0
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bfd atob bind peer-ip 10.1.1.6 interface Vlanif100
discriminator local 1
discriminator remote 2
commit
#
return
RouterB的配置文件


#
sysname RouterB
#
vlan batch 100
#
bfd
#
interface Vlanif100
ip address 10.1.1.6 255.255.255.0
#
interface Ethernet2/0/0
port hybrid pvid vlan 100
port hybrid untagged vlan 100
#
bfd btoa bind peer-ip 10.1.1.5 interface Vlanif100
discriminator local 2
discriminator remote 1
commit
#
return



f1662 发表于 2023-11-8 11:05:03

{:6_290:}

f1662 发表于 2023-11-8 11:05:10

{:6_290:}

f1662 发表于 2023-11-8 11:05:40

{:6_267:}

f1662 发表于 2023-11-8 11:07:02

{:6_290:}

hlson 发表于 2023-11-8 17:19:50

{:6_267:}

374437593 发表于 2023-12-16 12:14:56

感谢楼主分享实用资源。

cinnamon 发表于 2025-1-24 10:20:15

{:6_267:}
页: [1]
查看完整版本: 配置VLANIF接口BFD单跳检