Technologia: Routing
Obszar: EGP
Uzasadnienie: Cisco
Tytuł: Agregacja BGP
Oprogramowanie: 12.X, 15.X, usługi IP
Platforma: Catalyst 3560, 3750, 3850, 4500, 6500, router ISR/ASR
Agregowanie adresów jest podstawową cechą stosowaną przez BGP w celu ukrycia dowolnej liczby prefiksów przed rozgłaszaniem sąsiadom. Kluczową myślą jest to, że co najmniej jeden prefiks musi znajdować się w tabeli BGP, która jest częścią zakresu agregacji. Nowo utworzony przedrostek posiada dwa dodatkowe atrybuty takie jak:
Aby zapobiec występowaniu pętli routingu, proces BGP tworzy nową trasę statyczną do Null0 dla każdej instrukcji agregującej.
Aby skonfigurować agregację dla prefiksów obejmuje typ prefiksu 50.0.0.0/16:
R1# configure terminal
R1 (config)# router bgp 100
R1 (config-router)# neighbor 80.50.0.2 remote-as 100
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 32768 i
*> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show ip route 50.0.0.0 255.255.0.0
Routing entry for 50.0.0.0/16
Known via "bgp 100", distance 200, metric 0, type locally generated
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 0, traffic share count is 1
AS Hops 0
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/24 80.50.0.1 0 100 0 ?
*>i50.0.0.0/16 80.50.0.1 0 100 0 i
*>i50.0.1.0/24 80.50.0.1 0 100 0 ?
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R2# show bgp ipv4 unicast 50.0.0.0/16
BGP routing table entry for 50.0.0.0/16, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
Local, (aggregated by 100 1.1.1.1)
80.50.0.1 from 80.50.0.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, atomic-aggregate, best
Rozszerzenia:
Command oferuje kilka rozszerzeń słów kluczowych, które wpływają na wynik końcowy:
R1# configure terminal
R1 (config)# router bgp 100
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0 summary-only
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
s> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 32768 i
s> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show bgp ipv4 unicast neighbors 80.50.0.2 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/16 0.0.0.0 32768 i
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/16 80.50.0.1 0 100 0 i
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R1# configure terminal
R1 (config)# ip prefix-list SUPPRESS permit 50.0.1.0/24
R1 (config)# route-map SUPPRESS_MAP permit 10
R1 (config-route-map)# match ip address prefix-list SUPPRESS
R1 (config)# router bgp 100
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0 suppress-map SUPPRESS_MAP
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 32768 i
s> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show bgp ipv4 unicast neighbors 80.50.0.2 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 32768 i
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/24 80.50.0.1 0 100 0 ?
*>i50.0.0.0/16 80.50.0.1 0 100 0 i
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R1# configure terminal
R1 (config)# router bgp 100
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0 summary-only as-set
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
s> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
s> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show bgp ipv4 unicast neighbors 80.50.0.2 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/16 80.50.0.1 0 100 0 ?
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R2# show bgp ipv4 unicast 50.0.0.0/16
BGP routing table entry for 50.0.0.0/16, version 21
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
Local, (aggregated by 100 1.1.1.1)
80.50.0.1 from 80.50.0.1 (1.1.1.1)
Pochodzenie niekompletne, metryka 0, localpref 100, ważne, wewnętrzne, najlepsze
R1# configure terminal
R1 (config)# route-map ATT_MAP permit 10
R1 (config-route-map)# set community 100:100
R1 (config-route-map)# set origin incomplete
R1 (config)# router bgp 100
R1 (config-router)# neighbor 80.50.0.2 send-community
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0 summary-only as-set attribute-map ATT_MAP
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
s> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
s> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show bgp ipv4 unicast neighbors 80.50.0.2 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/16 80.50.0.1 0 100 0 ?
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R2# show bgp ipv4 unicast 50.0.0.0/16
BGP routing table entry for 50.0.0.0/16, version 21
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
Local, (aggregated by 100 1.1.1.1)
80.50.0.1 from 80.50.0.1 (1.1.1.1)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Community: 100:100
R1# configure terminal
R1 (config)# ip prefix-list ADVERT permit 50.0.1.0/24
R1 (config)# route-map ADVERT_MAP permit 10
R1 (config-route-map)# match ip address prefix-list ADVERT
R1 (config)# router bgp 100
R1 (config-router)# aggregate-address 50.0.0.0 255.255.0.0 summary-only as-set advertise-map ADVERT_MAP
R1 (config-router)# exit
Polecenia weryfikacyjne:
R1# show bgp ipv4 unicast
Network Next Hop Metric LocPrf Weight Path
s> 50.0.0.0/24 0.0.0.0 0 32768 ?
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
s> 50.0.1.0/24 0.0.0.0 0 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R1# show bgp ipv4 unicast neighbors 80.50.0.2 advertised-routes
Network Next Hop Metric LocPrf Weight Path
*> 50.0.0.0/16 0.0.0.0 100 32768 ?
*> 80.50.0.0/24 0.0.0.0 0 32768 ?
R2# show bgp ipv4 unicast neighbors 80.50.0.1 routes
Network Next Hop Metric LocPrf Weight Path
*>i50.0.0.0/16 80.50.0.1 0 100 0 ?
r>i80.50.0.0/24 80.50.0.1 0 100 0 ?
R2# show bgp ipv4 unicast 50.0.0.0/16
BGP routing table entry for 50.0.0.0/16, version 21
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
Local, (aggregated by 100 1.1.1.1)
80.50.0.1 from 80.50.0.1 (1.1.1.1)
Origin incomplete, metric 0, localpref 100, valid, internal, atomic-aggregate, best