Escolar Documentos
Profissional Documentos
Cultura Documentos
ROUTE v7 Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
BGP. Introduccin
Border Gateway Protocol (BGP) es el protocolo de enrutamiento
utilizado en internet por los ISPs para interconectar distintos sistemas
autnomos y sus redes.
Su objetivo es proveer un enrutamiento entre sistemas autnomos libre
de bucles.
Soporta VLSM y CIDR, lo cual reduce el tamao de grandes tablas de
enrutamiento.
BGP no requiere una arquitectura jerrquica y puede soportar mltiples
conexiones (polticas de control de rutas).
BGP es un protocolo vector distancia mejorado o protocolo Vector Path,
siendo su mtrica Path Vectors (Atributos).
BGP busca el camino ms estable hacia el destino, basndose en
polticas de enrutamiento permitiendo controlar el flujo de trfico entre
sistemas autnomos.
BGPv4 (IPv4) y MBGP (IPv6).
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
BGP. Conceptos
Para entender el funcionamiento de BGP primero se deben tener
conocimiento de los siguientes conceptos:
Sistema Autnomo: Hace referencia a una red o grupo de redes administradas de
manera independiente, donde se puede gestionar todo trfico que pasa por ella.
Cisco Public
Cisco Public
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
Se crea en los routers de borde una ruta por defecto hacia el ISP, donde el uso de la CPU ser
menor y la tabla de enrutamiento ms pequea.
2.
Se construye una ruta por defecto hacia el ISP y ste nos enva algunas rutas especficas.
Donde el uso de CPU ser medio y la tabla de enrutamiento no ser sobrecargada.
3.
El ISP nos enva todas las rutas de las redes, donde el uso del CPU ser extremo y la tabla de
enrutamiento ser demasiado grande. Normalmente los ISP utilizan esta opcin.
Cuantas ms redes nos lance el ISP, mayor precisin a la hora de enrutar.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
IBGP hace referencia a la conexin entre dos routers que corren BGP dentro de un mismo
sistema autnomo, como por ejemplo, Router A, B, C y D son IBGP dentro del SA 65000.
EBGP son los Routers de borde que interconectan los distintos SA, como por ejemplo
Router A del AS 65000 y Router E del AS 65250.
Los mensajes BGP entre peers EBGP, se envian con un TTL de 1, por lo tanto solo se
puede generar adyacencia EBGP entre routers borde, ya que no permite mas de un salto.
El TTL entre routers IBGP siempre es mayor a 1, lo que permite generar adyacencia entre
vecinos que no se encuentran directamente conectados.
Problemas de Actualizacin (Update): segn la regla de BGP split horizon especifica que
las rutas aprendidas via IBGP nunca son propagadas a otros IBGP peers.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
En un AS de transito todos los routers deben conocer todas las rutas externas. Dos opciones:
1. Redistribuir las rutas en el IGP del AS, esto puede provocar problemas ya que las tablas de enrutamiento sern
gigantescas y protocolos como OSPF o EIGRP no podrn soportarlas.
2. Configurar IBGP solo en los routers borde, pero esto gener otro problema. Solo conocern las redes externas los
routers de borde.
La solucin ms factible es configurar IBGP en todos los routers del AS de transito (full mesh).
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
10
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
11
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
12
Cuando dos routers se interconectan bajo una sesin TCP son conocidos como BGP peer
routers o BGP neighbors.
Como BGP implementa un protocolo confiable, no son necesarias actualizaciones
peridicas y solo son necesarias actualizaciones incrementales o generadas por eventos.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
13
Configuracin
BGP
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
14
Un Router EBGP intentar conversar con su neighbor, por lo tanto ste debe poder ser
alcanzado, y ya que esta directamente conectado, no necesita de otro protocolo (como un
IGP).
Al declarar un vecino con el comando Neighbor ste debe ser alcanzable.
Ya que no es necesario que los vecinos estn directamente conectados, normalmente se
decide usar interfaces loopbacks para el establecimiento de la sesin TCP entre los routers,
esto permite que cuando existan caminos redundantes hacia un vecino, la cada de una
interfaz fsica no afecte la adyacencia.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
15
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
16
R1
R2
R3
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
17
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
18
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
19
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
20
Verificacin eBGP
Cisco Public
21
Verificacin eBGP
Neighbor: IP del vecino
Version (V): version de BGP que esta corriendo en el router.
AS: numero de AS del vecino.
Messages received (MsgRcvd): mensajes recibidos.
Messages sent (MsgSent): mensajes enviados.
TblVer: ltima version de la tabla BGP enviada.
In queue (InQ): mensajes esperando a ser procesados.
Out queue (OutQ): mensajes esperando a ser enviados.
Up/down: tiempo que lleva established, active, o idle.
State: active, idle, open sent, open confirm, o idle (admin).
Prefix received (PfxRcd): numero de redes recibidas. Solo
cuando esta en established.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
22
Verificacin eBGP.
show ip bgp neighbors
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
23
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
24
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
25
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
26
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
27
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
28
Tabla BGP
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
29
Next-Hop-Self
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
30
Next-Hop-Self
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
31
Next-Hop-Self
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
32
Configurando Next-Hop
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
33
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
34
Si se utiliza BGP solo en los routers borde, y la sincronizacin se encuentra deshabilitada, los routers
R1 y R3 no sabrn cmo alcanzar las redes fuera de su AS, ya que solo corren un protocolo de
enrutamiento IGP.
Por lo tanto a pesar de que entre R2 y R4 se compartan todas las rutas conocidas va IBGP y que
puedan alcanzar el siguiente salto va IGP o con Next-hop-self, cuando los paquetes viajen a travs
de R1 o R3, sern descartados.
La red entre RA y R2 fue aprendida va IGP al igual que la red entre R4 y RB.
R2 al recibir el paquete, revisa en su tabla BGP y encuentra un destino a la red 200.0.0.0/24 del AS
65600.
R2 decide reenviarlo a la direccin de RB, y para llegar a esta direccin utiliza el IGP, reenvindoselo
as a R3.
Al momento de recibir el paquete R3, revisa en su tabla de enrutamiento, y no posee un destino hacia
la red 200.0.0.0/24.
El paquete es descartado por R3, a pesar de que conozca como llegar a RB, ya que el paquete posee
como destino la red 200.0.0.0 y no la direccin de RB.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
35
BGP mantiene su tabla de enrutamiento separada de la tabla de IGP, y ofrece las mejores rutas a la tabla
de enrutamiento IGP. Tambin pueden ser redistribuidas las rutas de la tabla de BGP a la tabla de
enrutamiento IP del IGP.
Las redes aprendidas por EBGP poseen una distancia administrativa de 20, y las IBGP poseen una
distancia administrativa de 200.
Por lo tanto, solo pasan a la tabla de enrutamiento las rutas con menor distancia administrativa, en
comparacin con las rutas de los protocolos IGP.
BGP tambin mantiene una Neighbors Table, la cual contiene una lista de sus vecinos con los cuales
posee conexin.
Para que BGP genere adyacencia debe ser asignado explcitamente el vecino con el comando Neighbor.
Luego de establecer adyacencia, BGP mantiene esta relacin con mensajes BGP/TCP keepalive, los
cuales son enviados siempre cada 60 segundos.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
36
Los mensajes Update se utilizan para intercambiar sus tablas de enrutamiento, los keepalive se
encargan de mantener la conexin arriba y los notification avisan algn error o condicin especial.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
37
Estos mensajes envan informacin sobre los Path, cada Path requiere
de un mensaje update.
Cada update posee los atributos respecto al path, y las redes que
pueden ser alcanzadas por este path.
Por lo tanto cada update posee las Rutas con sus respectivos atributos
(as-path, origin, local-preference, etc.).
Parmetros de los paquetes BGP
Version: Identifica la versin que corre BGP, posee 8 bit y actualmente es
versin 4.
Sistema Autnomo: Identifica el sistema autnomo, posee 16 bit.
Hold-time: Tiempo de espera mximo entre los mensajes keepalive, posee 6
bit y por defecto son 180 segundos.
Optional Parameters.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
38
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
39
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
40
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
41
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
42
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
43
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
44
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
45
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
46
eBGP Multihop
Para solucionar el problema anterior, debemos habilitar
multihop eBGP con el comando neighbor ip-address
ebgp-multihop [ ttl ]
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
47
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
48
Tambin se deben crear dos rutas estticas hacia la direccin de loopback que generar la
adyacencia, para que realicen un balanceo de carga entre los enlaces.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
49
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
50
BGP. Autenticacin.
BGP soporta Message disgest 5 para la autenticacin de sus vecinos.
Ejemplo de configuracin:
R0 (config)# router bgp 500
R0 (config-router)# neighbor 80.80.80.80 password Cisco123
R1 (config)# router bgp 500
R1 (config-router)# neighbor 70.70.70.70 password Cisco123
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
51
Cisco Public
52
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
53
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
54
BGP Atributos y
procesos de
seleccin de
rutas
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
55
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
56
BGP. Atributos.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
57
BGP. Atributos.
Los atributos definidos por BGP son los siguientes:
Well-known Mandatory
Next-hopType code 3
MED (Multiexit-discriminator)Type Code 4
Local-preferencetype code 5
Well-known Discretionary
Atomic-aggregatetype code 6
AggregatorType code 7
CommunityType code 8 (Cisco-defined)
Originator-IDType code 9 (Cisco-defined)
Cluster listType code 10 (Cisco-defined)
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
58
AS-PATH
Lista los AS por los que pasa la ruta para llegar a la red.
Se utiliza para asegurar un camino libre de bucles, ya que el router no
aceptar una ruta que posea un AS por el cual ya atraves.
Por ejemplo, si el paquete viaja desde el AS 52100 al AS 52500 y toma el
camino 52100 52200 52300 52400, al momento de decidir la ruta,
nunca lo enviar de nuevo al 52200, ya que por este ya pas.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
59
Next-hop
Este atributo indica la direccin IP del siguiente salto para alcanzar la
red destino.
El siguiente salto no necesariamente debe estar directamente
conectado, sino que ms bien es la direccin IP del router quien
anunci la red.
Por ejemplo, R3 tiene como Next-hop de la red 10.20.0.0 la direccin IP
192.168.10.1 del R1.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
60
Origin
Indica como fue aprendida la ruta.
Si fue aprendida a partir de un IGP utilizando el comando network, se marca una i
en la tabla de BGP.
Si la ruta fue aprendida por un EGP se marca con una e.
Incomplete, es cuando el origen es desconocido, normalmente ocurre cuando una ruta
es distribuida en BGP y es marcada con un signo ?.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
61
Local Preference
Se utiliza para determinar cul es la salida preferida en el
AS.
Cuando el Local Preference es ms alto, posee mayor
prioridad, por lo tanto es mejor.
Este atributo es enviado solo entre peers IBGP dentro del
mismo AS local y no es enviado entre peers EBGPs.
Para routers Cisco el local preference por defecto es 100.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
62
Community
Este atributo es utilizado para realizar un filtrado de rutas.
A las rutas de la comunidad se les asigna un TAG, para a
partir de l, poder tomar decisiones de filtrado de rutas
pertenecientes a la etiqueta.
Esto nos ayuda a tener un mejor control, ya que las
comunidades comparten polticas similares.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
63
MED (Multiexit-discriminator)
Este atributo informa a los vecinos externos por cul de las salidas del AS local se
prefiere que sean alcanzadas las redes locales, en otras palabras cual es la entrada
preferida a la red.
El menor valor MED es el preferido, por lo tanto posee mayor prioridad.
Este atributo es enviado entre los vecinos EBGP y por defecto es 0.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
64
WEIGHT
Este atributo es utilizado en el proceso de seleccin de ruta, tiene significancia
local, por lo tanto no es propagado hacia los vecinos.
Su valor se establece entre 0 y 65535.
Cuando existen mltiples rutas hacia un destino, la ruta con weight ms alto
ser la preferida.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
65
Cisco Public
66
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
67
Cisco Public
68
Cisco Public
69
Cisco Public
70
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
71
BGP. Topologa.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
72
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
73
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
74
BGP. traceroute
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
75
BGP. ISP3
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
76
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
77
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
78
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
79
Filtros de rutas
BGP
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
80
Distribute List
Prefix Lists
AS-Path Access Lists (filter-list)
Route Maps
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
81
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
82
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
83
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
84
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
85
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
86
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
87
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
88
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
89
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
90
Route Maps
Se pueden aplicar varios atributos de BGP:
Origin
Next hop
Community
Local preference
MED
Otros:
Network number and subnet mask (with an IP prefix list)
Route originator
Tag an IGP route
AS-path
Route type (internal or external)
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
91
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
92
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
93
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
94
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
95
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
96
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
97
Peer Group
Router(config-router)#neighbor peer-groupname peer-group
Router(config-router)#neighbor ip-address
peer-group peer-group-name
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
98
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
99
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
100
Implementing
BGP for IPv6
Internet
Connectivity
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
101
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
102
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
103
MP-BGP
MP-BGP can, of course, operate with multiple protocols. It
operates by identifying two separate protocols: the carrier
protocol and the passenger protocol.
In an all-IPv4 environment, BGP establishes sessions using
IPv4 (using TCP port 179); IPv4 is the carrier protocol.
The routes that BGP advertises, which is the passenger
protocol, are also IPv4.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
104
MP-BGP
Protocols other than IPv4, including IPv6, also need to
advertise reachability information.
MP-BGP extensions allow these other protocols to be
carried using BGP.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
105
MP-BGP
In an all-IPv6 environment, BGP can be used as both the
carrier and passenger protocol.
In this case, IPv6 is used to establish BGP sessions, and
BGP advertises IPv6 prefixes.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
106
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
107
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
108
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
109
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
110
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
111
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
112
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
113
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
114
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
115
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
116
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
117
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
118
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
119
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
120
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
121
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
122
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
123
Cisco Public
124
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
125
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
126
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
127
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
128
Cisco Public
129
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
130
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
131
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
132
Appendix C
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
133
BGP Supplement
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
134
Aggregator
An optional transitive attribute that specifies the BGP router ID and
autonomous system number of the router that performed the route
aggregation
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
135
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
136
Cisco Public
137
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
138
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
139
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
140
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
141
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
142
Compare
Notice the difference between the aggregate-address and
the network command:
The aggregate-address command aggregates only
networks that are already in the BGP table .
With the BGP network command, the network must exist in
the IP routing table for the summary network to be
advertised.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
143
Cisco Public
144
aggregate-address Example
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
145
aggregate-address Example
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
146
Communities
The BGP communities function allows routers to tag routes
with an indicator (the community) and allows other routers
to make decisions (filter) based on that tag.
BGP communities are used for destinations (routes) that
share some common properties and that, therefore, share
common policies.
Routers, therefore, act on the community, rather than on
individual routes.
Communities are not restricted to one network or
autonomous system, and they have no physical boundaries.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
147
Community Attribute
The community attribute is an optional transitive attribute. If
a router does not understand the concept of communities, it
passes it on to the next router. However, if the router does
understand the concept, it must be configured to propagate
the community. Otherwise, communities are dropped by
default.
Each network can be a member of more than one
community.
The community attribute is a 32-bit number.
The upper 16 bits indicate the autonomous system number
of the autonomous system that defined the community.
The lower 16 bits are the community number and have local
significance.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
148
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
149
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
150
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
151
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
152
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
153
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
154
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
155
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
156
Route Reflectors
BGP specifies that routes learned via iBGP are never
propagated to other iBGP peers.
The result is that a full mesh of iBGP peers is required
within an autonomous system.
With only 13 routers, 78 iBGP sessions would need to be
maintained.
As the number of routers increases, so does the number of
sessions required, governed by the following formula, in
which n is the number of routers:
Number of iBGP sessions = n ( n 1) / 2
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
157
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
158
Route Reflectors
In addition to the number of BGP TCP sessions that must be
created and maintained, the amount of routing traffic might also be a
problem.
Depending on the autonomous system topology, traffic might be
replicated many times on some links as it travels to each iBGP peer.
For example, if the physical topology of a large autonomous system
includes some WAN links, the iBGP sessions running over those
links might consume a significant amount of bandwidth.
A solution to this problem is the use of route reflectors (RRs).
This section describes what an RR is, how it works, and how to
configure it.
RRs modify the BGP rule by allowing the router configured as the
RR to propagate routes learned by iBGP to other iBGP peers
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
159
Route Reflectors
This saves on the number of BGP TCP sessions that must
be maintained and also reduces the BGP routing traffic.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
160
Cisco Public
161
Clients:
Routers peering with the RR has a partial iBGP
Peering between the clients is not needed, because the route reflector passes
advertisements between the clients.
Cluster:
The combination of the RR and its clients
Nonclients:
Other iBGP peers of the RR that are not clients
Originator ID:
Is an optional, nontransitive BGP attribute that is created by the RR.
This attribute carries the router ID of the routes originator in the local autonomous
system.
If the update comes back to the originator because of poor configuration, the
originator ignores it.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
162
Cluster list
Is a sequence of cluster IDs that the route has passed. When an RR reflects a route
from its clients to nonclients outside the cluster, it appends the local cluster ID to the
cluster list. If the update has an empty cluster list, the RR creates one.
Using this attribute, an RR can tell whether the routing information is looped back to the
same cluster because of poor configuration.
If the local cluster ID is found in an advertisements cluster list, the advertisement is
ignored.
The originator ID, cluster ID, and cluster list help prevent routing loops in RR
configurations.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
163
Cisco Public
164
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
165
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
166
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
167
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
168
Cisco Public
169
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
170
Cisco Public
171
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
172
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
173
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
174
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
175
Chapter 7 Summary
BGP terminology and concepts, including the following:
BGPs use between autonomous systems and how it is different than other
routing protocols described in this book
BGPs classification as a path vector protocol and its use of TCP protocol 179
BGPs loop-free guarantee, because it does not accept a routing update that
already includes its autonomous system number in the AS-path list
The three tables used by BGP: the BGP table, IP routing table, and BGP
neighbor table
The four BGP message types: open, keepalive, update, and notification
When to use BGP: if the autonomous system allows packets to transit through
it to reach other autonomous systems, if the autonomous system has multiple
connections to other autonomous systems, or if the routing policy and route
selection for traffic entering and leaving the autonomous system must be
manipulated
The use of full-mesh iBGP on all routers in the transit path within the
autonomous system
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
176
Chapter 7 Summary
When not to use BGP: if there is only a single connection to
the Internet or another autonomous system, if edge routers
have a lack of memory or processing power, if you have a
limited understanding of route filtering and the BGP pathselection process, or if the routing policy that will be
implemented in an autonomous system is consistent with the
policy implemented in the ISP autonomous system
BGP neighbor (peer) relationships:
iBGP, when BGP runs between routers in the same
autonomous system
eBGP, when BGP runs between routers that are in different
autonomous systems.
eBGP neighbors are typically directly connected .
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
177
Chapter 7 Summary
Basic BGP configuration, including the relationship between the
BGP table, the IP routing table and the network command: The
network command allows a BGP router to inject a network that is in
its IP routing table into its BGP table and advertise that network to
its BGP neighbors. BGP neighbors exchange their best BGP routes.
The neighbor router that receives that network information puts the
information in its BGP table and selects its best BGP route for that
network. The best route is offered to its IP routing table.
Using BGP features, including next-hop-self, update source, and
eBGP multihop.
Understanding and troubleshooting the BGP states: idle, connect,
active, open sent, open confirm, and established.
Performing hard and soft resets of BGP sessions, required after a
neighbor policy is changed.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
178
Chapter 7 Summary
The BGP attributes that can be either well-known or optional,
mandatory or discretionary, and transitive or nontransitive. An
attribute might also be partial. The BGP attributes are the following:
AS-path: Well-known mandatory. The list of autonomous system numbers that a
route has traversed to reach a destination, with the number of the autonomous
system that originated the route at the end of the list.
Next hop: Well-known mandatory. Indicates the next-hop IP address that is to be
used to reach a destination. For eBGP, the next hop is the IP address of the
neighbor that sent the update; for iBGP, the next hop advertised by eBGP is
carried into iBGP by default.
Origin: Well-known mandatory. Defines the origin of the path information; can be
IGP, EGP, or incomplete.
Local preference: Well-known discretionary. Indicates to routers in the
autonomous system which path is preferred to exit the autonomous system. The
path with a higher local preference is preferred. Sent only to iBGP neighbors.
Atomic aggregate: Well-known discretionary. Informs the neighbor autonomous
system that the originating router has aggregated the routes.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
179
Chapter 7 Summary
Aggregator: Optional transitive. Specifies the BGP router ID and
autonomous system number of the router that performed the route
aggregation.
Community: Optional transitive. Allows routers to tag routes with an
indicator (the community) and allows other routers to make decisions
based on that tag.
MED: Optional nontransitive. Also called metric. Indicates to external
neighbors the preferred path into an autonomous system. A lower
value is preferred; exchanged between autonomous systems.
Weight: Cisco defined; provides local routing policy only and is not
propagated to any BGP neighbors. Routes with a higher weight are
preferred.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
180
Chapter 7 Summary
The 11-step BGP route-selection decision process is as
follows:
1. Prefer the highest weight.
2. Prefer the highest local preference.
3. Prefer the route originated by the local router.
4. Prefer the shortest AS-path.
5. Prefer the lowest origin code.
6. Prefer the lowest MED.
7. Prefer the eBGP path over the iBGP path.
8. Prefer the path through the closest IGP neighbor.
9. Prefer the oldest route for eBGP paths.
10. Prefer the path with the lowest neighbor BGP router ID.
11. Prefer the route with the lowest neighbor IP address.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
181
Chapter 7 Summary
Verifying BGP configuration.
BGP path manipulation and filtering, including changing the
weight, local preference, AS-path, and MED attributes.
Prefix lists, distribute lists, filter lists, and route maps may
be used.
Configuring BGP peer groups, a group of BGP neighbors of
the router being configured that all have the same update
policies.
Implementing MP-BGP for IPv6, including the following:
Exchanging IPv6 routes over an IPv4 session
Exchanging IPv6 routes over an IPv6 session
BGP filtering mechanisms used for IPv6.
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
182
Chapter 7 Labs
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
183
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
184
Acknowledgment
Some of images and texts are from Implementing Cisco IP Routing (ROUTE)
Foundation Learning Guide by Diane Teare, Bob Vachon and Rick Graziani
(1587204568)
Copyright 2015 2016 Cisco Systems, Inc.
Special Thanks to Bruno Silva
Chapter 7
2007 2016, Cisco Systems, Inc. All rights reserved.
Cisco Public
185