成长值: 63370
|
组网需求 如图6-25所示,RouterA和RouterB网络层直连,链路中间存在二层传输设备SwitchA和SwitchB。用户希望两端设备能够快速感知到链路故障,触发路由快速收敛。 图6-25 配置BFD状态与接口状态联动组网图
配置思路采用如下思路配置BFD与接口状态联动: 在RouterA和RouterB上分别配置BFD会话,实现RouterA和RouterB间链路的检测。 在SwitchA和SwitchB上配置PVID,保证二层互通。 BFD会话状态Up以后分别在RouterA和RouterB上配置BFD状态与接口状态联动。
操作步骤配置RouterA和RouterB的直连接口的PVID
# 配置RouterA的接口PVID。
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA] port link-type trunk
[RouterA-GigabitEthernet1/0/0] port trunk pvid vlan 10
[RouterA-GigabitEthernet1/0/0] quit
# 配置RouterB的接口PVID。
<Huawei> system-view
[Huawei] sysname RouterB
[RouterB] interface gigabitethernet 1/0/0
[RouterB] port link-type trunk
[RouterB-GigabitEthernet1/0/0] port trunk pvid vlan 10
[RouterB-GigabitEthernet1/0/0] quit
配置BFD单跳检测
# 在RouterA上使能BFD,配置与RouterB之间的BFD Session。
[RouterA] bfd
[RouterA-bfd] quit
[RouterA] bfd atob bind peer-ip default-ip interface gigabitethernet 1/0/0
[RouterA-bfd-session-atob] discriminator local 10
[RouterA-bfd-session-atob] discriminator remote 20
[RouterA-bfd-session-atob] commit
[RouterA-bfd-session-atob] quit
# 在RouterB上使能BFD,并配置与RouterA之间的BFD Session。
[RouterB] bfd
[RouterB-bfd] quit
[RouterB] bfd btoa bind peer-ip default-ip interface gigabitethernet 1/0/0
[RouterB-bfd-session-btoa] discriminator local 20
[RouterB-bfd-session-btoa] discriminator remote 10
[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 : 16384 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10
Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10
Local Detect Multi : 3 Detect Interval (ms) : 30
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Disable Process PST : Disable
WTR Interval (ms) : 300000
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
配置BFD状态与接口状态联动
# 在RouterA上配置BFD状态与接口状态联动。
[RouterA] bfd atob
[RouterA-bfd-session-atob] process-interface-status
[RouterA-bfd-session-atob] commit
[RouterA-bfd-session-atob] quit
# 在RouterB上配置BFD状态与接口状态联动。
[RouterB] bfd btoa
[RouterB-bfd-session-btoa] process-interface-status
[RouterB-bfd-session-btoa] commit
[RouterB-bfd-session-btoa] quit
验证配置结果
# 配置完成后,在RouterA和RouterB上执行display bfd session all verbose命令,看到“Proc interface status”字段显示为“Enable”。
# 以RouterA上的显示为例。
[RouterA] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 16384 (One Hop) State : Up Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10
Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10
Local Detect Multi : 3 Detect Interval (ms) : 30
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Enable Process PST : Disable
WTR Interval (ms) : 300000
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
# 对SwitchB的GE1/0/1接口执行shutdown操作,模拟二层传输设备故障,BFD会话的状态变为Down:
[SwitchB] interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1] shutdown
[SwitchB-GigabitEthernet1/0/1] quit
# 在RouterA上执行display bfd session all verbose命令和display interface gigabitethernet 1/0/0命令,可以看到BFD Session状态为Down,GE1/0/0接口的协议状态为Down(BFD status down)。
[RouterA] display bfd session all verbose
--------------------------------------------------------------------------------
Session MIndex : 16384 (One Hop) State : Down Name : atob
--------------------------------------------------------------------------------
Local Discriminator : 10 Remote Discriminator : 20
Session Detect Mode : Asynchronous Mode Without Echo Function
BFD Bind Type : Interface(GigabitEthernet1/0/0)
Bind Session Type : Static
Bind Peer Ip Address : 224.0.0.184
NextHop Ip Address : 224.0.0.184
Bind Interface : GigabitEthernet1/0/0
FSM Board Id : 3 TOS-EXP : 7
Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10
Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10
Local Detect Multi : 3 Detect Interval (ms) : 30
Echo Passive : Disable Acl Number : --
Destination Port : 3784 TTL : 255
Proc interface status : Enable Process PST : Disable
WTR Interval (ms) : 300000
Active Multi : 3 DSCP : -
Last Local Diagnostic : Control Detection Time Expired
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 : 0/1
[RouterA] display interface gigabitethernet 1/0/0
GigabitEthernet1/0/0 current state : UP
Line protocol current state : Down(BFD status down)
Last line protocol up time : 2012-05-08 10:29:51
Description:HUAWEI, AR Series, GigabitEthernet1/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.1.1.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc01-0009
Last physical up time : 2012-05-08 10:29:51
Last physical down time : 2012-05-08 10:23:49
Current system time: 2012-05-08 14:26:25
Port Mode: COMMON COPPER
Speed : 1000, Loopback: NONE
Duplex: FULL, Negotiation: ENABLE
Mdi : AUTO
Last 300 seconds input rate 120 bits/sec, 0 packets/sec
Last 300 seconds output rate 2832 bits/sec, 0 packets/sec
Input peak rate 1552 bits/sec,Record time: 2012-05-07 17:28:14
Output peak rate 4968 bits/sec,Record time: 2012-05-08 14:20:09
Input: 29617 packets, 14279461 bytes
Unicast: 0, Multicast: 29617
Broadcast: 0, Jumbo: 0
Discard: 0, Total Error: 0
CRC: 0, Giants: 0
Jabbers: 0, Throttles: 0
Runts: 0, Alignments: 0
Symbols: 0, Ignoreds: 0
Frames: 0
Output: 203740 packets, 309230984 bytes
Unicast: 0, Multicast: 203740
Broadcast: 0, Jumbo: 0
Discard: 0, Total Error: 0
Collisions: 0, ExcessiveCollisions: 0
Late Collisions: 0, Deferreds: 0
Buffers Purged: 0
Input bandwidth utilization threshold : 100.00%
Output bandwidth utilization threshold: 100.00%
Input bandwidth utilization : 0.01%
Output bandwidth utilization : 0.01%
配置文件
RouterA的配置文件
#
sysname RouterA
#
bfd
#
interface GigabitEthernet1/0/0
port link-type trunk
port trunk pvid vlan 10
#
bfd atob bind peer-ip default-ip interface GigabitEthernet1/0/0
discriminator local 10
discriminator remote 20
process-interface-status
commit
#
return
RouterB的配置文件
#
sysname RouterB
#
bfd
#
interface GigabitEthernet1/0/0
port link-type trunk
port trunk pvid vlan 10
#
bfd btoa bind peer-ip default-ip interface GigabitEthernet1/0/0
discriminator local 20
discriminator remote 10
process-interface-status
commit
#
return
|
|