Unternehmensberatung Lemberg
aggregate-address

BGP-Funktion : aggregate-address

Die aggregate-address Funktion aggregiert Adressen in größere Adressblöcke, um die Anzahl der Routen zu minimieren. Hierbei ergeben sich einige interessante Aspekte, die wir nachfolgend einmal anschauen wollen. Zunächst wieder ein simpler Versuchsaufbau :

Zeichnung107

Schauen wir uns mal die Routingtabelle auf Rtr-E an. Weder auf Rtr-A, noch auf Rtr-B wird zurzeit aggregiert. Alle Netze von 192.168.0 bis 192.168.15 sind Klasse C-Netze (über Loopback generiert) und werden per redistribute connected announced. Erwartungsgemäß erhalten wir folgenden Output :

Rtr-E#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.13.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.14.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.15.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.8.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.9.0/24 [20/0] via 172.22.1.13, 00:00:09
B    192.168.10.0/24 [20/0] via 172.22.1.13, 00:00:09
     172.22.0.0/16 is variably subnetted, 6 subnets, 2 masks
B      172.22.1.8/30 [20/0] via 172.22.1.13, 00:00:09
C      172.22.1.12/30 is directly connected, Serial0/1
B      172.22.1.0/30 [20/0] via 172.22.1.13, 00:00:10
B      172.22.100.17/32 [20/0] via 172.22.1.13, 00:00:10
B      172.22.100.6/32 [20/0] via 172.22.1.13, 00:00:10
C      172.22.100.4/32 is directly connected, Loopback1
B    192.168.11.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.4.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.5.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.6.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.7.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.0.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.1.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.2.0/24 [20/0] via 172.22.1.13, 00:00:10
B    192.168.3.0/24 [20/0] via 172.22.1.13, 00:00:10
Rtr-E#

Aggregieren wir nun im nächsten Schritt sowohl auf dem Rtr-A, als auch auf dem Rtr-B die Routen in schicke /21’er Networks. Dazu fügen wir im Konfigurationsmenü von Rtr-A und Rtr-B den aggregate-address Befehl ein.

Rtr-B:
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.8.0 255.255.248.0
 redistribute connected
 neighbor 172.22.1.10 remote-as 3

Rtr-A:
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.0.0 255.255.248.0
 redistribute connected
 neighbor 172.22.1.2 remote-as 3

Hier nun das Ergebnis eines neuen Blickes in die Routing-Tabelle :

Rtr-E#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.13.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.14.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.15.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.8.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.9.0/24 [20/0] via 172.22.1.13, 01:57:24
B    192.168.10.0/24 [20/0] via 172.22.1.13, 01:57:24
     172.22.0.0/16 is variably subnetted, 6 subnets, 2 masks
B      172.22.1.8/30 [20/0] via 172.22.1.13, 01:57:24
C      172.22.1.12/30 is directly connected, Serial0/1
B      172.22.1.0/30 [20/0] via 172.22.1.13, 00:17:20
B      172.22.100.17/32 [20/0] via 172.22.1.13, 01:57:25
B      172.22.100.6/32 [20/0] via 172.22.1.13, 00:17:20
C      172.22.100.4/32 is directly connected, Loopback1
B    192.168.11.0/24 [20/0] via 172.22.1.13, 01:57:26
B    192.168.4.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.5.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.6.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.7.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.0.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.1.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.2.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.3.0/24 [20/0] via 172.22.1.13, 00:17:21
B    192.168.8.0/21 [20/0] via 172.22.1.13, 00:38:29
B    192.168.0.0/21 [20/0] via 172.22.1.13, 00:00:33

Rtr-E#

Wie zu sehen ist, hat unsere Aggregierung geklappt, jedoch haben wir das Ziel, die Anzahl der Routen in der Routingtable zu verringern, verfehlt. Um das Announcen der einzelnen Netze innerhalb eines aggregierten Bereiches zu vermeiden wird das Schlüsselwort summary-only verwendet :

Rtr-B:
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.8.0 255.255.248.0 summary-only
 redistribute connected
 neighbor 172.22.1.10 remote-as 3

Rtr-A:
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.0.0 255.255.248.0 summary-only
 redistribute connected
 neighbor 172.22.1.2 remote-as 3

Der Erfolg kann sich sehen lassen :

Rtr-E#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     172.22.0.0/16 is variably subnetted, 6 subnets, 2 masks
B      172.22.1.8/30 [20/0] via 172.22.1.13, 02:04:47
C      172.22.1.12/30 is directly connected, Serial0/1
B      172.22.1.0/30 [20/0] via 172.22.1.13, 00:24:42
B      172.22.100.17/32 [20/0] via 172.22.1.13, 02:04:47
B      172.22.100.6/32 [20/0] via 172.22.1.13, 00:24:42
C      172.22.100.4/32 is directly connected, Loopback1
B    192.168.8.0/21 [20/0] via 172.22.1.13, 00:45:50
B    192.168.0.0/21 [20/0] via 172.22.1.13, 00:07:54

Rtr-E#

Die nächste Frage, die sich natürlich stellt ist, ob wir nicht die beiden /21-Netze noch zusammenfassen könnten. Natürlich, ein optimaler Punkt dafür wäre der Router Rtr-C. Dort ergänzen wir die BGP-Konfig mit folgendem Ergebnis :

Rtr-C:
router bgp 3
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.0.0 255.255.240.0 summary-only
 neighbor 172.22.1.1 remote-as 2
 neighbor 172.22.1.6 remote-as 4
 neighbor 172.22.1.9 remote-as 1

Doch bevor ich diese Konfig aktiv schalte, schauen wir uns für die beiden bereits aggregierten Adressblöcke mal ein show ip bgp an :

Rtr-E#sh ip bgp
BGP table version is 65, local router ID is 172.22.100.4
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
*> 172.22.1.0/30   172.22.1.13                            0 4 3 2 ?
*> 172.22.1.8/30   172.22.1.13                            0 4 3 1 ?
*> 172.22.100.6/32 172.22.1.13                            0 4 3 2 ?
*> 172.22.100.17/32 172.22.1.13                            0 4 3 1 ?
*> 192.168.0.0/21  172.22.1.13                            0 4 3 2 i
*> 192.168.8.0/21  172.22.1.13                            0 4 3 1 i

Rtr-E#

Deutlich ist zu sehen, daß der AS-Path für beide aggregierten Blöcke beim jeweiligen Router Rtr-A und Rtr-B beginnt. Wenn nun diese Netze auf dem Rtr-C aggregiert werden, wie sieht dann der AS-Path aus ? Hier ein Blick auf die Routing-Tabelle und den AS-Path :

Rtr-E#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     172.22.0.0/16 is variably subnetted, 6 subnets, 2 masks
B      172.22.1.8/30 [20/0] via 172.22.1.13, 02:16:42
C      172.22.1.12/30 is directly connected, Serial0/1
B      172.22.1.0/30 [20/0] via 172.22.1.13, 00:36:38
B      172.22.100.17/32 [20/0] via 172.22.1.13, 02:16:42
B      172.22.100.6/32 [20/0] via 172.22.1.13, 00:36:38
C      172.22.100.4/32 is directly connected, Loopback1
B    192.168.0.0/20 [20/0] via 172.22.1.13, 00:00:15
Rtr-E
#
Rtr-E#sh ip bgp
BGP table version is 68, local router ID is 172.22.100.4
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
*> 172.22.1.0/30   172.22.1.13                            0 4 3 2 ?
*> 172.22.1.8/30   172.22.1.13                            0 4 3 1 ?
*> 172.22.100.6/32 172.22.1.13                            0 4 3 2 ?
*> 172.22.100.17/32 172.22.1.13                            0 4 3 1 ?
*> 192.168.0.0/20  172.22.1.13                          0 4 3 i
Rtr-E#

Während die Sache mit dem Aggregieren wunderbar geklappt hat, sehen wir jedoch, daß wir uns nicht mehr auf die Informationen des AS-Path verlassen können. Es gibt allerdings ein weiteres Feature, welches uns wenigstens die AS verrät, aus denen die aggregierten Routen herkommen. Dazu erweitern wir die Konfig auf Rtr-C wie folgt :

Rtr-C
router bgp 3
 no synchronization
 bgp log-neighbor-changes
 aggregate-address 192.168.0.0 255.255.240.0 as-set summary-only
 neighbor 172.22.1.1 remote-as 2
 neighbor 172.22.1.6 remote-as 4
 neighbor 172.22.1.9 remote-as 1

Im Ergebnis sieht man, daß die beiden Autonomen Systeme, die zur Aggregierung herangezogen wurden, nun in geschweiften Klammern dargestellt werden :

Rtr-E#sh ip bgp
BGP table version is 75, local router ID is 172.22.100.4
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
*> 172.22.1.0/30   172.22.1.13                            0 4 3 2 ?
*> 172.22.1.8/30   172.22.1.13                            0 4 3 1 ?
*> 172.22.100.6/32 172.22.1.13                            0 4 3 2 ?
*> 172.22.100.17/32 172.22.1.13                            0 4 3 1 ?
*> 192.168.0.0/20  172.22.1.13                            0 4 3 {2,1} i
Rtr-E#

weiter zum zweiten Teil....

Karriere   Kontakt   Impressum