miércoles, 21 de julio de 2010

Lab MPLS 1.6a MPLS VPN

Sección 5: MPLS VPN

Sitio 1

· Crear la vrf A en R2. Utilizar RD/RT 1:1. Aplicar la vrf A a la interface que apunta a R8. Configurar OSPF 100 area 0 sin elección de DR.

· R8 debe publicar el enlace R8/R9 y su loopback 0.

· Redistribuir mutuamente OSPF/BGP en R2 (PE).

· Crear la vrf A en R3. Utilizar RD/RT 1:1. Aplicar la vrf A a la interface que apunta a R9. Configurar OSPF 100 area 0 sin elección de DR.

· Redistribuir mutuamente OSPF/BGP en R3.

· Si los routers CEs R8/R9 necesitan comunicarse deben utilizar la red MPLS VPN del SP unicamente.

· Si la red del SP falla R8 y R9 se comunicarán directamente a través del enlace backdoor.


Habilitar una VPN MPLS comprende crear una VRF, aplicarla a la interface, configurar un protocolo de enrutamiento para la instancia VRF PE/CE, redistribuir el protocolo VRF dentro de MP-BGP, redistribuir MP-BGP dentro del protocolo VRF.

El comando route-target 1:1 dentro de la VRF A tiene el mismo efecto que configurar:

route-target import 1:1

route-target export 1:1


Ejemplo 5-1
─────────────────────────────────────────────────────────────────
R2
ip vrf A
rd 1:1
route-target export 1:1
route-target import 1:1


R2#show ip vrf A
Name Default RD Interfaces
A 1:1
─────────────────────────────────────────────────────────────────

El comando show ip vrf A muestra que la VRF A ha sido creada pero aun no la hemos activado en la interface.

Ejemplo 5-2
─────────────────────────────────────────────────────────────────

R2
interface FastEthernet0/0
ip vrf forwarding A
ip address 172.16.28.2 255.255.255.0

R2#show ip vrf A
Name Default RD Interfaces
A 1:1 Fa0/0

─────────────────────────────────────────────────────────────────

Configuramos OSPF entre R8 y R2. R2 usará la instancia VRF A para configurar OSPF 100. No se indica si debemos configurar un ID OSPF, pero es recomendable crear uno; muchos procesos para la VRF utilizan el ID OSPF.


Ejemplo 5-3
─────────────────────────────────────────────────────────────────

R2
interface FastEthernet0/0
ip ospf network point-to-point

router ospf 100 vrf A
router-id 2.2.2.2
log-adjacency-changes
network 172.16.28.2 0.0.0.0 area 0

R8
interface FastEthernet0/0
ip ospf network point-to-point

interface FastEthernet0/1
ip ospf network point-to-point

interface Loopback0
ip address 100.0.0.8 255.255.255.255

router ospf 100
router-id 100.0.0.8
log-adjacency-changes
network 100.0.0.8 0.0.0.0 area 0
network 172.16.28.8 0.0.0.0 area 0
network 172.16.89.8 0.0.0.0 area 0

R2#show ip ospf neighbor fastEthernet 0/0
Neighbor ID Pri State Dead Time Address Interface
8.8.8.8 0 FULL/ - 00:00:37 172.16.28.8 FastEthernet0/0

R8#show ip ospf neighbor fastEthernet 0/0
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:32 172.16.28.2 FastEthernet0/0

─────────────────────────────────────────────────────────────────

Redistribuimos BGP dentro de OSPF, y OSPF en MP-BGP y comprobamos que R2 ha instalado las rutas en la tabla BGP y la tabla de enrutamiento VRF A y que tenemos comunicación.


Ejemplo 5-4
─────────────────────────────────────────────────────────────────

R2
router ospf 100 vrf A
redistribute bgp 1 subnets

router bgp 1
address-family ipv4 vrf A
redistribute ospf 100 vrf A match internal external 1 external 2

R2#show bgp vpnv4 unicast rd 1:1
BGP table version is 7, local router ID is 10.0.0.2
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
Route Distinguisher: 1:1 (default for vrf A)
*> 100.0.0.8/32 172.16.28.8 2 32768 ?
*> 172.16.28.0/24 0.0.0.0 0 32768 ?
*> 172.16.89.0/24 172.16.28.8 2 32768 ?



R2#sh ip route vrf A
Routing Table: A
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, 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
Gateway of last resort is not set

100.0.0.0/32 is subnetted, 1 subnets
O 100.0.0.8 [110/2] via 172.16.28.8, 00:03:47, FastEthernet0/0
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.28.0 is directly connected, FastEthernet0/0
O 172.16.89.0 [110/2] via 172.16.28.8, 00:05:15, FastEthernet0/0

R2#ping vrf A 172.16.89.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.89.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/45/84 ms

R2#ping vrf A 100.0.0.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/59/116 ms

─────────────────────────────────────────────────────────────────

· Crear la vrf A en R3. Utilizar RD/RT 1:1. Aplicar la vrf A a la interface que apunta a R9. Configurar OSPF 100 area 0 sin elección de DR.

· Redistribuir mutuamente OSPF/BGP en R3.



Ejemplo 5-5
─────────────────────────────────────────────────────────────────

R3
ip vrf A
rd 1:1
route-target export 1:1
route-target import 1:1

interface FastEthernet0/0
ip vrf forwarding A
ip address 172.16.39.3 255.255.255.0
ip ospf network point-to-point

R3#ping vrf A 172.16.39.9
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.39.9, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 12/48/120 ms

─────────────────────────────────────────────────────────────────


Configuramos OSPF 100 R3/R9 y redistribuimos mutuamente BGP/OSPF en R3.

Ejemplo 5-6
─────────────────────────────────────────────────────────────────

R3
router ospf 100 vrf A
router-id 3.3.3.3
log-adjacency-changes
redistribute bgp 1 subnets
network 172.16.39.3 0.0.0.0 area 0

router bgp 1
address-family ipv4 vrf A
redistribute ospf 100 vrf A match internal external 1 external 2


R9
interface FastEthernet0/0
ip ospf network point-to-point

interface FastEthernet0/1
ip ospf network point-to-point

interface Loopback0
ip address 100.0.0.9 255.255.255.255

router ospf 100
router-id 100.0.0.9
log-adjacency-changes
network 100.0.0.9 0.0.0.0 area 0
network 172.16.39.9 0.0.0.0 area 0
network 172.16.89.9 0.0.0.0 area 0

R3#show ip ospf 100 neighbor
Neighbor ID Pri State Dead Time Address Interface
100.0.0.9 0 FULL/ - 00:00:38 172.16.39.9 FastEthernet0/0

R9#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/ - 00:00:36 172.16.39.3 FastEthernet0/0
100.0.0.8 0 FULL/ - 00:00:37 172.16.89.8 FastEthernet0/1

─────────────────────────────────────────────────────────────────

· Si los routers CEs R8/R9 necesitan comunicarse deben utilizar la red MPLS VPN del SP unicamente.

· Si la red del SP falla R8 y R9 se comunicarán directamente a través del enlace Backdoor.

Podemos ver que el comportamiento no es el deseado. El Ejemplo 5-7 muestra que el envío de LSAs se realiza entre CEs R8/R9 (backdoor) y los servicios MPLS VPN del SP se reduce a un enlace de respaldo.

R2 alcanza el prefijo 100.0.0.9/32 por R8 y no a través de R3. El mismo caso si R3 debe alcanzar el prefijo 100.0.0.8/32 de R8.


Ejemplo 5-7
─────────────────────────────────────────────────────────────────
R2#show bgp vpnv4 unicast rd 1:1
BGP table version is 11, local router ID is 10.0.0.2
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf A)
* i100.0.0.8/32 10.0.0.3 3 100 0 ?
*> 172.16.28.8 2 32768 ?
* i100.0.0.9/32 10.0.0.3 2 100 0 ?
*> 172.16.28.8 3 32768 ?
* i172.16.28.0/24 10.0.0.3 3 100 0 ?
*> 0.0.0.0 0 32768 ?
* i172.16.39.0/24 10.0.0.3 0 100 0 ?
*> 172.16.28.8 3 32768 ?
* i172.16.89.0/24 10.0.0.3 2 100 0 ?
*> 172.16.28.8 2 32768 ?


R2#traceroute vrf A 100.0.0.9
1 172.16.28.8 60 msec 28 msec 44 msec
2 172.16.89.9 44 msec * 68 msec

R3#show bgp vpnv4 unicast rd 1:1
BGP table version is 11, local router ID is 10.0.0.3
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
Route Distinguisher: 1:1 (default for vrf A)
*> 100.0.0.8/32 172.16.39.9 3 32768 ?
* i 10.0.0.2 2 100 0 ?
*> 100.0.0.9/32 172.16.39.9 2 32768 ?
* i 10.0.0.2 3 100 0 ?
*> 172.16.28.0/24 172.16.39.9 3 32768 ?
* i 10.0.0.2 0 100 0 ?
* i172.16.39.0/24 10.0.0.2 3 100 0 ?
*> 0.0.0.0 0 32768 ?
*> 172.16.89.0/24 172.16.39.9 2 32768 ?
* i 10.0.0.2 2 100 0 ?

R3#traceroute vrf A 100.0.0.8
1 172.16.39.9 40 msec 68 msec 40 msec
2 172.16.89.8 44 msec * 76 msec

R9#sh ip route ospf
100.0.0.0/32 is subnetted, 2 subnets
O 100.0.0.8 [110/2] via 172.16.89.8, 00:29:10, FastEthernet0/1
172.16.0.0/24 is subnetted, 3 subnets
O 172.16.28.0 [110/2] via 172.16.89.8, 00:29:10, FastEthernet0/1

R8#sh ip route ospf
100.0.0.0/32 is subnetted, 2 subnets
O 100.0.0.9 [110/2] via 172.16.89.9, 00:29:30, FastEthernet0/1
172.16.0.0/24 is subnetted, 3 subnets
O 172.16.39.0 [110/2] via 172.16.89.9, 00:29:20, FastEthernet0/1

R8#show ip ospf database
OSPF Router with ID (100.0.0.8) (Process ID 100)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 229 0x80000006 0x00F5F4 2
3.3.3.3 3.3.3.3 1783 0x80000003 0x003F8E 2
100.0.0.8 100.0.0.8 1798 0x80000007 0x00BB87 5
100.0.0.9 100.0.0.9 1783 0x80000004 0x00AC7B 5

R9#show ip ospf database
OSPF Router with ID (100.0.0.9) (Process ID 100)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 252 0x80000006 0x00F5F4 2
3.3.3.3 3.3.3.3 1804 0x80000003 0x003F8E 2
100.0.0.8 100.0.0.8 1820 0x80000007 0x00BB87 5
100.0.0.9 100.0.0.9 1803 0x80000004 0x00AC7B 5

─────────────────────────────────────────────────────────────────

Para alcanzar las redes del router R8, R9 usa el nex-hop 172.16.89.8, y R8 el next-hop 172.16.89.9. Esto se debe a que las rutas que se intercambian R8 y R9 son del tipo 1 y tipo 2 (Intra-area). Las rutas a través de la nube MPLS VPN son Inter-area (OSPF siempre prefiere las rutas Intra-Area por sobre las Inter-Area). El ejemplo 5-8 muestra el comportamiento si el enlace directo R8/R9 cae.

El enlace backdoor está abajo y R8 y R9 aprenden las rutas a través del backbone del proveedor pero ahora son del tipo Inter-Area (IA). Como es de esperar, el next-hop para los CEs es el router del SP directamente conectado.



Ejemplo 5-8
─────────────────────────────────────────────────────────────────
R8(config)#interface fastEthernet 0/1
R8(config-if)#shutdown
%OSPF-5-ADJCHG: Process 100, Nbr 9.9.9.9 on FastEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached

R8#sh ip route ospf
100.0.0.0/32 is subnetted, 2 subnets
O IA 100.0.0.9 [110/3] via 172.16.28.2, 00:00:40, FastEthernet0/0
172.16.0.0/24 is subnetted, 3 subnets
O IA 172.16.39.0 [110/2] via 172.16.28.2, 00:00:40, FastEthernet0/0
O IA 172.16.89.0 [110/3] via 172.16.28.2, 00:00:40, FastEthernet0/0

R9#sh ip route ospf
100.0.0.0/32 is subnetted, 2 subnets
O IA 100.0.0.8 [110/3] via 172.16.39.3, 00:00:00, FastEthernet0/0
172.16.0.0/24 is subnetted, 3 subnets
O IA 172.16.28.0 [110/2] via 172.16.39.3, 00:00:00, FastEthernet0/0

R8(config)#interface fastEthernet 0/1
R8(config-if)# no shutdown

─────────────────────────────────────────────────────────────────

¿Como podemos lograr que los routers del cliente se comuniquen utilizando el backbone? Existe un feature llamado Sham-Link (falso enlace) que permite convertir las rutas IA del SP en Intra-Areas (O) dentro del backbone.

Veremos paso a paso la configuración del enlace Sham-Link.

Primero debemos crear, y publicar en BGP una loopback en cada PE extremo que será empleado como ID del Sham-Link (con network o redistributed connected, sin embargo, con el primer método tenemos mayor control de lo que publicamos).

Tener presente que estamos tratando con VPNs, los ID que creemos deben estar asociado a la VRF correspondiente.


Ejemplo 5-9
─────────────────────────────────────────────────────────────────

R2
interface Loopback20
ip vrf forwarding A
ip address 20.0.0.2 255.255.255.255

router ospf 100 vrf A
area 0 sham-link 20.0.0.2 30.0.0.3 cost 2

router bgp 1
address-family ipv4 vrf A
redistribute ospf 100 vrf A match internal external 1 external 2
network 20.0.0.2 mask 255.255.255.255


R3
interface Loopback30
ip vrf forwarding A
ip address 30.0.0.3 255.255.255.255

router ospf 100 vrf A
area 0 sham-link 30.0.0.3 20.0.0.2 cost 2

router bgp 1
address-family ipv4 vrf A
redistribute ospf 100 vrf A match internal external 1 external 2
network 30.0.0.3 mask 255.255.255.255

─────────────────────────────────────────────────────────────────

Comprobamos que los IDs estén en las tablas BGP de cada router PE.

Ejemplo 5-10
─────────────────────────────────────────────────────────────────

R2#show bgp vpnv4 unicast rd 1:1 30.0.0.3
BGP routing table entry for 1:1:30.0.0.3/32, version 699
Paths: (1 available, best #1, table A)
Flag: 0x820
Not advertised to any peer
Local
10.0.0.3 (metric 3) from 10.0.0.3 (10.0.0.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:1
mpls labels in/out nolabel/3008


R3#show bgp vpnv4 unicast rd 1:1 20.0.0.2
BGP routing table entry for 1:1:20.0.0.2/32, version 639
Paths: (1 available, best #1, table A)
Flag: 0x820
Not advertised to any peer
Local
10.0.0.2 (metric 3) from 10.0.0.2 (10.0.0.2)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:1
mpls labels in/out nolabel/2009

─────────────────────────────────────────────────────────────────

No hay comentarios:

Publicar un comentario