配置BFD for OSPF特性示例

点击学习精彩网络技术老师:华为、华三、锐捷、WLAN、IPv6全套视频课程

举例介绍配置BFD for OSPF特性的配置过程,包括配置思路、数据准备、操作步骤和配置结果。

组网需求

OSPF通过周期性的向邻居发送Hello报文来实现邻居检测,检测到故障所需时间比较长,超过1秒钟。随着科技的发展,语音、视频及其它点播业务应用广泛,而这些业务对于丢包和延时非常敏感,当数据达到吉比特速率级时,较长的检测时间会导致大量数据丢失,无法满足电信级网络高可靠性的需求。通过配置BFD for OSPF特性,可以快速检测链路的状态,故障检测时间可以达到毫秒级,提高链路状态变化时OSPF的收敛速度。

例如,如图1所示。网络部署为主/备链路,主链路为RouterA→RouterB,备链路为RouterA→RouterC→RouterB。正常情况下,业务流量在主链路上传送。当主链路故障时,用户希望能够快速感知,及时把业务流量切换到备份链路上。

此时,可以配置BFD for OSPF功能,使用BFD检测RouterA和RouterB之间的OSPF邻居关系,当RouterA和RouterB之间的链路发生故障时,BFD能够快速检测到故障并通告给OSPF协议,使业务流量切换到备份链路上传送。

图1 配置BFD for OSPF特性组网图

配置思路

采用如下思路配置BFD for OSPF特性:

在各路由器上使能OSPF,配置OSPF基本功能。

在RouterA和RouterB上使能BFD for OSPF特性。

数据准备

为完成此配置例,需准备如下的数据:

RouterA的Router ID 1.1.1.1,运行的OSPF进程号1,区域0的网段3.3.3.3/24、1.1.1.1/24。

RouterB的Router ID 2.2.2.2,运行的OSPF进程号1,区域0的网段3.3.3.3/24、2.2.2.2/24、172.16.1.0/24。

RouterC的Router ID 3.3.3.3,运行的OSPF进程号1,区域0的网段1.1.1.1/24、2.2.2.2/24。

RouterA和RouterB对BFD报文的最小发送和接收间隔、本地检测倍数。

操作步骤
  1. 配置各接口的IP地址。

请参见图1,配置各接口的IP地址,具体配置过程请参考配置文件。

  1. 配置OSPF基本功能。

请参见配置OSPF的基本功能,具体配置过程请参考配置文件。

# 配置完成后,查看RouterA的邻居关系。

<RouterA> display ospf peer

          OSPF Process 1 with Router ID 1.1.1.1

                  Neighbors

 Area 0.0.0.0 interface 1.1.1.1(GigabitEthernet1/0/0)'s neighbors

 Router ID: 3.3.3.3          Address: 1.1.1.2          

   State: Full  Mode:Nbr is  Master  Priority: 1

   DR: 1.1.1.1  BDR: 1.1.1.2  MTU: 0

   Dead timer due in 38  sec

   Retrans timer interval: 5

   Neighbor is up for 00:00:15

   Authentication Sequence: [ 0 ]

                  Neighbors

 Area 0.0.0.0 interface 3.3.3.1(GigabitEthernet2/0/0)'s neighbors

 Router ID: 2.2.2.2          Address: 3.3.3.2

   State: Full  Mode:Nbr is   Master  Priority: 1

   DR: 3.3.3.1  BDR: 3.3.3.2  MTU: 0

   Dead timer due in 25  sec

   Retrans timer interval: 5

   Neighbor is up for 00:00:59

   Authentication Sequence: [ 0 ]

可以看到,RouterA与RouterB、RouterC之间建立了邻居关系。

# 查看RouterA的OSPF路由表的信息。

<RouterA> display ospf routing

          OSPF Process 1 with Router ID 1.1.1.1

                   Routing Tables

 Routing for Network

 Destination        Cost  Type       NextHop         AdvRouter       Area

 172.16.1.0/24      2     Stub       3.3.3.2         2.2.2.2         0.0.0.0

 3.3.3.3/24         1     Transit    3.3.3.1         1.1.1.1         0.0.0.0

 2.2.2.2/24         2     Transit    3.3.3.2         3.3.3.3         0.0.0.0

 2.2.2.2/24         2     Transit    1.1.1.2         3.3.3.3         0.0.0.0

 1.1.1.1/24         1     Transit    1.1.1.1         1.1.1.1         0.0.0.0

 Total Nets: 5

 Intra Area: 5  Inter Area: 0  ASE: 0  NSSA: 0

可以看到,有去往RouterB和RouterC的路由表项,去往172.16.1.0/24的路由下一跳地址为3.3.3.2,流量在主链路RouterA→RouterB上传输。

  1. 配置BFD for OSPF特性,并配置发送和接收间隔、本地检测时间倍数。

# 配置RouterA。

[RouterA] bfd

[RouterA-bfd] quit

[RouterA] ospf

[RouterA-ospf-1] bfd all-interfaces enable

[RouterA-ospf-1] bfd all-interfaces min-tx-interval 500 min-rx-interval 500 detect-multiplier 4

[RouterA-ospf-1] quit

# 配置RouterB。

[RouterB] bfd

[RouterB-bfd] quit

[RouterB] ospf

[RouterB-ospf-1] bfd all-interfaces enable

[RouterB-ospf-1] bfd all-interfaces min-tx-interval 500 min-rx-interval 500 detect-multiplier 4

[RouterB-ospf-1] quit

配置完成后,查看RouterA的BFD会话信息。

[RouterA] display ospf bfd session all

          OSPF Process 1 with Router ID 1.1.1.1

  Area 0.0.0.0 interface 1.1.1.1(GigabitEthernet1/0/0)'s BFD Sessions

 NeighborId:3.3.3.3          AreaId:0.0.0.0          Interface:GigabitEthernet1/0/0

 BFDState:up                 rx    :500             tx       :500

 Multiplier:4                BFD Local Dis:8195      LocalIpAdd:1.1.1.1

 RemoteIpAdd:1.1.1.2         Diagnostic Info:No diagnostic information

  Area 0.0.0.0 interface 3.3.3.1(GigabitEthernet2/0/0)'s BFD Sessions

 NeighborId:2.2.2.2          AreaId:0.0.0.0          Interface:GigabitEthernet2/0/0

 BFDState:up                 rx    :500             tx       :500

 Multiplier:4                BFD Local Dis:8194      LocalIpAdd:3.3.3.1

 RemoteIpAdd:3.3.3.2         Diagnostic Info:No diagnostic information

可以看到,BFDState的状态为Up。

  1. 检查配置结果

# 对RouterB的GE2/0/0接口执行shutdown命令,模拟主链路故障。

[RouterB] interface gigabitethernet 2/0/0

[RouterB-GigabitEthernet2/0/0] shutdown

# 查看RouterA的路由表。

<RouterA> display ospf routing

          OSPF Process 1 with Router ID 1.1.1.1

                   Routing Tables

 Routing for Network

 Destination        Cost  Type       NextHop         AdvRouter       Area

 172.16.1.0/24      2     Stub       1.1.1.2         2.2.2.2         0.0.0.0

 3.3.3.3/24         1     Stub       3.3.3.1         1.1.1.1         0.0.0.0

 2.2.2.2/24         2     Transit    1.1.1.2         3.3.3.3         0.0.0.0

 1.1.1.1/24         1     Transit    1.1.1.1         1.1.1.1         0.0.0.0

 Total Nets: 4

 Intra Area: 4  Inter Area: 0  ASE: 0  NSSA: 0

可以看出,在主链路故障后,业务流量切换到备份链路RouterA→RouterC→RouterB,去往172.16.1.0/24的路由下一跳地址为1.1.1.2。

配置文件

RouterA的配置文件

#

  sysname RouterA

#

 router id 1.1.1.1

#

 bfd

#

interface GigabitEthernet1/0/0

 undo shutdown

 ip address 1.1.1.1 255.255.255.0

#

ospf 1

 bfd all-interface enable

 bfd all-interface min-tx-interval 500 min-rx-interval 500 detect-multiplier 4

 area 0.0.0.0

  network 3.3.3.3 0.0.0.255

  network 1.1.1.1 0.0.0.255

#

return

RouterB的配置文件

#

  sysname RouterB

#

 router id 2.2.2.2

#

 bfd

#

 interface GigabitEthernet1/0/0

 undo shutdown

 ip address 2.2.2.2 255.255.255.0

#

interface GigabitEthernet3/0/0

 undo shutdown

 ip address 172.16.1.1 255.255.255.0

#

ospf 1

 bfd all-interface enable

 bfd all-interface min-tx-interval 500 min-rx-interval 500 detect-multiplier 4

 area 0.0.0.0

  network 3.3.3.3 0.0.0.255

  network 2.2.2.2 0.0.0.255

  network 172.16.1.0 0.0.0.255

#

return

RouterC的配置文件

#

  sysname RouterC

#

 router id 3.3.3.3

#

 bfd

#

 interface GigabitEthernet1/0/0

 undo shutdown

 ip address 1.1.1.2 255.255.255.0

#

interface GigabitEthernet2/0/0

 undo shutdown

 ip address 2.2.2.1 255.255.255.0

 #

ospf 1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.255

  network 2.2.2.2 0.0.0.255

#

return

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

精彩网络技术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值