CCNP ROUTE LABORATORIO BGP 01

Enviado por dpacheco el Vie, 09/12/2016 - 23:47
Topología
Topologia BGP Lab 01 v2.2
Resumen de la actividad:
Este laboratorio considera la aplicación de contenidos analizados en la certificación de CCNP ROUTE. En esta actividad se interconectan 2 Sistemas autónomos que representan a 2 proveedores de servicios (AS 210 y AS 220). Además, se realiza la conexión de 2 clientes a estos proveedores de servicios (AS 214 y AS 215). Se realizará el establecimiento de sesiones BGP, propagación de rutas y configuración de atributos.
Objetivo(s):
01 Creación de sesiones iBGP (Full-Mesh) y verificacion del funcionamiento de BGP en AS 210
02 Creación de sesiones iBGP (Route-Reflector) y verificacion del funcionamiento de BGP en AS 220.
03 Creación de sesion eBGP entre los AS 210 y AS 220 y verificacion del intercambio de prefijos.
04 Crear sesion eBGP entre los AS 210 y AS 220 usando las Loopback
05 Establecimiento de sesiones eBGP de los clientes CLI01 y CLI02 con los proveedores de servicio
06 Sumarizacion de prefijos y propagacion de una ruta por defecto
07 Configuracion y verificacion del atributo weight
08 Configuracion y verificacion del atributo as-path
09 Configuracion y verificacion del atributo local-preference
10 Configuracion y verificacion del atributo MED
Recursos Utilizados:
Cisco IOS Software, 7200 Software (C7200-ADVIPSERVICESK9-M), Version 15.2(4)S5, RELEASE SOFTWARE (fc1)
Desarrollo de la actividad:
01 Creación sesiones iBGP en el AS 210 para el intercambio de prefijos usando full-mesh
En este ejemplo se crearán las sesiones de iBGP usando full-mesh en el AS 210. El uso de Full-Mesh es necesario para que se intercambien los prefijos de DP1 y DP3 entre ellos. Además se utilizará EIGRP como IGP para que se comuniquen DP1 y DP3 y puedan establecer la sesión.
DP1(config)#router bgp 210
DP1(config-router)#neighbor 210.12.0.2 remote-as 210
DP1(config-router)#network 210.1.0.0 mask 255.255.255.0
DP1(config-router)#network 210.1.1.0 mask 255.255.255.0
DP1(config-router)#router bgp 210
DP1(config-router)#neighbor 210.23.0.3 remote-as 210
DP1(config-router)#router ospf 1
DP1(config-router)#netw 210.12.0.0 0.0.0.255 area 0
DP2(config)#router bgp 210
DP2(config-router)# neighbor 210.12.0.1 remote-as 210
DP2(config-router)# neighbor 210.23.0.3 remote-as 210
DP2(config-router)#network 210.2.0.0 mask 255.255.255.0
DP2(config-router)#router ospf 1
DP2(config-router)#netw 210.12.0.0 0.0.0.255 area 0
DP2(config-router)#netw 210.23.0.0 0.0.0.255 area 0
DP3(config)#router bgp 210
DP3(config-router)#neighbor 210.23.0.2 remote-as 210
DP3(config-router)#network 210.3.0.0 mask 255.255.255.0
DP3(config-router)#router bgp 210
DP3(config-router)#neighbor 210.12.0.1 remote-as 210
DP3(config-router)#router ospf 1
DP3(config-router)#netw 210.23.0.0 0.0.0.255 area 0
Verificacion de sesiones e intercambio de prefijos en el AS 210
Para la verificación del funcionamiento, utilizaremos 3 comandos:
show ip bgp summary: Se puede observar que las 2 sesiones se encuentran establecidas, y ambos vecinos entregan 1 prefijo a DP1.
show ip bgp: Se observan los prefijos recibidos y el siguiente salto para cada uno de ellos.
show ip route bgp: Se observa la instalación de estos prefijos en la tabla de rutas.

DP1#show ip bgp summary
BGP router identifier 210.1.1.1, local AS number 210
BGP table version is 5, main routing table version 5
4 network entries using 576 bytes of memory
4 path entries using 320 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1168 total bytes of memory
BGP activity 4/0 prefixes, 4/0 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
210.12.0.2 4 210 15 15 5 0 0 00:10:17 1
210.23.0.3 4 210 14 15 5 0 0 00:09:29 1
DP1#show ip bgp
BGP table version is 5, local router ID is 210.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 210.1.0.0 0.0.0.0 0 32768 i
*> 210.1.1.0 0.0.0.0 0 32768 i
*>i 210.2.0.0 210.12.0.2 0 100 0 i
*>i 210.3.0.0 210.23.0.3 0 100 0 i
DP1#show ip route bgp
Codes: L - local, 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, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is not set

B 210.2.0.0/24 [200/0] via 210.12.0.2, 00:11:37
B 210.3.0.0/24 [200/0] via 210.23.0.3, 00:11:35
02 Creación sesiones iBGP en el AS 220 para el intercambio de prefijos usando route-reflector
Creación sesiones iBGP en el AS 220 para el intercambio de prefijos usando route-reflector
En este ejemplo se crearán las sesiones de iBGP usando route-reflector en el AS 220. El uso de route-reflector es necesario para que se reenvíen los prefijos de DP4 a DP6. Además, se utilizará OSPF como IGP para que se conozcan los next-hop entre DP4 y DP6.
DP4(config)#router bgp 220
DP4(config-router)#neighbor 220.45.0.5 remote-as 220
DP4(config-router)#network 220.4.0.0 mask 255.255.255.0
DP4(config-router)#router eigrp 220
DP4(config-router)#netw 220.45.0.0
DP5(config-if)#router bgp 220
DP5(config-router)#neighbor 220.45.0.4 remote-as 220
DP5(config-router)#neighbor 220.56.0.6 remote-as 220
DP5(config-router)#network 220.5.0.0 mask 255.255.255.0
DP5(config-router)#router bgp 220
DP5(config-router)#neighbor 220.45.0.4 route-reflector-client
DP5(config-router)#neighbor 220.56.0.6 route-reflector-client
DP5(config-router)#router eigrp 220
DP5(config-router)#netw 220.45.0.0
DP5(config-router)#netw 220.56.0.0
DP6(config)#router bgp 220
DP6(config-router)#neighbor 220.56.0.5 remote-as 220
DP6(config-router)#network 220.6.0.0 mask 255.255.255.0
DP6(config-router)#network 220.6.1.0 mask 255.255.255.0
DP6(config-router)#router eigrp 220
DP6(config-router)#netw 220.56.0.0
Verificacion de sesiones e intercambio de prefijos en el AS 220
En este caso solo se verificara la instalación de los prefijos en la tabla de rutas, en caso de falla también puede utilizar los comandos indicados anteriormente para la verificación (show ip bgp y show ip bgp summary)
DP6#show ip route bgp
Codes: L - local, 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, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is not set

B 220.4.0.0/24 [200/0] via 220.45.0.4, 00:02:40
B 220.5.0.0/24 [200/0] via 220.56.0.5, 00:02:40
03 Creacion de sesion eBGP entre los AS 210 y AS 220.
Debido a que existen 2 enlaces entre el AS 210 y AS 220, se creará la sesión eBGP entre 2 interfaces loopback para crear solo una sesión de eBGP.
Antes de crear esta sesión eBGP es necesario tener conectividad entre ambas interfaces loopback, para este ejemplo utilizaremos enrutamiento estático para comunicar ambas interfaces.
Luego además de indicar el vecino de la sesión, es necesario indicar la dirección de origen de la sesión (update source) y aumentar el TTL (ebgp-multi hop) para la sesión.
Además para que las rutas sean visibles e instaladas en las tablas de rutas de los otros routers del sistema autónomo es necesario que se cambien los next-hop en las sesiones iBGP
DP3(config)#ip route 4.4.4.4 255.255.255.255 200.210.220.4
DP3(config)#ip route 4.4.4.4 255.255.255.255 200.220.210.4 2
DP3(config)#router bgp 210
DP3(config-router)#neighbor 4.4.4.4 remote-as 220
DP3(config-router)#neighbor 4.4.4.4 ebgp-multihop 2
DP3(config-router)#neighbor 4.4.4.4 update-source loopback 10
DP3(config-router)#
DP3(config-router)#router bgp 210
DP3(config-router)# neighbor 210.12.0.1 next-hop-self
DP3(config-router)# neighbor 210.23.0.2 next-hop-self
DP4(config)#ip route 3.3.3.3 255.255.255.255 200.220.210.3
DP4(config)#ip route 3.3.3.3 255.255.255.255 200.210.220.3 2
DP4(config)#router bgp 220
DP4(config-router)#neighbor 3.3.3.3 remote-as 210
DP4(config-router)#neighbor 3.3.3.3 ebgp-multihop 2
DP4(config-router)#neighbor 3.3.3.3 update-source loopback 10
DP4(config-router)#
DP4(config-router)#router bgp 220
DP4(config-router)# neighbor 220.45.0.5 next-hop-self
Verificacion del funcionamiento de BGP entre los AS 210 y AS 220
Para verificar el intercambio de prefijos entre ambos AS se verificará la tabla de rutas en DP1 y se probará conectividad con DP6.
DP1#show ip route bgp
Codes: L - local, 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, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is not set

B 210.2.0.0/24 [200/0] via 210.12.0.2, 00:52:43
B 210.3.0.0/24 [200/0] via 210.23.0.3, 00:52:41
B 220.4.0.0/24 [200/0] via 210.23.0.3, 00:12:39
B 220.5.0.0/24 [200/0] via 210.23.0.3, 00:12:39
B 220.6.0.0/24 [200/0] via 210.23.0.3, 00:12:39
B 220.6.1.0/24 [200/0] via 210.23.0.3, 00:12:39
DP1#ping 220.6.0.1 source 210.1.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 220.6.0.1, timeout is 2 seconds:
Packet sent with a source address of 210.1.0.1
!!!!!
04 Establecimiento y verificación de sesiones eBGP de CLI01 y CLI02 con los AS 210 y 220
Se crearan las sesiones de eBGP de los clientes con los proveedores de servicio (AS210 y AS220). Ademas se usara el comando next-hop self donde sea necesario.
Luego se verificaran los prefijos recibidos en ambos clientes.
DP1(config)#router bgp 210
DP1(config-router)#neighbor 200.214.210.2 remote-as 214
DP1(config-router)#neighbor 210.12.0.2 next-hop-self
DP1(config-router)#neighbor 210.23.0.3 next-hop-self

DP6(config)#router bgp 220
DP6(config-router)#neighbor 200.214.220.2 remote-as 214
DP6(config-router)#neighbor 220.56.0.5 next-hop-self

CLI01(config-if)#router bgp 214
CLI01(config-router)#neighbor 200.214.210.1 remote-as 210
CLI01(config-router)#neighbor 200.214.220.1 remote-as 220
CLI01(config-router)#network 214.0.0.0
CLI01(config-router)#network 214.0.1.0
DP4(config)#router bgp 220
DP4(config-router)#neighbor 200.215.220.2 remote-as 215
DP4(config-router)#neighbor 200.215.220.2 default-originate

DP6(config)#router bgp 220
DP6(config-router)#neighbor 200.220.215.2 remote-as 215
DP6(config-router)#neighbor 200.220.215.2 default-originate

CLI02A(config)#router bgp 215
CLI02A(config-router)#neighbor 200.220.215.1 remote-as 220
CLI02A(config-router)#neighbor 215.10.20.2 remote-as 215
CLI02A(config-router)#network 215.10.0.0
CLI02A(config-router)#neighbor 215.10.20.2 next-hop-self

CLI02B(config)#router bgp 215
CLI02B(config-router)#neighbor 200.215.220.1 remote-as 220
CLI02B(config-router)# neighbor 215.10.20.1 remote-as 215
CLI02B(config-router)#network 215.20.0.0
CLI02B(config-router)#neighbor 215.10.20.1 next-hop-self
CLI01#show ip bgp
BGP table version is 13, local router ID is 214.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* 210.1.0.0 200.214.220.1 0 220 210 i
*> 200.214.210.1 0 0 210 i
* 210.1.1.0 200.214.220.1 0 220 210 i
*> 200.214.210.1 0 0 210 i
* 210.2.0.0 200.214.220.1 0 220 210 i
*> 200.214.210.1 0 210 i
* 210.3.0.0 200.214.220.1 0 220 210 i
*> 200.214.210.1 0 210 i
*> 214.0.0.0 0.0.0.0 0 32768 i
*> 214.0.1.0 0.0.0.0 0 32768 i
* 215.10.0.0 200.214.210.1 0 210 220 215 i
*> 200.214.220.1 0 220 215 i
* 215.20.0.0 200.214.210.1 0 210 220 215 i
*> 200.214.220.1 0 220 215 i
*> 220.4.0.0 200.214.220.1 0 220 i
* 200.214.210.1 0 210 220 i
*> 220.5.0.0 200.214.220.1 0 220 i
* 200.214.210.1 0 210 220 i
*> 220.6.0.0 200.214.220.1 0 0 220 i
* 200.214.210.1 0 210 220 i
*> 220.6.1.0 200.214.220.1 0 0 220 i
* 200.214.210.1 0 210 220 i
CLI02A#show ip bgp
BGP table version is 25, local router ID is 215.10.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 200.220.215.1 0 220 i
* i 215.10.20.2 0 100 0 220 i
*> 210.1.0.0 200.220.215.1 0 220 210 i
* i 215.10.20.2 0 100 0 220 210 i
*> 210.1.1.0 200.220.215.1 0 220 210 i
* i 215.10.20.2 0 100 0 220 210 i
*> 210.2.0.0 200.220.215.1 0 220 210 i
* i 215.10.20.2 0 100 0 220 210 i
*> 210.3.0.0 200.220.215.1 0 220 210 i
* i 215.10.20.2 0 100 0 220 210 i
*> 214.0.0.0 200.220.215.1 0 220 214 i
* i 215.10.20.2 0 100 0 220 214 i
*> 214.0.1.0 200.220.215.1 0 220 214 i
* i 215.10.20.2 0 100 0 220 214 i
*> 215.10.0.0 0.0.0.0 0 32768 i
*>i 215.20.0.0 215.10.20.2 0 100 0 i
*> 220.4.0.0 200.220.215.1 0 220 i
* i 215.10.20.2 0 100 0 220 i
*> 220.5.0.0 200.220.215.1 0 220 i
* i 215.10.20.2 0 100 0 220 i
*> 220.6.0.0 200.220.215.1 0 0 220 i
* i 215.10.20.2 0 100 0 220 i
*> 220.6.1.0 200.220.215.1 0 0 220 i
* i 215.10.20.2 0 100 0 220 i

CLI02B#show ip bgp
BGP table version is 14, local router ID is 215.20.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* i 0.0.0.0 215.10.20.1 0 100 0 220 i
*> 200.215.220.1 0 220 i
* i 210.1.0.0 215.10.20.1 0 100 0 220 210 i
*> 200.215.220.1 0 220 210 i
* i 210.1.1.0 215.10.20.1 0 100 0 220 210 i
*> 200.215.220.1 0 220 210 i
* i 210.2.0.0 215.10.20.1 0 100 0 220 210 i
*> 200.215.220.1 0 220 210 i
* i 210.3.0.0 215.10.20.1 0 100 0 220 210 i
*> 200.215.220.1 0 220 210 i
* i 214.0.0.0 215.10.20.1 0 100 0 220 214 i
*> 200.215.220.1 0 220 214 i
* i 214.0.1.0 215.10.20.1 0 100 0 220 214 i
*> 200.215.220.1 0 220 214 i
*>i 215.10.0.0 215.10.20.1 0 100 0 i
*> 215.20.0.0 0.0.0.0 0 32768 i
* i 220.4.0.0 215.10.20.1 0 100 0 220 i
*> 200.215.220.1 0 0 220 i
* i 220.5.0.0 215.10.20.1 0 100 0 220 i
*> 200.215.220.1 0 220 i
* i 220.6.0.0 215.10.20.1 0 100 0 220 i
*> 200.215.220.1 0 220 i
* i 220.6.1.0 215.10.20.1 0 100 0 220 i
*> 200.215.220.1 0 220 i
06 Sumarizacion de prefijos
En este ejemplo realizaremos 2 formas de entregar los prefijos sumarizados.
La primera la realizaremos en el AS 210 en la cual eliminaremos las redes que se publican con mascara 24 y publicaremos solo una red con mascara 23 (para que se publique esta red es necesario que el equipo conozca en su tabla la red con mascara 23, debido a esto configuramos una ruta estática).
La segunda sumarización la realizaremos utilizando el comando aggregate-address con la opción summary-only la cual enviara solo la ruta sumarizada.
Posteriormente verificaremos que las rutas se estén aprendiendo con mascara /23
DP1(config-router)#router bgp 210
DP1(config-router)#no network 210.1.0.0
DP1(config-router)#no network 210.1.1.0
DP1(config-router)#network 210.1.0.0 mask 255.255.254.0
DP1(config-router)#ip route 210.1.0.0 255.255.254.0 null 0
DP6(config-router)#router bgp 220
DP6(config-router)#aggregate-address 220.6.0.0 255.255.254.0 summary-only
CLI01#show ip route bgp | inc /23
B 210.1.0.0/23 [20/0] via 200.214.210.1, 00:05:26
B 220.6.0.0/23 [20/0] via 200.214.220.1, 00:00:49
Propagacion de una ruta por defecto
Realizaremos las configuraciones necesarias para que los proveedores de servicio entreguen una ruta por defecto a los clientes 1 y 2 usando la opción default-originate. Posteriormente verificaremos este cambio en la tabla de rutas.
DP1(config)#router bgp 210
DP1(config-router)#neighbor 200.214.210.2 default-originate

DP4(config-router)#router bgp 220
DP4(config-router)#neighbor 200.215.220.2 default-originate

DP6(config-router)#router bgp 220
DP6(config-router)#neighbor 200.220.215.2 default-originate
DP6(config-router)# neighbor 200.214.220.2 default-originate
CLI01#show ip route bgp | inc 0.0.0.0
Gateway of last resort is 200.214.210.1 to network 0.0.0.0
B* 0.0.0.0/0 [20/0] via 200.214.210.1, 00:01:20

CLI02A#show ip route bgp | inc 0.0.0.0
Gateway of last resort is 200.220.215.1 to network 0.0.0.0
B* 0.0.0.0/0 [20/0] via 200.220.215.1, 00:23:08

CLI02B#show ip route bgp | inc 0.0.0.0
Gateway of last resort is 200.215.220.1 to network 0.0.0.0
B* 0.0.0.0/0 [20/0] via 200.215.220.1, 00:23:48
07 Influenciar el tráfico de salida usando el atributo weight
Para este ejemplo se usará el atributo weight en el CLI01, el cual realizará lo siguiente:
Todas las rutas aprendidas por CLI01 desde el AS 20 se les asignara un weight de 5. Luego, de las rutas informadas por el AS 10 se le asignará un weight de 10 a los siguientes prefijos: 210.1.0.0/23, 220.6.0.0/23 y 0.0.0.0/0; las demás rutas se dejarán con su valor por defecto.
El impacto que tendrá esta configuración será la siguiente:
El tráfico que haga “match” con los prefijos: 210.1.0.0/23, 220.6.0.0/23 y 0.0.0.0/0 preferirá el AS 10 como salida del sistema autónomo y todo el tráfico restante preferirá el AS 20.
CLI01(config)#route-map TRAFOUT1 permit 10
CLI01(config-route-map)# set weight 5
CLI01(config-route-map)#router bgp 214
CLI01(config-router)# neighbor 200.214.220.1 route-map TRAFOUT1 in
CLI01(config-router)#ip prefix-list MASK23-0000 permit 0.0.0.0/0
CLI01(config)#ip prefix-list MASK23-0000 permit 210.1.0.0/23
CLI01(config)#ip prefix-list MASK23-0000 permit 220.6.0.0/23
CLI01(config)# route-map TRAFOUT2 permit 10
CLI01(config-route-map)# match ip address prefix-list MASK23-0000
CLI01(config-route-map)# set weight 10
CLI01(config-route-map)# route-map TRAFOUT2 permit 20
CLI01(config-route-map)#router bgp 214
CLI01(config-router)# neighbor 200.214.210.1 route-map TRAFOUT2 in
Verificación del atributo weight
A continuacion se observa el cambio de los valores en el weight con el comando show ip bgp y con el show ip route se puede observar por que sistema autonomo se enviara el trafico (via 200.214.210.1 para el AS 10 y via 200.214.220.1 para el AS 20)
CLI01#show ip bgp
BGP table version is 25, local router ID is 214.0.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 200.214.210.1 10 210 i
* 200.214.220.1 5 220 i
* 210.1.0.0/23 200.214.220.1 5 220 210 i
*> 200.214.210.1 0 10 210 i
*> 210.2.0.0 200.214.220.1 5 220 210 i
* 200.214.210.1 0 210 i
* 210.3.0.0 200.214.210.1 0 210 i
*> 200.214.220.1 5 220 210 i
*> 214.0.0.0 0.0.0.0 0 32768 i
*> 214.0.1.0 0.0.0.0 0 32768 i
* 215.10.0.0 200.214.210.1 0 210 220 215 i
*> 200.214.220.1 5 220 215 i
* 215.20.0.0 200.214.210.1 0 210 220 215 i
*> 200.214.220.1 5 220 215 i
* 220.4.0.0 200.214.210.1 0 210 220 i
*> 200.214.220.1 5 220 i
* 220.5.0.0 200.214.210.1 0 210 220 i
*> 200.214.220.1 5 220 i
*> 220.6.0.0/23 200.214.210.1 10 210 220 i
* 200.214.220.1 0 5 220 i
CLI01#show ip route bgp
Codes: L - local, 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, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is 200.214.210.1 to network 0.0.0.0

B* 0.0.0.0/0 [20/0] via 200.214.210.1, 00:23:13
B 210.1.0.0/23 [20/0] via 200.214.210.1, 00:23:13
B 210.2.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 210.3.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 215.10.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 215.20.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 220.4.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 220.5.0.0/24 [20/0] via 200.214.220.1, 00:23:13
B 220.6.0.0/23 [20/0] via 200.214.210.1, 00:23:13
08 Influenciar el tráfico de entrada usando el atributo AS-path
Para el siguiente ejemplo se realizará la siguiente configuración:
Se informará que la red 214.0.0.0/24 atraviesa el AS 214 3 veces adicionales hacia el AS 210.
Se informará que la red 214.0.1.0/24 atraviesa el AS 214 3 veces adicionales hacia el AS 220.
Esto generara lo siguiente:
El tráfico con destino la red 214.0.0.0 preferirá el enlace a través del AS 20.
El tráfico con destino la red 214.0.0.0 preferirá el enlace a través del AS 10.
CLI01(config)#ip access-list standard REDL0
CLI01(config-std-nacl)# permit 214.0.0.0 0.0.0.255
CLI01(config-std-nacl)#route-map TRAFIN1 permit 10
CLI01(config-route-map)#match ip address REDL0
CLI01(config-route-map)#set as-path prepend 214 214 214
CLI01(config-route-map)#route-map TRAFIN1 permit 20
CLI01(config-route-map)#router bgp 214
CLI01(config-router)#neighbor 200.214.210.1 route-map TRAFIN1 out
CLI01(config-router)# ip access-list standard REDL1
CLI01(config-std-nacl)# permit 214.0.1.0 0.0.0.255
CLI01(config-std-nacl)#route-map TRAFIN2 permit 10
CLI01(config-route-map)#match ip address REDL1
CLI01(config-route-map)#set as-path prepend 214 214 214
CLI01(config-route-map)#route-map TRAFIN2 permit 20
CLI01(config-route-map)#router bgp 214
CLI01(config-router)#neighbor 200.214.220.1 route-map TRAFIN2 out
Verificación del funcionamiento del atributo AS Path
Como se observa el tráfico con destino la red 210.0.1.0/24 llegara por el AS 10 a través del enlace con DP1 y el con destino la red 210.0.0.0/24 llegara por el AS 20 a través del enlace con DP6
DP1#show ip bgp | inc 214
*>i 214.0.0.0 210.23.0.3 0 100 0 220 214 i
* 200.214.210.2 0 0 214 214 214 214 i
*> 214.0.1.0 200.214.210.2 0 0 214 i
* 200.214.210.2 0 214 220 215 i
* 200.214.210.2 0 214 220 215 i
* 220.4.0.0 200.214.210.2 0 214 220 i
* 200.214.210.2 0 214 220 i
DP1#show ip route bgp | inc 214
B 214.0.0.0/24 [200/0] via 210.23.0.3, 00:18:30
B 214.0.1.0/24 [20/0] via 200.214.210.2, 04:02:28
DP6#show ip bgp | inc 214
*> 0.0.0.0 200.214.220.2 0 214 210 i
* 210.1.0.0/23 200.214.220.2 0 214 210 i
*> 214.0.0.0 200.214.220.2 0 0 214 i
*>i 214.0.1.0 220.45.0.4 0 100 0 210 214 i
* 200.214.220.2 0 0 214 214 214 214 i
DP6#show ip route bgp | inc 214
Gateway of last resort is 200.214.220.2 to network 0.0.0.0
B* 0.0.0.0/0 [20/0] via 200.214.220.2, 02:16:17
B 214.0.0.0/24 [20/0] via 200.214.220.2, 04:00:09
B 214.0.1.0/24 [200/0] via 220.45.0.4, 00:16:44
09 Configuración del atributo local-preference
En este ejemplo le asignaremos el atributo en 150 para las rutas aprendidas a traves del CLI02A para que el trafico de salida del AS 215 prefiera ese equipo.
CLI02A(config-router)#route-map TRAFOUT permit 10
CLI02A(config-route-map)#set local-preference 150
CLI02A(config-route-map)#router bgp 215
CLI02A(config-router)#neighbor 200.220.215.1 route-map TRAFOUT in
Verificacion del atributo local-preference
Para la verificacion del funcionamiento de este atributo, revisaremos la influencia de este en CLI02B. Como se observa todo el trafico de salida se esta enviando hacia CLI02A.
CLI02B#show ip bgp
BGP table version is 28, local router ID is 215.20.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
* 0.0.0.0 200.215.220.1 0 220 i
*>i 215.10.20.1 0 150 0 220 i
* 210.1.0.0/23 200.215.220.1 0 220 210 i
*>i 215.10.20.1 0 150 0 220 210 i
* 210.2.0.0 200.215.220.1 0 220 210 i
*>i 215.10.20.1 0 150 0 220 210 i
* 210.3.0.0 200.215.220.1 0 220 210 i
*>i 215.10.20.1 0 150 0 220 210 i
*>i 214.0.0.0 215.10.20.1 0 150 0 220 214 i
* 200.215.220.1 0 220 214 i
*>i 214.0.1.0 215.10.20.1 0 150 0 220 210 214 i
* 200.215.220.1 0 220 210 214 i
*>i 215.10.0.0 215.10.20.1 0 100 0 i
*> 215.20.0.0 0.0.0.0 0 32768 i
*>i 220.4.0.0 215.10.20.1 0 150 0 220 i
* 200.215.220.1 0 0 220 i
* 220.5.0.0 200.215.220.1 0 220 i
*>i 215.10.20.1 0 150 0 220 i
* 220.6.0.0/23 200.215.220.1 0 220 i
*>i 215.10.20.1 0 150 0 220 i

CLI02B#show ip route bgp
Codes: L - local, 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, su - IS-IS summary, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is 215.10.20.1 to network 0.0.0.0

B* 0.0.0.0/0 [200/0] via 215.10.20.1, 00:10:54
B 210.1.0.0/23 [200/0] via 215.10.20.1, 00:10:54
B 210.2.0.0/24 [200/0] via 215.10.20.1, 00:10:54
B 210.3.0.0/24 [200/0] via 215.10.20.1, 00:10:54
B 214.0.0.0/24 [200/0] via 215.10.20.1, 00:10:54
B 214.0.1.0/24 [200/0] via 215.10.20.1, 00:10:54
B 215.10.0.0/24 [200/0] via 215.10.20.1, 04:53:26
B 220.4.0.0/24 [200/0] via 215.10.20.1, 00:10:54
B 220.5.0.0/24 [200/0] via 215.10.20.1, 00:10:54
B 220.6.0.0/23 [200/0] via 215.10.20.1, 00:10:54
10 Configuracion del atributo MED
En este ejemplo utilizaremos este atributo para que todo el trafico recibido en el AS prefiera router CLI02B para llegar al Sistema Autonomo 215.
CLI02A(config)#route-map TRAFIN permit 10
CLI02A(config-route-map)#set metric 100
CLI02A(config-route-map)#router bgp 215
CLI02A(config-router)#neighbor 200.220.215.1 route-map TRAFIN out

Verificacion del atributo MED
Como se puede observar en DP6, gracias a la métrica entregada por CLI02A el tráfico se reenvía hacia DP5. Lo que influenciara el tráfico a salir por DP4.
DP6#show ip bgp | inc 215
*>i 215.10.0.0 220.45.0.4 0 100 0 215 i
* 200.220.215.2 100 0 215 i
*>i 215.20.0.0 220.45.0.4 0 100 0 215 i
* 200.220.215.2 100 0 215 i
DP6#show ip route | inc 215
200.220.215.0/24 is variably subnetted, 2 subnets, 2 masks
C 200.220.215.0/24 is directly connected, FastEthernet1/0
L 200.220.215.1/32 is directly connected, FastEthernet1/0
B 215.10.0.0/24 [200/0] via 220.45.0.4, 00:06:49
B 215.20.0.0/24 [200/0] via 220.45.0.4, 00:06:49