BGP路由反射器

由于水平分割,单个AS中除了实现IBGP全互联,否则无法使所有IBGP路由器学习到完整的BGP路由

两种角色  RR 路由反射器  Client  RR客户端

RR会将学习到的路由反射出去,从而使得IBGP路由在AS内传播无需简历IBGP全互联

指定RR的同时需要指定其Client

路由反射规则

从自己非Client对等体学到的IBGP路由,会反射给所有客户

从自己Client对等体学到的IBGP路由转发给所有人

反射时只将自己使用的最优BGP路由进行反射

RR防环

RR设定使得IBGP水平分割原则失败,导致环路产生,所以RR会为BGP路由添加两个特殊的路劲的属性来避免出现环路

Originator_ID

Cluster_List

可选非过度类型

Originator_ID

RR将一条BGP路由进行反射时,会在反射出去的路由中增加Originator_ID,其值为本地AS中通告该路由的BGP的路由器Router ID

有多个RR时,Originator_ID为第一个RR创建,因为只有一个RR会对该路由信息进行处理,当BGP路由器收到带有自己Router ID的路由时,会忽略关于该路由的更新

Cluster_List

路由反射簇包括反射器RR及其Client,一个AS允许存在多个路由反射簇

每一个簇有唯一的簇ID 缺省为Router ID

每当RR反射路由时就会将自己的簇ID添加进去

R1为R2的client R2为R3client R3为R4的client

[R2]bgp 64511

[R2-bgp] peer 10.0.12.1 reflect-client

[R3]bgp 64511

[R3-bgp] peer 10.0.23.2 reflect-client

[R4]bgp 64511

[R4-bgp] peer 10.0.34.3 reflect-client

验证  Orginator_ID  防环

缺省情况下,R2 发布 BGP 路由后,该路由将被 R2 直接通告给 R4,另一方面也会通过 R3 反 射给 R4,此时 R4 将优选 R2 直接通告过来的路由,从而不会再将 R3 反射过来的路由再反射回给 R2。因此,我们需要在 R2 上部署路由策略,使 R2 不直接向 R4 通告 10.2.2.0/24 路由。

[R2]acl number 2000

[R2-acl-basic-2000] rule 5 permit

[R2-acl-basic-2000] quit

[R2]route-policy bgp deny node 10

[R2-route-policy] if-match acl 2000

[R2]bgp 64511

[R2-bgp] peer 10.0.24.4 route-policy bgp export

通告网络

[R2]bgp 64511

[R2-bgp]network 10.2.2.0 24

[R2]display bgp routing-table 10.2.2.0


 BGP local router ID : 10.0.2.2

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.2.2.0/24:

 Network route.

 From: 0.0.0.0 (0.0.0.0)

 Route Duration: 00h00m32s 

 Direct Out-interface: LoopBack1

 Original nexthop: 10.2.2.2

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, pref-val 0, valid, local, best, select, pre 0

 Advertised to such 2 peers:   只通告给了R3 R1

    10.0.23.3

    10.0.12.1



[R3]display bgp  routing-table 10.2.2.0


 BGP local router ID : 10.0.3.3

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.2.2.0/24:

 RR-client route.

 From: 10.0.23.2 (10.0.2.2)

 Route Duration: 00h02m00s 

 Relay IP Nexthop: 0.0.0.0

 Relay IP Out-Interface: GigabitEthernet0/0/0

 Original nexthop: 10.0.23.2

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes

t, select, active, pre 255

 Advertised to such 1 peers:   反射器 转发出去

    10.0.34.4



[R4]display bgp routing-table 10.2.2.0


 BGP local router ID : 10.0.4.4

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.2.2.0/24:

 RR-client route.

 From: 10.0.34.3 (10.0.3.3)

 Route Duration: 00h02m43s 

 Relay IP Nexthop: 10.0.24.2

 Relay IP Out-Interface: GigabitEthernet0/0/1

 Original nexthop: 10.0.23.2

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes

t, select, active, pre 255, IGP cost 2

 Originator:  10.0.2.2

 Cluster list: 10.0.3.3

 Advertised to such 1 peers:   反射器往外转发

    10.0.24.2

但是R2并没有响应 Orginator_ID 属性值与本地的 Router ID 一致,R2 忽略了该路由通告

[R2]display bgp peer 10.0.24.4 verbose

BGP Peer is 10.0.24.4,  remote AS 64511 

Type: IBGP link

BGP version 4, Remote router ID 10.0.4.4

Update-group ID: 2 

BGP current state: Established, Up for 00h17m04s

BGP current event: RecvKeepalive

BGP last state: OpenConfirm

BGP Peer Up count: 1


 Received: Total 20 messages

 Update messages                 1

 Open messages                         1

 KeepAlive messages                 18

 Notification messages          0

 Refresh messages                 0

 Sent: Total 21 messages

 Update messages                 0

 Open messages                         3

 KeepAlive messages                 18

 Notification messages          0

 Refresh messages                 0

验证 Cluster_List 防环

取消 R2的路由发布 通过R1进行路由发布

[R1]bgp 64511

[R1-bgp]network 10.1.1.0 24

[R1]display bgp routing-table 10.1.1.0 24


 BGP local router ID : 10.0.1.1

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.1.1.0/24:

 Network route.

 From: 0.0.0.0 (0.0.0.0)

 Route Duration: 00h00m39s 

 Direct Out-interface: LoopBack1

 Original nexthop: 10.1.1.1

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, pref-val 0, valid, local, best, select, pre 0

 Advertised to such 1 peers:

    10.0.12.2



[R2]display bgp routing-table 10.1.1.0


 BGP local router ID : 10.0.2.2

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.1.1.0/24:

 RR-client route.

 From: 10.0.12.1 (10.0.1.1)

 Route Duration: 00h01m26s 

 Relay IP Nexthop: 0.0.0.0

 Relay IP Out-Interface: GigabitEthernet0/0/0

 Original nexthop: 10.0.12.1

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes

t, select, active, pre 255

 Advertised to such 1 peers:   开始反射

    10.0.23.3



[R3]display bgp routing-table 10.1.1.0


 BGP local router ID : 10.0.3.3

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.1.1.0/24:

 RR-client route.

 From: 10.0.23.2 (10.0.2.2)

 Route Duration: 00h02m13s 

 Relay IP Nexthop: 10.0.23.2

 Relay IP Out-Interface: GigabitEthernet0/0/0

 Original nexthop: 10.0.12.1

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes

t, select, active, pre 255, IGP cost 2

 Originator:  10.0.1.1

 Cluster list: 10.0.2.2

 Advertised to such 1 peers:

    10.0.34.4



[R4]display bgp routing-table 10.1.1.0


 BGP local router ID : 10.0.4.4

 Local AS number : 64511

 Paths:   1 available, 1 best, 1 select

 BGP routing table entry information of 10.1.1.0/24:

 RR-client route.

 From: 10.0.34.3 (10.0.3.3)

 Route Duration: 00h02m43s 

 Relay IP Nexthop: 10.0.24.2

 Relay IP Out-Interface: GigabitEthernet0/0/1

 Original nexthop: 10.0.12.1

 Qos information : 0x0

 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes

t, select, active, pre 255, IGP cost 2

 Originator:  10.0.1.1

 Cluster list: 10.0.3.3, 10.0.2.2

 Advertised to such 1 peers:

    10.0.24.2   但是R2并没有响应

 

### BGP 路由反射器工作原理 BGP 路由反射器(Route Reflector, RR)是一种用于解决 IBGP 网络扩展性问题的技术。在传统的 IBGP 部署中,IBGP 对等体之间需要全网状连接才能交换路由信息,这会随着网络规模的增长显著增加配置复杂性和资源消耗。通过引入路由反射器,可以减少这种全网状连接的需求。 #### 基本概念 - **客户机(Client)**:与路由反射器建立邻居关系的路由器被称为客户机。 - **非客户机(Non-client)**:未与路由反射器建立邻居关系的 IBGP 路由器称为非客户机。 - **群组(Cluster)**:一组具有相同路由反射器的客户机构成一个群组。 当某个客户机接收到一条路由更新时,它不会向其他客户机传播该路由;相反,路由反射器负责接收并重新发布这些路由给其所有的客户机和其他非客户机[^2]。 --- ### BGP 路由反射器配置方法 以下是基于华为设备的 BGP 路由反射器配置教程: #### 1. 启用 BGP 协议 首先,在所有参与的路由器上启用 BGP 并设置 AS 号: ```shell bgp as-number router-id router-id-address ``` #### 2. 定义路由反射器角色 在路由反射器上定义哪些邻居是客户机: ```shell peer ip-address group-name rr-filter peer-ip filter-policy-name inbound/outbound undo reflect-between-clients # 如果不希望客户机间互相反射,则取消此命令 ``` #### 3. 设置路由策略(可选) 如果需要对特定类型的路由应用过滤或修改操作,可以通过 `route-policy` 实现: ```shell route-policy policy-name permit/deny node-number if-match condition apply action quit ``` 其中,条件和动作可以根据实际需求调整,例如匹配前缀列表、社区属性或其他参数[^1]。 #### 4. 测试与验证 完成配置后,可通过以下命令检查状态: ```shell display bgp routing-table display bgp peer debugging bgp all ``` 上述步骤能够帮助工程师快速部署功能完备的 BGP 路由反射环境,并有效降低大规模 IBGP 网络中的管理负担。 --- ### 注意事项 - 路由反射器不应随意更改默认行为,尤其是涉及跨自治系统的场景下,需谨慎处理 LOCAL_PREF 和 MED 的传递规则。 - 在多层嵌套结构中,合理规划 Cluster-ID 参数以防止环路发生。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值