BGP route aggregation
In large-scale networks, BGP routing table is very large, to the device caused a great burden, while the probability of occurrence of routing oscillation also increased significantly, affecting the stability of the network.
Route aggregation multiple routes combined mechanisms it without sending all of the specific method of routing by routing the polymerization transmitted only to the peer, the size of routing tables. And polymerized route if the route oscillation occurs, no longer affect the network, thereby improving the stability of the network.
Topology:
basic configuration:
Complete the basic interface configuration (omitted)
Completed within AS200 IGP configuration, using the OSPF protocol, each straight connector and declared loopback interface (omitted)
Complete EBGP and IBGP configuration
To AR1 example:
bgp 100
router-id 11.1.1.1
timer keepalive 50 hold 150
peer 12.1.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
network 11.1.1.1 255.255.255.255
peer 12.1.1.2 enable
AR2:
bgp 200
router-id 22.1.1.1
peer 12.1.1.1 as-number 100
peer 33.1.1.1 as-number 200
peer 33.1.1.1 connect-interface LoopBack0
peer 44.1.1.1 as-number 200
peer 44.1.1.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 12.1.1.1 enable
peer 33.1.1.1 enable
peer 33.1.1.1 next-hop-local
peer 44.1.1.1 enable
peer 44.1.1.1 next-hop-local
(1) Automatic polymerization
Subnet by the BGP is polymerized from natural mask. After the auto-configuration polymerization, generates a natural route network after polymerization, and the sub-network introduced by the original is suppressed, and preferably is not released to the BGP peer.
AR2 on the OSPF learned routes into the BGP protocol
AR2:
bgp 200
import-route ospf 1 // introduction OSPF routing
[AR2] dis bgp routing-table // Check the BGP routing table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*> The 10.1.1.0/24 0.0.0.0 2 0 ? --- question mark represents the redistribution import routes
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*> 22.1.1.1/32 0.0.0.0 0 0 ?
*> 23.1.1.0/24 0.0.0.0 0 0 ?
*> 33.1.1.1/32 0.0.0.0 1 0 ?
*> 44.1.1.1/32 0.0.0.0 2 0 ?
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
At this time, turn on the automatic summary function AR2, configured as follows
[AR2-BGP] the Summary Automatic // turn on auto-summary
Info: Automatic summarization is valid only for the routes imported through the import-route command.
[AR2]dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 14
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 10.0.0.0 127.0.0.1 0 ?
s> 10.1.1.0/24 0.0.0.0 2 0? // generates a natural route network after polymerization, and the sub-network introduced by the original is suppressed, and preferably is not released to BGP neighbor.
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*> 22.0.0.0 127.0.0.1 0 ?
s> 22.1.1.1/32 0.0.0.0 0 0 ?
*> 23.0.0.0 127.0.0.1 0 ?
s> 23.1.1.0/24 0.0.0.0 0 0 ?
*> 33.0.0.0 127.0.0.1 0 ?
s> 33.1.1.1/32 0.0.0.0 1 0 ?
*> 44.0.0.0 127.0.0.1 0 ?
s> 44.1.1.1/32 0.0.0.0 2 0 ?
*> 55.0.0.0 127.0.0.1 0 ?
s> 55.1.1.1/32 0.0.0.0 1 0 ?
* i 44.1.1.1 0 100 0 300i
[AR2]dis bgp routing-table 10.0.0.0
BGP local router ID : 22.1.1.1
Local AS number : 200
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 10.0.0.0/8:
Summary automatic route
Route Duration: 00h00m29s
Direct Out-interface: NULL0
Original nexthop: 127.0.0.1
Qos information : 0x0
AS-path Nil, origin incomplete, pref-val 0, valid, local, best, select, active, pre 255
Aggregator: AS 200, Aggregator ID 22.1.1.1
Advertised to such 3 peers:
44.1.1.1
33.1.1.1
12.1.1.1
[AR2]dis ip routing-table protocol bgp
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : BGP
Destinations : 7 Routes : 7
BGP routing table status : <Active>
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/8 IBGP 255 0 D 127.0.0.1 NULL0 === route after polymerization, will produce point NULL0 air interface routes
11.1.1.1/32 EBGP 255 0 D 12.1.1.1 GigabitEthernet0/0/0
22.0.0.0/8 IBGP 255 0 D 127.0.0.1 NULL0
23.0.0.0/8 IBGP 255 0 D 127.0.0.1 NULL0
33.0.0.0/8 IBGP 255 0 D 127.0.0.1 NULL0
44.0.0.0/8 IBGP 255 0 D 127.0.0.1 NULL0
55.1.1.1/32 IBGP 255 0 RD 44.1.1.1 GigabitEthernet0/0/1
(2) manually polymerization
Manual polymerization:
For BGP local routes. In general, a higher priority than the polymerization manual automatic aggregation level. By default, it will release with specific routes and route the polymerization after polymerization manually.
Added loopback interface address LO10 192.168.0.1/24, LO11 on AR1 192.168.1. 1/24, 192.168.2.1/24 LO12, LO13 192.168.3.1/24, then the newly added four loopback interfaces declared into under the BGP process,
[AR1]bgp 100
[AR1-bgp]net 192.168.0.0 24
[AR1-bgp]net 192.168.1.0 24
[AR1-bgp]net 192.168.2.0 24
[AR1-bgp]net 192.168.3.0 24
<AR2>dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 11
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 10.1.1.0/24 0.0.0.0 2 0 ?
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*> 22.1.1.1/32 0.0.0.0 0 0 ?
*> 23.1.1.0/24 0.0.0.0 0 0 ?
*> 33.1.1.1/32 0.0.0.0 1 0 ?
*> 44.1.1.1/32 0.0.0.0 2 0 ?
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
*> 192.168.0.0 12.1.1.1 0 0 100i
*> 192.168.1.0 12.1.1.1 0 0 100i
*> 192.168.2.0 12.1.1.1 0 0 100i
*> 192.168.3.0 12.1.1.1 0 0 100i
See on AR2 BGP routing table, specific routes learned 4 AR1 declared segment 192, a large amount of learning the specific routes will take up memory space, required manual aggregation, route aggregation follows:
To view the routing table, BGP routes to OSPF to redistribute deleted on AR2
[AR2]bgp 200
[AR2-bgp]aggregate ?
IP_ADDR<X.X.X.X> Aggregate address
[AR2-bgp] aggregate 192.168.0.0 255.255.252.0 ? // release all aggregated routes and routes that are summarized
as-set Generate the route with AS -SET path-attribute // release polymeric routing loop detected
Policy Attributes the Set-aggregation attribute / // set the properties of the polymerization route
detail-suppressed Filter more detail route from updates // publish only the summary route
origin-policy Filter the originate routes of the aggregate // only the routes in the routing policy route summarization by
suppress-policy Filter more detail route from updates through a Routing policy // only summary route and are polymerized by the routing policy routing
<cr> Please press ENTER to execute command
(1) release of all aggregated routes and routes that are summarized
[AR2-bgp]aggregate 192.168.0.0 255.255.252.0
[AR2]dis bgp routing-table 192.168.0.0 255.255.252.0
BGP local router ID : 22.1.1.1
Local AS number : 200
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 192.168.0.0/22:
Aggregated route.
Route Duration: 00h00m30s
Direct Out-interface: NULL0
Original nexthop: 127.0.0.1
Qos information : 0x0
AS-path Nil, origin igp, pref-val 0, valid, local, best, select, active, pre 255
Aggregator: AS 200, Aggregator ID 22.1.1.1
Advertised to such 3 peers:
44.1.1.1
33.1.1.1
12.1.1.1
[AR1]dis bgp routing-table
BGP Local router ID is 11.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 0.0.0.0 0 0 i
*> 55.1.1.1/32 12.1.1.2 0 200 300i
*> 192.168.0.0/22 12.1.1.2 0 200i
*> 192.168.0.0 0.0.0.0 0 0 i
*> 192.168.1.0 0.0.0.0 0 0 i
*> 192.168.2.0 0.0.0.0 0 0 i
*> 192.168.3.0 0.0.0.0 0 0 i
( 2 ) only the summary route
[AR2-bgp]aggregate 192.168.0.0 22 detail-suppressed
[AR2]dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
*> 192.168.0.0/22 127.0.0.1 0 i
s> 192.168.0.0 12.1.1.1 0 0 100i
s> 192.168.1.0 12.1.1.1 0 0 100i
s> 192.168.2.0 12.1.1.1 0 0 100i
s> 192.168.3.0 12.1.1.1 0 0 100i
[AR2]dis bgp routing-table peer 44.1.1.1 advertised-routes
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 22.1.1.1 0 100 0 100i
*> 192.168.0.0/22 22.1.1.1 100 0 i
( 3 ) only the summary route is aggregated and routed through routing policy
ip ip-prefix 192 index 10 permit 192.168.1.0 24
route-policy BGP permit node 10
if-match ip-prefix 192
[AR2-bgp] aggregate 192.168.0.0 255.255.252.0 detail-suppressed suppress-policy BGP
// publish only the summary route and suppress matching route, but not by other policies routes still being advertised.
[AR2]dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
*> 192.168.0.0/22 127.0.0.1 0 i
*> 192.168.0.0 12.1.1.1 0 0 100i
s> 192.168.1.0 12.1.1.1 0 0 100i
*> 192.168.2.0 12.1.1.1 0 0 100i
*> 192.168.3.0 12.1.1.1 0 0 100i
[AR2]dis ip ip-prefix 192
Prefix-list 192
Permitted 1
Denied 3
index: 10 permit 192.168.1.0/24
[AR2]
[AR2]dis route-policy BGP
Route-policy : BGP
permit : 10 (matched counts: 1)
Match clauses :
if-match ip-prefix 192
( 4 ) Release detection loop polymerization route
To avoid routing loops route aggregation may be caused, the BGP designed AS_Set properties.
AS_Set property is an unordered AS_Path attribute indicating the route through which the polymerization AS number. When the route re-entering the polymerization AS_Set any of these properties are listed in AS when, the BGP will detect its own AS number polymerization route AS_Set attribute, then discards the routing polymerization, thereby avoiding the formation of routing loops.
[AR2-bgp]aggregate 192.168.0.0 255.255.252.0 detail-suppressed suppress-policy BGP as-set
[AR2]dis bgp routing-table 192.168.0.0 22
BGP local router ID : 22.1.1.1
Local AS number : 200
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 192.168.0.0/22:
Aggregated route.
Route Duration: 00h00m08s
Direct Out-interface: NULL0
Original nexthop: 127.0.0.1
Qos information : 0x0
AS-path 100, origin igp, pref-val 0, valid, local, best, select, active, pre 255
Aggregator: AS 200, Aggregator ID 22.1.1.1
Advertised to such 3 peers:
44.1.1.1
33.1.1.1
12.1.1.1
<AR4>dis bgp routing-table
BGP Local router ID is 44.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 11.1.1.1/32 22.1.1.1 0 100 0 100i
*> 55.1.1.1/32 45.1.1.5 0 0 300i
*>i 192.168.0.0/22 22.1.1.1 100 0 100i
*>i 192.168.0.0 22.1.1.1 0 100 0 100i
*>i 192.168.2.0 22.1.1.1 0 100 0 100i
*>i 192.168.3.0 22.1.1.1 0 100 0 100i
At this time, due to the reduction origins AS-path attribute, R1 will not learn until after the summary route.
<AR1>dis bgp routing-table
BGP Local router ID is 11.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 0.0.0.0 0 0 i
*> 55.1.1.1/32 12.1.1.2 0 200 300i
*> 192.168.0.0 0.0.0.0 0 0 i
*> 192.168.1.0 0.0.0.0 0 0 i
*> 192.168.2.0 0.0.0.0 0 0 i
*> 192.168.3.0 0.0.0.0 0 0 i
( 4 ) disposed aggregated route attributes: a summary route provided community
[AR2-bgp] aggregate 192.168.0.0 255.255.252.0 detail-suppressed suppress-policy BGP attribute-policy ORN
route-policy ORN permit node 10
apply origin incomplete // set the origin attribute
[AR2]dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 7
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
*> 192.168.0.0/22 127.0.0.1 0 100?
*> 192.168.0.0 12.1.1.1 0 0 100i
s> 192.168.1.0 12.1.1.1 0 0 100i
*> 192.168.2.0 12.1.1.1 0 0 100i
*> 192.168.3.0 12.1.1.1 0 0 100i
[AR2]dis bgp routing-table 192.168.0.0 22
BGP local router ID : 22.1.1.1
Local AS number : 200
Paths: 1 available, 1 best, 1 select
BGP routing table entry information of 192.168.0.0/22:
Aggregated route.
Route Duration: 00h01m32s
Direct Out-interface: NULL0
Original nexthop: 127.0.0.1
Qos information : 0x0
AS-path 100, origin incomplete, pref-val 0, valid, local, best, select, active, pre 255
Aggregator: AS 200, Aggregator ID 22.1.1.1
Advertised to such 3 peers:
44.1.1.1
33.1.1.1
12.1.1.1
( 5 ) Only the routing policy the routing route summarization by
The polymerization conditions, only the matching route-policy will produce the summary route
If the BGP present specific routes in the routing table needs to be summed, the polymerization will be generated route, while suppressing matched to specific routes.
ip ip-prefix 194 index 10 permit 192.168.3.0 24
route-policy ORI permit node 10
if-match ip-prefix 194
[AR2-bgp] aggregate 192.168.0.0 255.255.252.0 detail-suppressed origin-policy ORI
<AR2>dis route-policy ORI
Route-policy : ORI
permit : 10 (matched counts: 10)
Match clauses :
if-match ip-prefix 194
<AR2>dis bgp routing-table
BGP Local router ID is 22.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 8
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 11.1.1.1/32 12.1.1.1 0 0 100i
*>i 55.1.1.1/32 44.1.1.1 0 100 0 300i
*> 192.168.0.0/22 127.0.0.1 0 i
*> 192.168.0.0 12.1.1.1 0 0 100i
*> 192.168.1.0 12.1.1.1 0 0 100i
*> 192.168.2.0 12.1.1.1 0 0 100i
s> 192.168.3.0 12.1.1.1 0 0 100i