Menu

Region US

Grandmetric LLC
Lewes DE 19958
16192 Coastal Hwy USA
EIN: 98-1615498
+1 302 691 94 10
info@grandmetric.com

Region EMEA

GRANDMETRIC Sp. z o.o.
ul. Metalowa 5, 60-118 Poznań, Poland
NIP 7792433527
+48 61 271 04 43
info@grandmetric.com

UK

Grandmetric LTD
Office 584b
182-184 High Street North
London
E6 2JA
+44 20 3321 5276
info@grandmetric.com

  • en
  • pl
  • BGP: Agregowanie adresów

    Projektowanie i konfigurowanie

    BGP: Agregowanie adresów

    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:

    1. AGGREGATOR – składają się z informacji o routerze, takich jak Router-ID, AS_PATH, który wykonuje rzeczywiste zadanie,
    2. ATOMIC_AGGREGATE – poinformować inne routery, że brakuje jakiejś części atrybutów BGP, np. uzupełnij AS_PATH, NEXT_HOP.

    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:

    1. summary-only – aby automatycznie pomijać reklamy bardziej szczegółowych przedrostków.

     

    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 ?

     

    1. suppress-map – do selektywnego tłumienia reklam niektórych przedrostków.

     

    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 ?

     

    1. as-set – aby przywrócić cały zestaw informacji AS_PATH i uwzględnić go w zagregowanym przedrostku, atrybut ATOMIC_AGGREGATE nie jest już potrzebny.

    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

     

    1. attribute-map – aby przypisać określone atrybuty do nowego przedrostka agregatu i zastąpić obecne.

    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

     

     

    1. advertise-map – aby wybrać określone przedrostki do tworzenia nowego zestawu atrybutów, takie jak AS_SET dla przedrostka zagregowanego.

    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

    Autor: Marcin Bialy
     
    Następny
    Grandmetric: Network & Security