RP/0/0/CPU0:ARS1#sh run
hostname ASR1
! Creacion de la VRF
! Creacion de la VRF
vrf AAA
address-family ipv4 unicast
import route-target
333:3
!
export route-target
333:3
!
!
!
interface Loopback0
ipv4 address 172.16.0.1 255.255.255.255
!
interface Loopback10
! Asociar vrf a la interfaz
! Asociar vrf a la interfaz
vrf AAA
ipv4 address 10.0.10.1 255.255.255.0
!
interface GigabitEthernet0/0/0/0
ipv4 address 172.16.12.1 255.255.255.0
!
! OSPF para conocer toda los loopbaks (bgp router-id)
! OSPF para conocer toda los loopbaks (bgp router-id)
router ospf 1
log adjacency changes detail
router-id 172.16.0.1
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
!
!
!
! Habiltar BGP
! Habiltar BGP
router bgp 100
bgp router-id 172.16.0.1
!
! Activar el VPNv4 globalmente
address-family vpnv4 unicast
!
! Configurar BGP neighbor
! Configurar BGP neighbor
neighbor 172.16.0.2
remote-as 100
update-source Loopback0
! Activar MP-BGP para VPNv4 para el neighbor (importante)
! Activar MP-BGP para VPNv4 para el neighbor (importante)
address-family vpnv4 unicast
!
!
vrf AAA
rd 333:3
address-family ipv4 unicast
redistribute connected
redistribute static
!
! (Opcional) Proceso IGP hacia el CE
neighbor XX
! (Opcional) Proceso IGP hacia el CE
neighbor XX
remote-as 100
address-family ipv4 unicast
default-originate
!
!
!
!
! Habiltar MPLS globalmente y asociar la interfaz
! Habiltar MPLS globalmente y asociar la interfaz
mpls ldp
router-id 172.16.0.1
router-id 172.16.0.1
interface GigabitEthernet0/0/0/0
!
!
end
R2
RP/0/0/CPU0:ASR2#sh run
hostname ASR2
vrf AAA
address-family ipv4 unicast
import route-target
333:3
!
export route-target
333:3
!
!
!
interface Loopback0
ipv4 address 172.16.0.2 255.255.255.255
!
interface Loopback20
vrf AAA
ipv4 address 10.0.20.1 255.255.255.0
!
interface GigabitEthernet0/0/0/0
ipv4 address 172.16.12.2 255.255.255.0
!
router ospf 1
log adjacency changes detail
router-id 172.16.0.2
area 0
interface Loopback0
!
interface GigabitEthernet0/0/0/0
!
!
!
router bgp 100
bgp router-id 172.16.0.2
!
address-family vpnv4 unicast
!
neighbor 172.16.0.1
remote-as 100
update-source Loopback0
address-family vpnv4 unicast
!
!
vrf AAA
rd 333:3
address-family ipv4 unicast
redistribute connected
redistribute static
!
! (Opcional)
! (Opcional)
neighbor 172.16.0.1
remote-as 100
address-family ipv4 unicast
default-originate
!
!
!
!
mpls ldp
router-id 172.16.0.2
interface GigabitEthernet0/0/0/0
interface GigabitEthernet0/0/0/0
!
!
end
VERIFICACIÓN
RP/0/0/CPU0:ARS1#sh route vrf AAA
<…output omitted…>
C 10.0.10.0/24 is directly connected, 03:38:01, Loopback10
L 10.0.10.1/32 is directly connected, 03:38:01, Loopback10
B 10.0.20.0/24 [200/0] via 172.16.0.2 (nexthop in vrf default), 00:36:02
RP/0/0/CPU0:ARS1#
RP/0/0/CPU0:ASR2#sh route vrf AAA
<…output omitted…>
B 10.0.10.0/24 [200/0] via 172.16.0.1 (nexthop in vrf default), 00:37:44
C 10.0.20.0/24 is directly connected, 00:45:05, Loopback20
L 10.0.20.1/32 is directly connected, 00:45:05, Loopback20
RP/0/0/CPU0:ASR2#