BGP路由聚合


如图,R1在AS1中,R2,R3,R4在一个大AS100中(R2,R3在AS23中,R4在AS4中),5在AS5中。
BGP路由汇总
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 ?
advertise-map Set condition to advertise attribute
as-confed-set Generate AS confed set path information
as-set Generate AS set path information
attribute-map Set attributes of aggregate
route-map Set parameters of aggregate
summary-only Filter more specific routes from updates
suppress-map Conditionally filter more specific routes from updates
<cr>
直接回车<cr>----默认汇总和默认一起发送
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0
R1#show ip bgp
BGP table version is 33, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
> 1.1.1.1/32 0.0.0.0 0 32768 i
> 5.5.5.5/32 12.1.1.2 0 100 5 i
> 200.1.0.0/22 0.0.0.0 32768 i
> 200.1.1.0 0.0.0.0 0 32768 i
> 200.1.2.0 0.0.0.0 0 32768 i
> 200.1.3.0 0.0.0.0 0 32768 i
R2#show ip bgp
BGP table version is 7, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
*** > 200.1.0.0/22 12.1.1.1 0 0 1 i

200.1.1.0 12.1.1.1 0 0 1 i
200.1.2.0 12.1.1.1 0 0 1 i
200.1.3.0 12.1.1.1 0 0 1 i
只发送汇总路由 summary-only
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 summary-only
R2#show ip bgp
BGP table version is 10, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
* > 200.1.0.0/22 12.1.1.1 0 0 1 i
抑制列表suppress-map--处于抑制列表的路由不允许发送
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 (yidingyaoxie)
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 suppress-map ccie
R1#show run | s bgp
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 200.1.1.0
network 200.1.2.0
network 200.1.3.0
aggregate-address 200.1.0.0 255.255.252.0 suppress-map ccie
neighbor 12.1.1.2 remote-as 100
no auto-summary
R1#show run | s rout-map
R1#show rou
R1#show route-map
route-map ccie, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
Policy routing matches: 0 packets, 0 bytes
Standard IP access list 1
抓取200.1.1.0 200.1.3.0 的路由,通配符为0.0.2.0 是因为0固定位,1是可变位,只有第23位改变。
10 permit 200.1.1.0, wildcard bits 0.0.2.0 (4 matches)*
R2#show ip bgp
BGP table version is 21, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
> 200.1.0.0/22 12.1.1.1 0 0 1 i
> 200.1.2.0 12.1.1.1 0 0 1 i
条件列表 advertise-map--处于条件列表中的路由一旦消失,汇总路由就会立即消失
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 advertise-map c1
R1(config)#access-list 2 permit 200.1.2.0
R1(config)#route-map c1 permit 10
R1(config-route-map)#mat
R1(config-route-map)#match ip ad
R1(config-route-map)#match ip address 2
R1(config-route-map)#exit
R1(config)#exit
R1(config)#inter lo 1
R1(config-if)#shutdown
R2#show ip bgp
BGP table version is 26, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
> 200.1.0.0/22 12.1.1.1 0 0 1 i
> 200.1.2.0 12.1.1.1 0 0 1 i
> 200.1.3.0 12.1.1.1 0 0 1 i
R1#show ip inter b
Interface IP-Address OK? Method Status Protocol
Serial0/0 unassigned YES NVRAM administratively down down
Serial0/1 unassigned YES NVRAM administratively down down
Serial0/2 unassigned YES NVRAM administratively down down
Serial0/3 unassigned YES NVRAM administratively down down
Serial1/0 unassigned YES NVRAM administratively down down
Serial1/1 12.1.1.1 YES NVRAM up up
Serial1/2 unassigned YES NVRAM administratively down down
Serial1/3 unassigned YES NVRAM administratively down down
Loopback0 1.1.1.1 YES NVRAM up up
Loopback1 200.1.1.1 YES manual up up
Loopback2 200.1.2.1 YES manual administratively down down
Loopback3 200.1.3.1 YES manual up up
R2#show ip bgp
BGP table version is 29, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
** > 200.1.1.0 12.1.1.1 0 0 1 i

200.1.3.0 12.1.1.1 0 0 1 i**
attribute-map和route-map一样,改变路由聚合属性,并不需要抓取感兴趣流量。
R1#show ip bgp
BGP table version is 37, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 0.0.0.0 0 32768 i
> 5.5.5.5/32 12.1.1.2 0 100 5 i
> 200.1.1.0 0.0.0.0 0 32768 i
R1#show run | s bgp
router bgp 1
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 200.1.1.0
neighbor 12.1.1.2 remote-as 100
R1(config)#router bgp 1
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 attribute-map c2
R1#show route-map c2
route-map c2, permit, sequence 10
Match clauses:
Set clauses:
metric 888
local-preference 9909
as-path prepend 1 1 no
weight 99
ip next-hop 12.1.1.2
Policy routing matches: 0 packets, 0 bytes
R1#show ip bgp
BGP table version is 39, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 0.0.0.0 0 32768 i
> 5.5.5.5/32 12.1.1.2 0 100 5 i
* > 200.1.0.0/22 12.1.1.2 888 9909 99 i*
> 200.1.1.0 0.0.0.0 0 32768 i
R2#show ip bgp
BGP table version is 39, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
> 200.1.0.0/22 12.1.1.1 888 0 1 i
> 200.1.1.0 12.1.1.1 0 0 1 i
Route-map改变路由聚合属性
R1(config)#router bgp 1
R1(config-router)#agg
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 ro
R1(config-router)#aggregate-address 200.1.0.0 255.255.252.0 route-map c3
R1(config-router)#exit
R1(config)#ro
R1(config)#route-m
R1(config)#route-map c3 per
R1(config)#route-map c3 permit 10
R1(config-route-map)#set lo
R1(config-route-map)#set local-preference 120
R1(config-route-map)#exit
R1(config)#exit
R1#show ip bgp
BGP table version is 44, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 0.0.0.0 0 32768 i
> 5.5.5.5/32 12.1.1.2 0 100 5 i
* > 200.1.0.0/22 0.0.0.0 120 32768 i*
> 200.1.1.0 0.0.0.0 0 32768 i
> 200.1.2.0 0.0.0.0 0 32768 i
> 200.1.3.0 0.0.0.0 0 32768 i
R2#show ip bgp
BGP table version is 10, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 12.1.1.1 0 0 1 i
>i 5.5.5.5/32 3.3.3.3 0 100 0 (4) 5 i
> 200.1.0.0/22 0.0.0.0 32768 i
s> 200.1.1.0 12.1.1.1 0 0 1 i
s> 200.1.2.0 12.1.1.1 0 0 1 i
s> 200.1.3.0 12.1.1.1 0 0 1 i
R3#show ip bgp
BGP table version is 58, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

>i 1.1.1.1/32 2.2.2.2 0 100 0 1 i
> 5.5.5.5/32 4.4.4.4 0 100 0 (4) 5 i
>i 200.1.0.0/22 2.2.2.2 0 100 0 i
R5#show ip bgp
BGP table version is 50, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 45.1.1.4 0 100 1 i
> 5.5.5.5/32 0.0.0.0 0 32768 i
> 200.1.0.0/22 45.1.1.4 0 100 i
As-set携带聚合之前路由的属性
R2#show run | s bgp
router bgp 23
aggregate-address 200.1.0.0 255.255.252.0 as-set
R5#show ip bgp
BGP table version is 4, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 45.1.1.4 0 100 1 i
> 5.5.5.5/32 0.0.0.0 0 32768 i
* > 200.1.0.0/22 45.1.1.4 0 100 i*
R5#show ip bgp
BGP table version is 11, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 45.1.1.4 0 100 1 i
> 5.5.5.5/32 0.0.0.0 0 32768 i
* > 200.1.0.0/22 45.1.1.4 0 100 1 i*
> 200.1.1.0 45.1.1.4 0 100 1 i
> 200.1.2.0 45.1.1.4 0 100 1 i
> 200.1.3.0 45.1.1.4 0 100 1 i

原文地址:http://blog.51cto.com/13625527/2097137

时间: 2024-11-09 00:30:12

BGP路由聚合的相关文章

BGP路由

1.自治系统(AS) 自治系统:由同一个技术管理机构管理.使用统一选路策略的一些路由器的集合: 自治系统内部的路由协议--IGP 自治系统之间的路由协议--EGP AS号段:1-64511(公有号段).64512-65535(私有号段) 2.BGP特征 IGP:着重于发现和计算路由,主要有RIP.OSPF.ISIS: EGP:着重于控制路由的传播和选择最优的路由,通常指BGP; BGP用来在AS之间传递路由信息,是一种增强的距离矢量路由协议(可靠的路由更新机制.丰富的metric度量方法.从设计

乾颐堂军哥HCIE9-解决BGP路由黑洞、聚合的各种参数以及RR基础

本技术文章讨论BGP的路由黑洞解决方案.BGP聚合,即减少路由条目数的技术1.BGP路由黑洞1.1 解决路由黑洞问题1某些AS内的设备没有运行BGP(R3),那么它会缺少路由(2.2.2.2/6.6.6.6),由于IP报文是逐跳转发的,报文到达R3,R3只能丢弃报文解决方案:1)BGP的全互联(full-mesh)确实可以解决路由黑洞问题,同时带来了邻居过多,TCP会话多拖,没必要的路由更新过多,拍错困难等问题完成全互联配置:bgp 345peer 33.1.1.1 as-number 345

BGP路由属性详解

Weight属性:cisco私有的BGP属性参数,它只适用于一台路由器中的路由,也就是不会传递给任何其他的路由器.他的取值范围为<0-65535>,这个数越大优先级越高,默认从邻居学到的路由的weight都为0,从本地重分布进BGP路由表中的值为32768.Weight属性不能包括在BGP的update中,也不能以任何形式传递给其他运行BGP的邻居,就是说一个路由器上权值的分配不会影响其他路由器上的路由选项. Neighbor X.X.X.X weight命令可以更改从该邻居收到的路由的wei

BGP 路由属性 公认可选 ATOMIC_AGGREGATE

ATOMIC_AGGREGATE是用来通告路由接收者,该路由是经过聚合的,是公认可选属性. 有时BGP发布者会收到两条重叠的路由,其中一条路由包含的地址是另一条路由的子集.一般情况下BGP发布者会优选更精细的路由(前者),但是在对外发布时,如果它选择发布更粗略的那条路由(后者),这时需要附加上ATOMIC-AGGREGATE属性,以知会对等体.它实际上是一种警告,因为发布更粗略的路由意味着更精细的路由信息在发布过程中丢失了.在进行路由聚合时,对于聚合的路由信息会添加ATOMIC-AGGREGAT

华为设备的BGP路由技术是什么?

一. 什么是BGP? BGP不同于之前介绍的动态路由协议,BGP是在自治系统之间进行路由学习及选路的协议,如果把一个城市比作一个自治系统,那么像RIP.OSPF等协议就相当于该城市的公交车或者地铁,而BGP则是火车,运行在城市之间. 1. 自治系统 自治系统(Autonomous System AS)是由同一个技术管理机构管理,使用统一选路策略,(运行同一动态路由协议)的一组路由器的集合,自治系统的编号取值范围为1~65535.其中1~64511是互联网上注册的公有AS号类,类似之前课程中讲过的

华为路由器——BGP路由技术详解

BGP(边界网关协议)是一个路径矢量路由协议,和传统的基于下一跳的IGP协议不同,它是基于AS(自治系统)的协议.BGP属于外部网关路由协议,它解决的是AS之间的选路问题,也正是因为这样,它更适合用户互联网.学习BGP的关键在于理解BGP的报文.邻居的建立.BGP路由属性.选路原则等.接下来详细介绍--BGP路由协议. 博文大纲:一.了解BGP的概述:二.掌握BGP的工作原理:三.实验案例:四.总结BGP的配置: 一.BGP的概述 不同于RIP.OSPF之类的路由协议,BGP是在自治系统之间进行

华为路由器之BGP路由技术总结及配置命令

一.BGP的概念:BGP(Border Gateway Protocol,边界网关协议)是一个距离矢量路由协议,和传统的基于下一跳的IGP协议不同,它是基于AS(自治系统)的协议.BGP属于外部网关路由协议,它解决的是AS之间的选路问题,也正是这样,它更适合用于互联网.BGP的关键在于理解BGP的报文,邻居的建立.BGP路由属性.选路原则等..1.自治系统是什么?自治系统(autonomous system,简称"AS"),是由同一个技术管理机构管理,使用统一选路策略(运行同一动态路由

路由聚合算法

编辑 汇总(路由聚合)算法比较简单,因为只需要知道块的大小, 例如: 网络192.168.16.0——192.168.31.0 块大小是多少呢?刚好是16个C类 网络,块大小16就满足, 由于通告汇总地址带的网络地址总是块中的第一个网络地址,这里是192.168.16.0. 确定子网掩码,什么样的子网子网掩码提供块大小为16呢? 答案是240 也就是/20 因此子网掩码为255.255.240.0.

BGP路由负载均衡故障案例

网络架构介绍 1.拓扑图: 考虑到公司网络隐私性和更清楚的描述故障现象,对实际网络结构进行了简化. 2.网络规划及数据配置简介: ◆ASR9K分别以互联地址与两台N7K建立IBGP邻居关系: ◆ASR9K下挂思科752架构,752下为CDN服务器: ◆服务器网关均在N7K,两台7K之间起HSRP V2,相同优先级: ◆规划CDN服务器流量负载均衡(BOND0)至752,N7K再通过BGP将流量均衡送至ASR9K,最               后流量从ASR9出公网. 数据配置: ASR9K: