配置BGP Auto FRR功能示例

学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战视频课
学习精彩网络技术老师:华为、华三、锐捷、WLAN、IPv6等全套视频课程

配置BGP Auto FRR功能,可以为路由备份转发信息,减少关键业务的延时。

组网需求

随着网络的不断发展,语音、在线视频和金融等业务对实时性的要求越来越高。通常情况下,在网络部署时会使用主备链路来保障这些业务的稳定性。但是传统的主备链路切换必须等待路由收敛完成,重新优选路由并且下发FIB表后才能完成,在这个过程中,业务中断时间较长,不能满足业务的要求。

为了解决这个问题,BGP Auto FRR应运而生。BGP Auto FRR利用最优路由作转发,自动将次优路由的转发信息添加到最优路由的备份转发表项中,并下发到FIB表。当主链路出现故障的时候,系统快速将转发路径切换到备份链路上。这个过程不依赖于路由的收敛,所以业务中断时间非常短,可以达到亚秒级。

图1所示,DeviceA位于AS100内,DeviceB、DeviceC、DeviceD位于AS200内。通过配置BGP Auto FRR功能,使得DeviceA到DeviceD的路由有备份转发信息,提高网络可靠性。

图1 配置BGP Auto FRR组网图

本例中interface1,interface2,interface3分别代表GE0/1/0,GE0/2/0,Loopback1。

配置注意事项

在配置过程中,需注意以下事项:

配置BGP FRR时,到达同一目的网段至少需要两条路由。

引用路由策略时,需注意区分策略名称的大小写。

配置思路

采用如下的思路配置BGP Auto FRR功能:

DeviceA与DeviceB和DeviceC之间配置EBGP连接。DeviceD与DeviceB和DeviceC之间配置IBGP连接。

在DeviceB、DeviceC上配置路由策略,改变到DeviceD的路由MED值,以便优选路由。

在DeviceA上配置BGP Auto FRR功能。

数据准备

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

DeviceA、DeviceB、DeviceC、DeviceD的Router ID和所在的AS号。

DeviceB、DeviceC上的路由策略名及路由MED值。

操作步骤
  1. 配置各接口的IP地址(略)。
  2. DeviceA与DeviceB和DeviceC之间配置EBGP连接;DeviceD与DeviceB和DeviceC之间配置IBGP连接

# 在DeviceA上配置EBGP连接。

<DeviceA> system-view

[~DeviceA] bgp 100

[*DeviceA-bgp] router-id 1.1.1.1

[*DeviceA-bgp] peer 10.1.1.2 as-number 200

[*DeviceA-bgp] peer 10.2.1.2 as-number 200

[*DeviceA-bgp] commit

DeviceB、DeviceC上的配置与DeviceA一致,在此不再赘述。

# 在DeviceD上配置IBGP连接。

<DeviceD> system-view

[~DeviceD] bgp 200

[*DeviceD-bgp] router-id 4.4.4.4

[*DeviceD-bgp] peer 10.3.1.1 as-number 200

[*DeviceD-bgp] peer 10.4.1.1 as-number 200

[*DeviceD-bgp] commit

DeviceB、DeviceC上的配置与DeviceD一致,在此不再赘述。

  1. 在DeviceA、DeviceB、DeviceC和DeviceD上配置BFD for BGP

# 在DeviceA上配置BFD for BGP。

<DeviceA> system-view

[~DeviceA] bfd

[*DeviceA-bfd] quit

[*DeviceA] bgp 100

[*DeviceA-bgp] peer 10.1.1.2 bfd enable

[*DeviceA-bgp] peer 10.1.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

[*DeviceA-bgp] peer 10.2.1.2 bfd enable

[*DeviceA-bgp] peer 10.2.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

[*DeviceA-bgp] commit

[~DeviceA-bgp] quit

[~DeviceA] quit

DeviceB、DeviceC、DeviceD上的配置与DeviceA一致,在此不再赘述。

  1. DeviceB、DeviceC上配置路由策略,使到DeviceD的路由有不同的MED值

# DeviceB上配置路由策略。

<DeviceB> system-view

[~DeviceB] route-policy rtb permit node 10

[*DeviceB-route-policy] apply cost 80

[*DeviceB-route-policy] quit

[*DeviceB] bgp 200

[*DeviceB-bgp] ipv4-family unicast

[*DeviceB-bgp-af-ipv4] peer 10.1.1.1 route-policy rtb export

[*DeviceB-bgp-af-ipv4] commit

[~DeviceB-bgp-af-ipv4] quit

# DeviceC上配置路由策略。

<DeviceC> system-view

[~DeviceC] route-policy rtc permit node 10

[*DeviceC-route-policy] apply cost 120

[*DeviceC-route-policy] quit

[*DeviceC] bgp 200

[*DeviceC-bgp] ipv4-family unicast

[*DeviceC-bgp-af-ipv4] peer 10.2.1.1 route-policy rtc export

[*DeviceC-bgp-af-ipv4] commit

[~DeviceC-bgp-af-ipv4] quit

# 在DeviceD上发布一条到4.4.4.4/32的路由。

[~DeviceD] bgp 200

[*DeviceD-bgp] ipv4-family unicast

[*DeviceD-bgp] network 4.4.4.4 32

[*DeviceD-bgp] commit

# DeviceA上执行display ip routing-table verbose命令查看DeviceA学到的4.4.4.4/32路由的详细信息。

<DeviceA> display ip routing-table 4.4.4.4 32 verboseRoute Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route

------------------------------------------------------------------------------

Routing Table : _public_

Summary Count : 1

Destination: 4.4.4.4/32

     Protocol: EBGP            Process ID: 0

   Preference: 255                   Cost: 80

      NextHop: 10.1.1.2         Neighbour: 10.1.1.2

        State: Active Adv             Age: 00h00m12s

          Tag: 0                 Priority: low

        Label: NULL               QoSInfo: 0x0

   IndirectID: 0x4

 RelayNextHop: 0.0.0.0          Interface: GigabitEthernet0/1/0

     TunnelID: 0x0                  Flags:  D

因为从DeviceB学来的路由MED值较小,所以DeviceA上到4.4.4.4/32的路由优选了路径RouerA→DeviceB→DeviceD。因为没有配置FRR功能,所以没有备份转发信息。

  1. DeviceA上使能BGP Auto FRR,并查看路由信息。

# DeviceA上使能BGP Auto FRR:

<DeviceA> system-view

[~DeviceA] bgp 100

[*DeviceA-bgp] ipv4-family unicast

[*DeviceA-bgp-af-ipv4] auto-frr

[*DeviceA-bgp-af-ipv4] commit

[~DeviceA-bgp-af-ipv4] quit

# 配置完成后,在DeviceA上执行命令display ip routing-table verbose查看路由信息。

<DeviceA> display ip routing-table 4.4.4.4 32 verboseRoute Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route

------------------------------------------------------------------------------

Routing Table : _public_

Summary Count : 1

Destination: 4.4.4.4/32

     Protocol: EBGP            Process ID: 0

   Preference: 255                   Cost: 80

      NextHop: 10.1.1.2         Neighbour: 10.1.1.2

        State: Active Adv             Age: 00h52m45s

          Tag: 0                 Priority: low

        Label: NULL               QoSInfo: 0x0

   IndirectID: 0x4

 RelayNextHop: 0.0.0.0          Interface: GigabitEthernet0/1/0

     TunnelID: 0x0                  Flags:  D

    BkNextHop: 10.2.1.2       BkInterface: GigabitEthernet0/2/0

      BkLabel: NULL           SecTunnelID: 0x0

 BkPETunnelID: 0x0        BkPESecTunnelID: 0x0

 BkIndirectID: 0x2  

从显示信息可以知道,DeviceA上有到4.4.4.4/32的备份下一跳和备份出接口。

配置文件

Device的配置文件:

#

sysname DeviceA

#

bfd

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.1.1.1 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.2.1.1 255.255.255.0

#

bgp 100

 router-id 1.1.1.1

 peer 10.1.1.2 as-number 200

 peer 10.1.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.1.1.2 bfd enable

 peer 10.2.1.2 as-number 200

 peer 10.2.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.2.1.2 bfd enable

#

 ipv4-family unicast

  undo synchronization

  auto-frr

  peer 10.1.1.2 enable

  peer 10.2.1.2 enable

#

return

DeviceB的配置文件

#

sysname DeviceB

#

bfd

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.1.1.2 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.3.1.1 255.255.255.0

#

bgp 200

 router-id 2.2.2.2

 peer 10.1.1.1 as-number 100

 peer 10.1.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.1.1.1 bfd enable

 peer 10.3.1.2 as-number 200

 peer 10.3.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.3.1.2 bfd enable

#

 ipv4-family unicast

  undo synchronization

  peer 10.1.1.1 route-policy rtb export

  peer 10.1.1.1 enable

  peer 10.3.1.2 enable

#

route-policy rtb permit node 10

 apply cost 80

#

return

DeviceC的配置文件

#

sysname DeviceC

#

bfd

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.2.1.2 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.4.1.1 255.255.255.0

#

bgp 200

 router-id 3.3.3.3

 peer 10.2.1.1 as-number 100

 peer 10.2.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.2.1.1 bfd enable

 peer 10.4.1.2 as-number 200

 peer 10.4.1.2 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.4.1.2 bfd enable

 #

 ipv4-family unicast

  undo synchronization

  peer 10.2.1.1 route-policy rtc export

  peer 10.2.1.1 enable

  peer 10.4.1.2 enable

#

route-policy rtc permit node 10

 apply cost 120

#

return

DeviceD的配置文件

#

sysname DeviceD

#

bfd

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.3.1.2 255.255.255.0

#

interface GigabitEthernet0/2/0

 undo shutdown

 ip address 10.4.1.2 255.255.255.0

#

interface LoopBack1

 ip address 4.4.4.4 255.255.255.255

#

bgp 200

 router-id 4.4.4.4

 peer 10.3.1.1 as-number 200

 peer 10.3.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.3.1.1 bfd enable

 peer 10.4.1.1 as-number 200

 peer 10.4.1.1 bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4

 peer 10.4.1.1 bfd enable

 #

 ipv4-family unicast

  undo synchronization

  network 4.4.4.4 255.255.255.255

  peer 10.3.1.1 enable

  peer 10.4.1.1 enable

#

return

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

精彩网络技术

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

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

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

打赏作者

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

抵扣说明:

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

余额充值