BGP Aggregation – Summary Only

简介:

【实验说明】

在AS2上配置汇聚路由,使得AS1上的路由器只学习到( 10.0.0.0/16, 10.1.0.0/16, 10.2.0.0/16, and 10.3.0.0/16  网络)的汇聚路由,而不包括被汇聚的源明细路由。

 
【实验拓扑】

 

【实验配置步骤】
  • 按照上图配置各个设备的接口地址
  • 在 R1, R3, R4, R5 上配置BGP
  • R1 与 R3 and R4 建立邻居对等体
  • R5 与 R3 and R4 建立邻居对等体
  • 通告 R5与R4上的loopback0 地址到BGP
  • 通告R1 上的Loopback地址 BGP
  • 通告R2 上的Loopback地址 BGP
  • 在R1与R3上配置BGP 汇聚路由,汇聚R1与R3的loopback地址,并且使用summary-only参数

 
【实验分析】
使用aggregate-address对路由进行汇聚时,如果不加入summary-only参数,邻居路由器不仅仅收到汇聚后的路由,而且会收到被汇聚的源明细路由,本实验正是验证加入summary-only之后,邻居将不会学习到被汇聚的源明细路由。

 
【实验基本配置】
R1:
interface Loopback0
ip address 10.0.0.1 255.255.0.0
!
interface Loopback1
ip address 10.1.0.1 255.255.0.0
!
interface FastEthernet0/0
ip address 155.1.146.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
ip address 155.1.13.1 255.255.255.0
clock rate 2000000
!
router bgp 2
network 10.0.0.0 mask 255.255.0.0
network 10.1.0.0 mask 255.255.0.0
aggregate-address 10.0.0.0 255.252.0.0 summary-only
neighbor 155.1.13.3 remote-as 2
neighbor 155.1.13.3 next-hop-self
neighbor 155.1.146.4 remote-as 1
R3:
interface Loopback0
ip address 10.2.0.1 255.255.0.0
!
interface Loopback1
ip address 10.3.0.1 255.255.0.0
!
interface Serial0/0
ip address 155.1.0.3 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.5 305 broadcast
no frame-relay inverse-arp
!
interface Serial0/1
ip address 155.1.13.3 255.255.255.0
clock rate 64000
!
router bgp 2
network 10.2.0.0 mask 255.255.0.0
network 10.3.0.0 mask 255.255.0.0
aggregate-address 10.0.0.0 255.252.0.0 summary-only
neighbor 155.1.13.1 remote-as 2
neighbor 155.1.13.1 next-hop-self
neighbor 155.1.0.5 remote-as 1

R4:
interface Loopback0
ip address 204.12.1.4 255.255.255.0
!
interface FastEthernet0/0
ip address 155.1.146.4 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
ip address 155.1.45.4 255.255.255.0
clock rate 2000000
!
router bgp 1
network 204.12.1.0
neighbor 155.1.45.5 remote-as 1
neighbor 155.1.146.1 remote-as 2
neighbor 155.1.45.5 next-hop-self

 
R5:
interface Loopback0
ip address 155.1.5.5 255.255.255.0
!
interface Serial0/1
ip address 155.1.45.5 255.255.255.0
clock rate 64000
!
interface Serial0/0
ip address 155.1.0.5 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 155.1.0.3 503 broadcast
no frame-relay inverse-arp
!
router bgp 1
network 155.1.5.0 mask 255.255.255.0
neighbor 155.1.45.4 remote-as 1
neighbor 155.1.0.3 remote-as 2
neighbor 155.1.45.4 next-hop-self
【实验验证】

 

在R1与R3上未配置 aggregate-address 10.0.0.0 255.252.0.0 summary-only 之前,我们发现R4与R5上学习到的路由中包括所有明细路由,正如下面输出结果

-----------------------------------------------------------------------------------------------------
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 155.1.146.1 0 0 2 i
*> 10.1.0.0/16 155.1.146.1 0 0 2 i
*> 10.2.0.0/16 155.1.146.1 0 2 i
*> 10.3.0.0/16 155.1.146.1 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i

R5#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
* i10.0.0.0/16 155.1.146.1 0 100 0 2 i
* i10.1.0.0/16 155.1.146.1 0 100 0 2 i
* i10.2.0.0/16 155.1.146.1 0 100 0 2 i
* i10.3.0.0/16 155.1.146.1 0 100 0 2 i
*> 155.1.5.0/24 0.0.0.0 0 32768 i
*>i204.12.1.0 155.1.45.4 0 100 0 i
R1(config-router)#do show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 0.0.0.0 0 32768 i
*> 10.1.0.0/16 0.0.0.0 0 32768 i
*>i10.2.0.0/16 155.1.13.3 0 100 0 i
*>i10.3.0.0/16 155.1.13.3 0 100 0 i
*> 155.1.5.0/24 155.1.146.4 0 1 i
*> 204.12.1.0 155.1.146.4 0 0 1 i

R3(config-router)#do show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*>i10.0.0.0/16 155.1.13.1 0 100 0 i
*>i10.1.0.0/16 155.1.13.1 0 100 0 i
*> 10.2.0.0/16 0.0.0.0 0 32768 i
*> 10.3.0.0/16 0.0.0.0 0 32768 i
* i155.1.5.0/24 155.1.146.4 0 100 0 1 i
* i204.12.1.0 155.1.146.4 0 100 0 1 i

 

 

 
在R1与R3上配置 aggregate-address 10.0.0.0 255.252.0.0 但是不加如 summary-only 参数之后,我们看到所有路由器不仅学习到了汇聚路由,而且学习到了明细路由,如下面输出结果:
-------------------------------------------------------------------------------------------------------------------------
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 155.1.146.1 0 0 2 i
*> 10.0.0.0/14 155.1.146.1 0 0 2 i
*> 10.1.0.0/16 155.1.146.1 0 0 2 i
*> 10.2.0.0/16 155.1.146.1 0 2 i
*> 10.3.0.0/16 155.1.146.1 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i
R5#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
* >  i10.0.0.0/16 155.1.146.1 0 100 0 2 i
* >  i10.0.0.0/14 155.1.146.1 0 100 0 2 i
* >  i10.1.0.0/16 155.1.146.1 0 100 0 2 i
* >  i10.2.0.0/16 155.1.146.1 0 100 0 2 i
* >  i10.3.0.0/16 155.1.146.1 0 100 0 2 i
*> 155.1.5.0/24 0.0.0.0 0 32768 i
*>i204.12.1.0 155.1.45.4 0 100 0 i
R1(config-router)#do show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 0.0.0.0 0 32768 i
*>i10.0.0.0/14 155.1.13.3 0 100 0 i
*> 0.0.0.0 32768 i
*> 10.1.0.0/16 0.0.0.0 0 32768 i
*>i10.2.0.0/16 155.1.13.3 0 100 0 i
*>i10.3.0.0/16 155.1.13.3 0 100 0 i
*> 155.1.5.0/24 155.1.146.4 0 1 i
*> 204.12.1.0 155.1.146.4 0 0 1 i
R3(config-router)#do show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*>i10.0.0.0/16 155.1.13.1 0 100 0 i
*> 10.0.0.0/14 0.0.0.0 32768 i
* i 155.1.13.1 0 100 0 i
*>i10.1.0.0/16 155.1.13.1 0 100 0 i
*> 10.2.0.0/16 0.0.0.0 0 32768 i
*> 10.3.0.0/16 0.0.0.0 0 32768 i
* i155.1.5.0/24 155.1.146.4 0 100 0 1 i
* i204.12.1.0 155.1.146.4 0 100 0 1 i

 

 
在R1与R3上配置 aggregate-address 10.0.0.0 255.252.0.0 summary-only 之后,我们看到所有路由器学习到的仅仅是汇聚路由,不包括明细路由,如下面输出结果
-----------------------------------------------------------------------------------------------------
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/14 155.1.146.1 0 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i
R5#show ip bgp
BGP table version is 3, local router ID is 155.1.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - inter
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
* i10.0.0.0/14 155.1.146.1 0 100 0 2 i
*> 155.1.5.0/24 0.0.0.0 0 32768 i
*>i204.12.1.0 155.1.45.4 0 100 0 i
R1(config-router)#do show ip bgp
BGP table version is 29, local router ID is 155.1.146.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
s> 10.0.0.0/16 0.0.0.0 0 32768 i
* i10.0.0.0/14 155.1.13.3 0 100 0 i
*> 0.0.0.0 32768 i
s> 10.1.0.0/16 0.0.0.0 0 32768 i
*> 155.1.5.0/24 155.1.146.4 0 1 i
*> 204.12.1.0 155.1.146.4 0 0 1 i
R3(config-router)#do show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/14 0.0.0.0 32768 i
* i 155.1.13.1 0 100 0 i
s> 10.2.0.0/16 0.0.0.0 0 32768 i
s> 10.3.0.0/16 0.0.0.0 0 32768 i
* i155.1.5.0/24 155.1.146.4 0 100 0 1 i
* i204.12.1.0 155.1.146.4 0 100 0 1 i

 
【实验总结】
下面我们将R4上的路由输出进行对比,对比结果很明显,如果aggregate-address 命令中加如 summary-only 参数,将不通告明细路由,否则将通告明细路由
R1与R3上未配置任何汇聚路由,R4的BGP路由包含邻居通告的所有路由
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 155.1.146.1 0 0 2 i
*> 10.1.0.0/16 155.1.146.1 0 0 2 i
*> 10.2.0.0/16 155.1.146.1 0 2 i
*> 10.3.0.0/16 155.1.146.1 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i
R1与R3上配置 aggregate-address 10.0.0.0 255.252.0.0,R4上的BGP路由中不仅包含了汇聚路由,而且包含了被汇聚的源明细路由
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/16 155.1.146.1 0 0 2 i
*> 10.0.0.0/14 155.1.146.1 0 0 2 i
*> 10.1.0.0/16 155.1.146.1 0 0 2 i
*> 10.2.0.0/16 155.1.146.1 0 2 i
*> 10.3.0.0/16 155.1.146.1 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i
R1与R3上配置 aggregate-address 10.0.0.0 255.252.0.0 summary-only,R4上的BGP路由中只包含了汇聚路由,不包含被汇聚的源明细路由
R4#show ip bgp
<隐藏部分输出结果>
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0/14 155.1.146.1 0 0 2 i
*>i155.1.5.0/24 155.1.45.5 0 100 0 i
*> 204.12.1.0 0.0.0.0 0 32768 i


本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/992258
相关文章
|
网络协议 网络架构
RIP(Routing Information Protocol,路由信息协议)
RIP是由Xerox公司在20世纪七十年代开发的,最初定义的RFC1058中。每个有RIP功能的路由器在默认情况下每隔30秒利用UDP520端口向与它直连的网络邻居广播(RIP v1)或组播(RIP v2)路由更新。因此,路由器不知道网络的全局情况,如果路由更新在网络上传播慢,将会导致网络收敛较慢,造成路由环路。为了避免路由环路,RIP采用水平分割、毒性逆转、定义最大跳数、触发更新和抑制计时器等机制来避免路由环路。
295 0
RIP(Routing Information Protocol,路由信息协议)
|
网络架构
Cisco Packet Tracer路由器配置、路由聚合实例
详细介绍了Cisco Packet Tracer中路由的运作机制,说明了路由聚合的原理并且通过实例验证计算的准确性。
537 0
Cisco Packet Tracer路由器配置、路由聚合实例
|
负载均衡 网络协议 网络架构
策略路由(Policy-Based-Route)
定义及运用场景 PBR: Policy-Based-Route,该技术打破了路由表的传统选路规则,可以根据管理员定义的策略条件来选择性的转发数据包。
502 0
策略路由(Policy-Based-Route)

热门文章

最新文章