配置BGP RPD示例

学习精彩网络技术老师:华为HCIA和HCIP数通eNSP实战视频课

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

配置BGP RPD可以实现路由策略的动态下发。

组网需求

在城域入口或IGW场景下,当链路资源利用不均匀或链路故障导致局部流量路径拥塞时,为使用户充分利用网络带宽,可部署入方向流量调优方案,指定流量调优方案,影响路由优先级,将流量引导至空闲链路。此时,NE作为转发设备,需要部署RPD特性。

图1所示,所有NE都配置BGP,DeviceA和DeviceB在AS 100中,DeviceC在AS 200中,NCE在AS 300中。此时来自AS 200 DeviceC发送至目的地址为192.168.1.0的流量可以从DeviceA和DeviceB进入AS 100。若经NCE分析后,发现DeviceA和DeviceC间的流量路径拥堵,可以配置调流策略并下发RPD路由控制流量进入AS 100的入口设备为DeviceB,即流量路径改为DeviceC到DeviceB。

图1 配置BGP RPD组网图

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

配置注意事项

配置思路

采用如下的思路配置BGP RPD,配套NCE完成流量调优:

在DeviceA和DeviceC、DeviceB和DeviceC之间配置EBGP连接。

在DeviceA和DeviceB上部署RPD,分别和NCE建立RPD邻居。

在DeviceA,DeviceB和DeviceC配置IPv4单播,即DeviceA和DeviceC、DeviceB和DeviceC互为IPv4单播邻居。

以下只给出本设备需要配置的内容和步骤,NCE的相关内容如BGP配置、RPD地址族配置、调流策略配置等不做详细描述,具体请参见NCE手册的相关描述。

数据准备

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

  • DeviceA、DeviceB的Router ID分别为4.1.1.1、2.2.2.2,所在AS号为100。
  • DeviceC的Router ID为3.3.3.3,所在AS号为200。
操作步骤
  1. 配置各接口的IP地址(略),具体配置过程请参考配置文件。
  2. 配置BGP连接。

# 配置DeviceA。

[~DeviceA] bgp 100

[*DeviceA-bgp] router-id 4.1.1.1

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

[*DeviceB-bgp] peer 1.1.1.1 as-number 300

[*DeviceA-bgp] ipv4-family unicast

[*DeviceA-bgp-af-ipv4] network 192.168.1.0 255.255.255.0

[*DeviceA-bgp-af-ipv4] commit

[~DeviceA-bgp-af-ipv4] quit

[~DeviceA-bgp] quit

# 配置DeviceB。

[~DeviceB] bgp 100

[*DeviceB-bgp] router-id 2.2.2.2

[*DeviceB-bgp] peer 10.3.1.2 as-number 200

[*DeviceB-bgp] peer 2.1.1.1 as-number 300

[*DeviceB-bgp] ipv4-family unicast

[*DeviceB-bgp-af-ipv4] network 192.168.1.0 255.255.255.0

[*DeviceB-bgp-af-ipv4] commit

[~DeviceB-bgp-af-ipv4] quit

[~DeviceB-bgp] quit

# 配置DeviceC。

[~DeviceC] bgp 200

[*DeviceC-bgp] router-id 3.3.3.3

[*DeviceC-bgp] peer 10.2.1.1 as-number 100

[*DeviceC-bgp] peer 10.3.1.1 as-number 100

[*DeviceC-bgp] ipv4-family unicast

[*DeviceC-bgp-af-ipv4] commit

[~DeviceC-bgp-af-ipv4] quit

[~DeviceC-bgp] quit

# 查看DeviceC的路由表。

[~DeviceC] display bgp routing-table 192.168.1.0 24

 BGP local router ID : 3.3.3.3

 Local AS number : 200

 Paths:   2 available, 1 best, 1 select

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.2.1.1 (1.1.1.1)

 Route Duration: 0d00h00m56s

 Direct Out-interface: GigabitEthernet0/1/0

 Original nexthop: 10.2.1.1

 Qos information : 0x0

 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, best, select, pre 255

 Advertised to such 2 peers:

    10.2.1.1

    10.3.1.1

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.3.1.1 (2.2.2.2)

 Route Duration: 0d00h00m06s

 Direct Out-interface: GigabitEthernet0/1/1

 Original nexthop: 10.3.1.1

 Qos information : 0x0

 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, pre 255, not preferred for router ID

 Not advertised to any peers yet

从路由表中可以看出,到目的地址192.168.1.0/24有两条有效路由,其中下一跳为10.2.1.1的路由是最优路由(因为DeviceA的Router ID要小一些),即流量路径优选从DeviceA流入AS 100。

  1. 配置BGP RPD属性,本设备接收NCE下发的RPD路由并执行对应的路由策略。

# 配置DeviceA。

[~DeviceA] bgp 100

[*DeviceA-bgp] peer 1.1.1.1 as-number 300

[*DeviceA-bgp] rpd-family

[*DeviceA-bgp-af-rpd] peer 1.1.1.1 enable

[*DeviceA-bgp-af-rpd] quit

[*DeviceA-bgp] ipv4-family unicast

[*DeviceA-bgp-af-ipv4] peer 10.2.1.2 rpd-policy export enable

[*DeviceA-bgp-af-ipv4] commit

[~DeviceA-bgp-af-ipv4] quit

[~DeviceA-bgp] quit

# 配置DeviceB。

[~DeviceB] bgp 100

[*DeviceB-bgp] peer 2.1.1.1 as-number 300

[*DeviceB-bgp] rpd-family

[*DeviceB-bgp-af-rpd] peer 2.1.1.1 enable

[*DeviceB-bgp-af-rpd] quit

[*DeviceB-bgp] ipv4-family unicast

[*DeviceB-bgp-af-ipv4] peer 10.3.1.2 rpd-policy export enable

[*DeviceB-bgp-af-ipv4] commit

[~DeviceB-bgp-af-ipv4] quit

[~DeviceB-bgp] quit

# 查看DeviceA的RPD路由信息。

[~DeviceA] display bgp rpd routing-table

 Total number of Routes : 1

 BGP Local router ID is 4.1.1.1

 Status codes: * - valid, > - best, d - damped, x - best external, a - add path,

               h - history,  i - internal, s - suppressed, S - Stale

               Origin : i - IGP, e - EGP, ? - incomplete

        Network                        Peer           MED        LocPrf    PrefVal Path/Ogn

 *>     1/10.2.1.2/1                   1.1.1.1        50                   0       100?

# 查看DeviceC的路由表。

[~DeviceC] display bgp routing-table 192.168.1.0 24

 BGP local router ID : 3.3.3.3

 Local AS number : 200

 Paths:   2 available, 1 best, 1 select

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.2.1.1 (1.1.1.1)

 Route Duration: 0d00h00m56s

 Direct Out-interface: GigabitEthernet0/1/0

 Original nexthop: 10.2.1.1

 Qos information : 0x0

 AS-path 100, origin igp, MED 50, pref-val 0, valid, external, best, select, pre 255

 Advertised to such 2 peers:

    10.2.1.1

    10.3.1.1

 BGP routing table entry information of 192.168.1.0/24:

 From: 10.3.1.1 (2.2.2.2)

 Route Duration: 0d00h00m06s

 Direct Out-interface: GigabitEthernet0/1/1

 Original nexthop: 10.3.1.1

 Qos information : 0x0

 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, pre 255, not preferred for router ID

 Not advertised to any peers yet

从路由表中可以看出,由于下一跳为10.2.1.1(DeviceA)的路由MED值为50,下一跳为10.3.1.1(DeviceB)的路由MED值为0,则DeviceB到DeviceC路由优先级高,从而控制流量路径选择DeviceC到DeviceB,避开拥堵路径。

配置文件

DeviceA的配置文件

#

sysname DeviceA

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.2.1.1 255.255.255.0

#

interface GigabitEthernet0/1/1

 undo shutdown

 ip address 1.1.1.2 255.255.255.0

#

bgp 100

 router-id 1.1.1.1

 peer 1.1.1.1 as-number 300

 peer 10.2.1.2 as-number 200

 #

 ipv4-family unicast

  network 192.168.1.0 255.255.255.0

  peer 10.2.1.2 enable

  peer 10.2.1.2 rpd-policy export enable

 #

 rpd-family

  peer 1.1.1.1 enable

#

return

DeviceB的配置文件

#

sysname DeviceB

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.3.1.1 255.255.255.0

#

interface GigabitEthernet0/1/1

 undo shutdown

 ip address 2.1.1.2 255.255.255.0

#

bgp 100

 router-id 2.2.2.2

 peer 2.1.1.1 as-number 300

 peer 10.3.1.2 as-number 200

 #

 ipv4-family unicast

  network 192.168.1.0 255.255.255.0

  peer 10.3.1.2 enable

  peer 10.3.1.2 rpd-policy export enable

 #

 rpd-family

  peer 2.1.1.1 enable

#

return

DeviceC的配置文件

#

sysname DeviceC

#

interface GigabitEthernet0/1/0

 undo shutdown

 ip address 10.2.1.2 255.255.255.0

#

interface GigabitEthernet0/1/1

 undo shutdown

 ip address 10.3.1.2 255.255.255.0

#

bgp 200

 router-id 3.3.3.3

 peer 10.2.1.1 as-number 100

 peer 10.3.1.1 as-number 100

 #

 ipv4-family unicast

  peer 10.2.1.1 enable

  peer 10.3.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、付费专栏及课程。

余额充值