1.组网需求
· Switch A、Switch B和Switch C上运行OSPF,网络层相互可达。
· 当Switch A和Switch B通过L2 Switch通信的链路出现故障时BFD能够快速感知通告OSPF协议,并且切换到Switch C进行通信。
2.配置
1)接口配置和OSPF基本配置
2)配置BFD功能
# 在Switch A上使能BFD检测功能,并配置BFD参数。 [SwitchA] bfd session init-mode active [SwitchA] interface vlan-interface 10 [SwitchA-Vlan-interface10] ospf bfd enable [SwitchA-Vlan-interface10] bfd min-transmit-interval 500 [SwitchA-Vlan-interface10] bfd min-receive-interval 500 [SwitchA-Vlan-interface10] bfd detect-multiplier 7
# 在Switch B上使能BFD检测功能,并配置BFD参数。 [SwitchB] bfd session init-mode active [SwitchB] interface vlan-interface 10 [SwitchB-Vlan-interface10] ospf bfd enable [SwitchB-Vlan-interface10] bfd min-transmit-interval 500 [SwitchB-Vlan-interface10] bfd min-receive-interval 500 [SwitchB-Vlan-interface10] bfd detect-multiplier 6
3.配置验证
# 显示Switch A的BFD信息。
<SwitchA> display bfd session Total Session Num: 1 Up Session Num: 1 Init Mode: Active IPv4 session working in control packet mode: LD/RD SourceAddr DestAddr State Holdtime Interface 3/1 192.168.0.102 192.168.0.100 Up 1700ms Vlan10
# 在Switch A上查看120.1.1.1/32的路由信息,可以看出Switch A和Switch B是通过L2 Switch进行通信的。 <SwitchA> display ip routing-table 120.1.1.1 verbose Destination: 120.1.1.1/32 Protocol: O_INTRA Process ID: 1 SubProtID: 0x1 Age: 04h20m37s Cost: 1 Preference: 10 IpPre: N/A QosLocalID: N/A Tag: 0 State: Active Adv OrigTblID: 0x0 OrigVrf: default-vrf TableID: 0x2 OrigAs: 0 NibID: 0x26000002 LastAs: 0 AttrID: 0xffffffff Neighbor: 0.0.0.0 Flags: 0x1008c OrigNextHop: 192.168.0.100 Label: NULL RealNextHop: 192.168.0.100 BkLabel: NULL BkNextHop: N/A SRLabel: NULL BkSRLabel: NULL SIDIndex: NULL InLabel: NULL Tunnel ID: Invalid Interface: Vlan-interface10 BkTunnel ID: Invalid BkInterface: N/A FtnIndex: 0x0 TrafficIndex: N/A Connector: N/A PathID: 0x0 LinkCost: 0 MicroSegID: 0
当Switch A和Switch B通过L2 Switch通信的链路出现故障时:
# 在Switch A上查看120.1.1.1/32的路由信息,可以看出Switch A和Switch B已经切换到Switch C进行通信。 <SwitchA> display ip routing-table 120.1.1.1 verbose Summary count : 1 Destination: 120.1.1.1/32 Protocol: O_INTRA Process ID: 1 SubProtID: 0x1 Age: 04h20m37s Cost: 2 Preference: 10 IpPre: N/A QosLocalID: N/A Tag: 0 State: Active Adv OrigTblID: 0x0 OrigVrf: default-vrf TableID: 0x2 OrigAs: 0 NibID: 0x26000002 LastAs: 0 AttrID: 0xffffffff Neighbor: 0.0.0.0 Flags: 0x1008c OrigNextHop: 10.1.1.100 Label: NULL RealNextHop: 10.1.1.100 BkLabel: NULL B kNextHop: N/A SRLabel: NULL BkSRLabel: NULL SIDIndex: NULL InLabel: NULL Tunnel ID: Invalid Interface: Vlan-interface11 BkTunnel ID: Invalid BkInterface: N/A FtnIndex: 0x0 TrafficIndex: N/A Connector: N/A PathID: 0x0 LinkCost: 0 MicroSegID: 0